Parser & Lexical Analyzer for a simple Programming Language grammar.
statement = {expression ";" } "."
expression = term { ( "+" | "-" ) term }
term = factor {("\*" | "/") factor}
factor = number | "-"number | "(" expression ")"
For learning about programming language grammar check out Montana State University lecture.
Accepts expressions from either console or file. Able to evaluate expressions given that the grammar is correct. Raises an exception and exits if grammar is invalid.
Includes Parser and Lexical Analyser which are able to process expressions which can contain:
- numbers
- negative numbers
- expressions in parenthesiss
- addition and subtraction
- multiplication and division