A hand-written compiler for a small, C-like language, targeting LLVM and built for learning purposes.
Just for reference, as the parser is implemented by hand. Nonterminals defined in token.h
program => block
block => expr_stmt+
expr_stmt =>
expr SEMI
funcdef =>
DEF ID LPAREN ID {COMMA ID} RPAREN LCURL expr RCURL
call =>
ID LPAREN expr{,expr} RPAREN
expr =>
expr ADD term |
expr SUB term |
term |
call |
funcdef
term =>
term MUL factor |
term DIV factor |
factor
factor =>
DBL{DBL} |
LPAREN expr RPAREN
Start Symbol: program