Laurent Thévenoux
042d578dd5
U920-002: avoid mismatched type error on root node
...
As the LexicalEnv.get method always return an array of root nodes
while the root node is defined in user code, we need to turn the Node
and LexicalEnv classes into generic traits and instantiate them using
the actual root node.
To make this works, root node declaration has to be changed from
`class FooNode : Node` to `class FooNode implements Node[FooNode]`,
which required to refactor a bit almost all the lkt tests.
2021-09-27 17:39:36 +02:00
Raphaël AMIARD
3eef9cdc25
RA22-015: make Node a base class rt. a trait
2020-06-30 15:43:53 +02:00
Raphaël AMIARD
119379f643
RA22-015 dsl_unparse: Unparse @with_lexer annotation
2020-06-30 15:43:53 +02:00
Pierre-Marie de Rodat
71f773e0ff
Rename SymbolNode to TokenNode
...
TN: RA22-015
2020-06-17 11:45:07 +02:00
Raphaël AMIARD
2060a7c36d
RA22-015: make token_node/root_node traits
2020-06-16 15:19:35 +02:00
Pierre-Marie de Rodat
adaebf3a3a
Lkt lowering: handle enum nodes (qualifier ones included)
...
TN: RA22-015
2020-06-15 16:11:44 +02:00
Pierre-Marie de Rodat
55fe04716e
dsl_unparse: fix syntax for qualifier enum nodes
...
TN: RA22-015
2020-06-12 14:01:11 +02:00
Raphaël AMIARD
a7cd8f3a39
RA22-015: New syntax for enum classes
2020-06-11 17:07:45 +02:00
Pierre-Marie de Rodat
770513f43d
Generate and interpret the @token_node node annotation
...
TN: RA22-015
2020-06-11 14:37:13 +02:00
Pierre-Marie de Rodat
2b9b33d6a0
Remove __future__ imports and adjust stylechecks
...
TN: T511-017
2020-05-26 12:33:48 +02:00
Pierre-Marie de Rodat
de58c96d16
Testsuite: factorize common lexers in the concrete syntax
...
TN: RA22-015
2020-03-16 10:41:18 +01:00
Pierre-Marie de Rodat
05ca4fbcb1
Slightly change lexer annotation syntax
...
Since @text, @trivia and @symbol take arguments, enforce parens for
them.
TN: RA22-015
2020-03-16 10:41:18 +01:00
Raphaël AMIARD
a27dc927d5
RA22-015: Remove as_bool from unparser result
2020-03-12 14:37:52 +01:00
Pierre-Marie de Rodat
a5a0cb8509
Lkt: restore type-inferred list parser: list+(...)/list*(...)
...
TN: RA22-015
2020-03-06 11:42:49 +01:00
Romain Beguet
0612dde534
RA22-015: Make WithText the default token action.
2020-03-05 17:01:26 +01:00
Romain Beguet
7287f3f275
RA22-015: Fix syntax of token families.
2020-03-05 17:01:26 +01:00
Pierre-Marie de Rodat
8d0ca9eb51
Lkt: change the syntax for grammar list expressions
...
TN: RA22-015
2020-02-27 18:17:42 +01:00
Raphaël AMIARD
3dfab64e9c
RA22-015: Introduce enum classes
2020-02-27 17:05:43 +01:00
Pierre-Marie de Rodat
383670d486
Extend support for LKT grammars, transition tests
...
TN: RA22-015
2020-02-27 13:43:20 +01:00
Pierre-Marie de Rodat
402e45bf79
Change the naming convention in the DSL for enum alternative types
...
Update the concrete syntax grammar to support it.
TN: RA22-015
2020-02-27 13:43:20 +01:00
Romain Beguet
9467a5a42c
RA22-015: Add lexer parser and unparser to concrete syntax.
2020-02-27 11:41:20 +01:00
Romain Beguet
e723071116
RA22-015: Unparse token names in lower case and avoid conflicts.
2020-02-26 17:06:07 +01:00
Pierre-Marie de Rodat
fed6874e3b
dsl_unparse: change the naming convention for grammars
...
TN: RA22-015
2020-02-26 12:09:38 +01:00
Pierre-Marie de Rodat
d8e21b08ba
dsl_unparse: fix unparsing of List parsers (switch + and *)
...
TN: RA22-015
2020-02-26 12:09:38 +01:00
Pierre-Marie de Rodat
5353f6da3a
dsl_unparse: preserve grammar rules order
...
TN: RA22-015
2020-02-26 12:09:38 +01:00