/cpp-expr-analyzer

Lexer/Parser for a simple expression grammar

Primary LanguageC++MIT LicenseMIT

Simple Lexer/Parser for <expr> Grammar 🪄

The grammar rules are as follows:

<assign> -> <id> = <expr>
<expr> -> <term> {+ <term>}
<term> -> <factor> {* <factor>}
<factor> -> ( <expr> ) | <id> | <num>
<id> -> a | b | c | ... | z
<num> -> 0 | 1 | 2 | ...