-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I'm looking at lpeg grammars and it's variants to generate an EBNF understood by https://www.bottlecaps.de/rr/ui using a lpeg/re varaint to do the transformation (see also here edubart/nelua-lang#190), bellow is the output for libs/repreprocess/grammar.relabel .
Start ::=
chunk ( '!' . | ( . * ) )
chunk ::=
( statement + | )
statement ::=
( comment | if | block | include | define | source | #xA ) Cl
comment ::=
Sp * "//" ( '!' #xA . ) * | Sp * "/*" ( '!' "*/" . ) * "*/"
if ::=
( directive_if Cl chunk elseif ? ( directive_endif | ) )
elseif ::=
( directive_elseif Cl chunk ( Cl ( elseif | else ) ) ? )
else ::=
directive_else Cl chunk
block ::=
( directive_block_start Cl chunk ( directive_block_end | ) )
include ::=
( directive_include Cl )
define ::=
( directive_define Cl )
source ::=
'!' directive '!' "//" '!' "/*" ( '!' #xA . ) +
directive ::=
directive_if | directive_elseif | directive_else | directive_endif | directive_block_start | directive_block_end | directive_include | directive_define | directive_unknown
directive_if ::=
"#if" Sp + WORD ( Sp * "==" Sp * WORD | )
directive_elseif ::=
"#elseif" Sp + WORD ( Sp * "==" Sp * WORD | )
directive_else ::=
"#else"
directive_endif ::=
"#endif"
directive_block_start ::=
"#block" Sp + WORD
directive_block_end ::=
"#endblock"
directive_include ::=
"#include" Sp + WORD
directive_define ::=
"#define" Sp + WORD ( Sp + WORD | )
directive_unknown ::=
"#" ( WORD ( '!' #xA . ) * )
Cl ::=
Sp * #xA ?
Sp ::=
' ' | #x9 //%esc_t
WORD ::=
[a-zA-Z_] [a-zA-Z_0-9] *
HASH ::=
"#"
Metadata
Metadata
Assignees
Labels
No labels