It is not possible to use grammars that contain any Python keywords as rule name.
Consider the following ANTLR grammar:
grammar keyword;
start: False;
False: 'anything';`
This wil procude the keywordGenerator.py with the following function:
@depthcontrol
def False(self, parent=None):
current = UnlexerRule(name='False', parent=parent)
self._enter_rule(current)
UnlexerRule(src='anything', parent=current)
self._exit_rule(current)
return current
False.min_depth = 0
Because False is a reserved keyword in Python this is not valid Python code.
The bug occurs with every keyword.
It is not possible to use grammars that contain any Python keywords as rule name.
Consider the following ANTLR grammar:
This wil procude the keywordGenerator.py with the following function:
Because
Falseis a reserved keyword in Python this is not valid Python code.The bug occurs with every keyword.