Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CalcLang

A simple calculator language implemented using Flex (lex) and Bison (yacc).

Features

  • Integer variables
  • Arithmetic expressions
  • Input and print statements
  • Simple commenting: $&( at the start of line

Files

  • calc.l — Lexical analyzer (Flex file)
  • calc.y — Parser (Bison file)

Build Instructions

  1. Make sure you have Flex, Bison, and GCC installed.
  2. Run:
    flex calc.l
    bison -d calc.y
    gcc lex.yy.c calc.tab.c -o calcprog
    
  3. After compiling, run the interpreter:
    ./calcprog
    

Output

CalcLang Output Example

About

A simple calculator language implemented using Flex (lex) and Bison (yacc)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages