|
@ -42,15 +42,15 @@ int main(int argc, char const *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]+/ ; \ |
|
|
|
|
|
operator : '+' | '-' | '*' | '/' ; \ |
|
|
|
|
|
|
|
|
number : /-?[0-9]([.][0-9]+)*/ ; \ |
|
|
|
|
|
operator : '+' | '-' | '*' | '/' | '%' ; \ |
|
|
expr : <number> | '(' <operator> <expr>+ ')' ; \ |
|
|
expr : <number> | '(' <operator> <expr>+ ')' ; \ |
|
|
lispy : /^/ <operator> <expr>+ /$/ ; \ |
|
|
lispy : /^/ <operator> <expr>+ /$/ ; \ |
|
|
", |
|
|
", |
|
|
Number, Operator, Expr, Lispy); |
|
|
Number, Operator, Expr, Lispy); |
|
|
|
|
|
|
|
|
/* Print version and exit information */ |
|
|
/* Print version and exit information */ |
|
|
puts("Lispy version 0.0.0.0.1"); |
|
|
|
|
|
|
|
|
puts("Lispy version 0.0.0.0.2"); |
|
|
puts("Press Ctrl+c to exit\n"); |
|
|
puts("Press Ctrl+c to exit\n"); |
|
|
|
|
|
|
|
|
/* In a never ending loop */ |
|
|
/* In a never ending loop */ |
|
|