Created
November 18, 2020 21:45
-
-
Save ThatXliner/a3e03c8010986e841bf62de34a97e922 to your computer and use it in GitHub Desktop.
A subset of LaTeX, meant to be intuitive and easy to use. Licensed GNU GPL v3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%import common (WS, LETTER, NUMBER) | |
%ignore WS | |
start: exp? | |
?exp : term | |
| mul | |
| div | |
| sub | |
| add | |
| eq | |
VARIABLE: LETTER [("e"|"E") NUMBER] | |
?parenthesis: "(" exp ")" | |
add: add? term? "+" exp | |
sub: sub? term? "-" exp | |
div: div? term? "/" exp | |
mul: mul? term? "*" exp | |
pow: pow? term "^" term | |
eq: exp "=" exp | |
fra: "\\f" term "/" term | |
vmul: (NUMBER raw_term) | (raw_term term) | |
?raw_term: (parenthesis | fra | pow | VARIABLE) | |
?term: vmul | parenthesis | fra | pow | VARIABLE | NUMBER | ("-" (parenthesis | fra | VARIABLE | NUMBER)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment