Attempt to bring the grammar up to date.
Chris Pressey
4 years ago
500 | 500 | Grammar |
501 | 501 | ------- |
502 | 502 | |
503 | Program ::= {Defn} {Routine}. | |
503 | Program ::= {TypeDefn} {Defn} {Routine}. | |
504 | TypeDefn::= "typedef" Type Ident<new>. | |
504 | 505 | Defn ::= Type Ident<new> [Constraints] (":" Literal | "@" LitWord). |
505 | Type ::= "byte" ["table"] | "vector" | |
506 | Type ::= "(" Type ")" | TypeExpr ["table" TypeSize]. | |
507 | TypeExpr::= "byte" | |
508 | | "word" | |
509 | | "buffer" TypeSize | |
510 | | "pointer" | |
511 | | "vector" Type | |
512 | | "routine" Constraints | |
513 | . | |
514 | TypeSize::= "[" LitWord "]". | |
506 | 515 | Constrnt::= ["inputs" LocExprs] ["outputs" LocExprs] ["trashes" LocExprs]. |
507 | Routine ::= "routine" Ident<new> Constraints (Block | "@" LitWord). | |
516 | Routine ::= "define" Ident<new> Type (Block | "@" LitWord). | |
517 | | "routine" Ident<new> Constraints (Block | "@" LitWord) | |
518 | . | |
508 | 519 | LocExprs::= LocExpr {"," LocExpr}. |
509 | 520 | LocExpr ::= Register | Flag | Literal | Ident. |
510 | 521 | Register::= "a" | "x" | "y". |