Would it be possible to modify the current ebnf grammar so instead the current
syntax where you're forced to have the first rule and colon after the rule name on
the same line:
grammar = '''
rule : rule1
| rule2
'''
you could have indented and clean blocks like this (fornmat used on glsl specs):
grammar = '''
rule :
rule1
rule2
'''
or maybe (not very clean one):
grammar = '''
rule :
| rule1
| rule2
'''
or:
grammar = '''
rule
: rule1
| rule2
'''
or (inspired from Antlr4 ):
grammar = '''
rule
: rule1
| rule2
;
'''
Rationale: That way the EBNF grammar will become much more readable and not only that, you'll be able to fold long grammars easily on your favourite text editor because the grammar now has proper indentation, example here.
Guess it's a matter to tweak a bit this file, even if you don't like the idea, could you explain how you'd do so?
Thanks.
Would it be possible to modify the current ebnf grammar so instead the current
syntax where you're forced to have the first rule and colon after the rule name on
the same line:
you could have indented and clean blocks like this (fornmat used on glsl specs):
or maybe (not very clean one):
or:
or (inspired from Antlr4 ):
Rationale: That way the EBNF grammar will become much more readable and not only that, you'll be able to fold long grammars easily on your favourite text editor because the grammar now has proper indentation, example here.
Guess it's a matter to tweak a bit this file, even if you don't like the idea, could you explain how you'd do so?
Thanks.