Skip to content

reorganize grammar and tokens #18

Description

@drewbanin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions