git @ Cat's Eye Technologies SixtyPical / 783d876
Attempt to bring the grammar up to date. Chris Pressey 3 years ago
1 changed file(s) with 14 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
500500 Grammar
501501 -------
502502
503 Program ::= {Defn} {Routine}.
503 Program ::= {TypeDefn} {Defn} {Routine}.
504 TypeDefn::= "typedef" Type Ident<new>.
504505 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 "]".
506515 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 .
508519 LocExprs::= LocExpr {"," LocExpr}.
509520 LocExpr ::= Register | Flag | Literal | Ident.
510521 Register::= "a" | "x" | "y".