GH-111485: Separate out parsing, analysis and code-gen phases of tier 1 code generator (GH-112299)

This commit is contained in:
Mark Shannon 2023-12-07 12:49:40 +00:00 committed by GitHub
parent 3d712a9f4c
commit b449415b2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1675 additions and 526 deletions

View file

@ -141,10 +141,11 @@ class Pseudo(Node):
flags: list[str] # instr flags to set on the pseudo instruction
targets: list[str] # opcodes this can be replaced by
AstNode = InstDef | Macro | Pseudo | Family
class Parser(PLexer):
@contextual
def definition(self) -> InstDef | Macro | Pseudo | Family | None:
def definition(self) -> AstNode | None:
if macro := self.macro_def():
return macro
if family := self.family_def():