Arithmetic evaluation/C: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2:
This is a LL(1) recursive descent parser. Only performs integer division. There is a function for every non-terminal in the grammar, save add_op and mult_op, which were lumped into term_tail and factor_tail respectively.
<syntaxhighlight lang="c">
#include <stdio.h>
#include <ctype.h>
Line 226 ⟶ 227:
int main(int argc, char** argv) {
Expr* expr = NULL;
G_STRING_ITERATOR = 0;
if(argc > 1) {
Line 234 ⟶ 236:
return 0;
}
</syntaxhighlight>
|