Support for multi-character terminals in the syntax.
Chris Pressey
1 year, 11 months ago
119 | 119 |
### Syntax
|
120 | 120 |
|
121 | 121 |
* A syntax for comments.
|
122 | |
* Terminals should be multi-character in the syntax.
|
123 | 122 |
* Syntax for declaring global variables (with a type?).
|
124 | 123 |
|
125 | 124 |
### Semantics
|
57 | 57 |
|
58 | 58 |
Goal ::= "f" "o" "o";
|
59 | 59 |
<=== fog
|
|
60 |
???> Failure
|
|
61 |
|
|
62 |
Goal ::= "foo";
|
|
63 |
<=== foom
|
|
64 |
===> Remaining: "m"
|
|
65 |
|
|
66 |
Goal ::= "foo";
|
|
67 |
<=== fo
|
60 | 68 |
???> Failure
|
61 | 69 |
|
62 | 70 |
Alternation and recursion.
|
18 | 18 |
|
19 | 19 |
Goal ::= "f" "o" "o";
|
20 | 20 |
===> Grammar [("Goal",Alt [Seq [Terminal 'f',Terminal 'o',Terminal 'o']])]
|
|
21 |
|
|
22 |
Multi-character terminal.
|
|
23 |
|
|
24 |
Goal ::= "foo";
|
|
25 |
===> Grammar [("Goal",Alt [Seq [Seq [Terminal 'f',Terminal 'o',Terminal 'o']]])]
|
21 | 26 |
|
22 | 27 |
Alternation and recursion.
|
23 | 28 |
|