Mercurial > hg > index.cgi
diff lwcc/tree.c @ 498:1bd2d590d734
Rejig parser to eliminate lemon
No longer use lemon for building the parser. It adds too much complexity,
really, and a hand written recursive descent parser is far more flexible.
The current iteration can handle exactly one statement: "return <int>".
author | William Astle <lost@l-w.ca> |
---|---|
date | Thu, 08 Aug 2019 23:32:23 -0600 |
parents | a3e277c58df9 |
children | f3e9732973f1 |
line wrap: on
line diff
--- a/lwcc/tree.c Mon Aug 05 21:38:23 2019 -0600 +++ b/lwcc/tree.c Thu Aug 08 23:32:23 2019 -0600 @@ -51,6 +51,8 @@ "FUNDECL", "FUNARGS", "BLOCK", + "STMT_RETURN", + "CONST_INT", }; @@ -77,6 +79,7 @@ break; case NODE_IDENT: + case NODE_CONST_INT: r -> strval = lw_strdup(va_arg(args, char *)); break;