StatementList -> Statement StatementList
| Statement
Statement -> IDENTIFIER ':' IDENTIFIER '=' Expression
| IDENTIFIER ':' '=' Expression
| IDENTIFIER '=' Expression
| FunctionCall
| 'return' OptionalExpression
| 'function' IDENTIFIER '(' OptionalParameterList ')' OptionalReturn '{' StatementList '}'
| 'if' '(' Expression ')' '{' StatementList '}'
OptionalReturn -> '->' IDENTIFIER
| e
OptionalArgumentList -> ArgumentList
| e
ArgumentList -> Expression ',' ArgumentList
| Expression
OptionalParameterList -> ParameterList
| e
ParameterList -> Parameter ',' ParameterList
| Parameter
Parameter -> IDENTIFIER ':' IDENTIFIER
Expression -> MinusTerm '+' Expression
| MinusTerm '-' Expression
| MinusTerm '*' Expression
| MinusTerm '/' Expression
| MinusTerm '==' Expression
| MinusTerm '<' Expression
| MinusTerm '<=' Expression
| MinusTerm '>' Expression
| MinusTerm '>=' Expression
| MinusTerm
OptionalExpression -> Expression
| e
MinusTerm -> '-' Term
| Term
Term -> INTEGER
| REAL
| IDENTIFIER
| FunctionCall
| '(' Expression ')'
FunctionCall -> IDENTIFIER '(' OptionalArgumentList ')'
-
Notifications
You must be signed in to change notification settings - Fork 0
l0f3n/Madoka
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A compiler for my toy programming language Madoka
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published