git @ Cat's Eye Technologies Fountain / c22c1df
Support for multi-character terminals in the syntax. Chris Pressey 1 year, 11 months ago
3 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
119119 ### Syntax
120120
121121 * A syntax for comments.
122 * Terminals should be multi-character in the syntax.
123122 * Syntax for declaring global variables (with a type?).
124123
125124 ### Semantics
5757
5858 Goal ::= "f" "o" "o";
5959 <=== fog
60 ???> Failure
61
62 Goal ::= "foo";
63 <=== foom
64 ===> Remaining: "m"
65
66 Goal ::= "foo";
67 <=== fo
6068 ???> Failure
6169
6270 Alternation and recursion.
1818
1919 Goal ::= "f" "o" "o";
2020 ===> 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']]])]
2126
2227 Alternation and recursion.
2328