Added mpc parser
This commit is contained in:
parent
4d86d79a2f
commit
794ff166db
2 changed files with 3960 additions and 1 deletions
2
prompt.c
2
prompt.c
|
@ -70,7 +70,7 @@ int main (int argc, char** argv) {
|
||||||
// Define them with the following language
|
// Define them with the following language
|
||||||
mpca_lang(MPCA_LANG_DEFAULT,
|
mpca_lang(MPCA_LANG_DEFAULT,
|
||||||
"\
|
"\
|
||||||
number : /-?[0-9]+/; \
|
number : /-?[0-9]+\.?[0-9]*/; \
|
||||||
operator : '+' | '-' | '*' | '/' | '%' \
|
operator : '+' | '-' | '*' | '/' | '%' \
|
||||||
| '^' | \"min\" | \"max\"; \
|
| '^' | \"min\" | \"max\"; \
|
||||||
expr : <number> | '(' <operator> <expr>+ ')'; \
|
expr : <number> | '(' <operator> <expr>+ ')'; \
|
||||||
|
|
Reference in a new issue