break up lang.lang into a bunch of smaller files which combine the grammar and parsed classes. Eg:
# lang/expressions/case.py
class CaseWhenExpression(BaseExpression):
@classmethod
def grammar(self):
toks = (CASE + ...)
toks.setParseAction(cls.from_tokens)
@classmethod
def from_tokens(cls, string, loc, toks):
return CaseWhenExpression(...)
Then call grammar() on everything from lang.lang to assemble the full grammar
break up
lang.langinto a bunch of smaller files which combine the grammar and parsed classes. Eg:Then call
grammar()on everything from lang.lang to assemble the full grammar