aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2017-07-28 12:01:42 +0200
committerCamil Staps2017-07-28 12:01:42 +0200
commit1f667a7b76fe9b705b383869a0be152138ce9954 (patch)
treebd28f45711e1fa941499b4716328601999d4d4b2
parentOptimise: remove needless moves between stacks (diff)
Update grammar
-rw-r--r--README.md18
1 files changed, 11 insertions, 7 deletions
diff --git a/README.md b/README.md
index f8dff10..1d43430 100644
--- a/README.md
+++ b/README.md
@@ -28,17 +28,21 @@ or can be interpreted with the [ABCMachine][abc-github] project.
<Expression> ::= <Name>
| <Literal>
- | <Name> '(' <Expression>-clist ')'
- | <Op1> <Expression>
- | <Expression> <Op2> <Expression>
- | '(' <Expression>-clist ')'
- | '(' <Expression> ')'
- | <Expression> '.' <Name>
+ | <Name> '(' <Expression>-clist ')' // Function application
+ | <Op1> <Expression> // Unary operator
+ | <Expression> <Op2> <Expression> // Binary operator
+ | '(' <Expression>-clist ')' // Tuple
+ | '[' <Type> ']' // Empty list
+ | '[' <Expression>-clist ']' // List shortcut
+ | <Expression> '.' <Name> // Field application
+ | '(' <Expression> ')' // Parenthised expression
<Op1> ::= '~' | '!'
-<Op2> ::= '+' | '-' | '*' | '/' | '%' | '==' | '||' | '&&'
+<Op2> ::= '+' | '-' | '*' | '/' | '%' | '==' | '||' | '&&' | ':'
<Type> ::= 'Bool' | 'Int' | 'Void'
+ | '(' <Type>-clist ')' // Tuple
+ | '[' <Type> ']' // List
<Literal> ::= <Bool> | <Int>
<Bool> ::= 'True' | 'False'