diff --git a/doc/SixtyPical.md b/doc/SixtyPical.md index afacd4c..9a6b29b 100644 --- a/doc/SixtyPical.md +++ b/doc/SixtyPical.md @@ -501,11 +501,22 @@ The sense of the test can be inverted with `not`. Grammar ------- - Program ::= {Defn} {Routine}. + Program ::= {TypeDefn} {Defn} {Routine}. + TypeDefn::= "typedef" Type Ident. Defn ::= Type Ident [Constraints] (":" Literal | "@" LitWord). - Type ::= "byte" ["table"] | "vector" + Type ::= "(" Type ")" | TypeExpr ["table" TypeSize]. + TypeExpr::= "byte" + | "word" + | "buffer" TypeSize + | "pointer" + | "vector" Type + | "routine" Constraints + . + TypeSize::= "[" LitWord "]". Constrnt::= ["inputs" LocExprs] ["outputs" LocExprs] ["trashes" LocExprs]. - Routine ::= "routine" Ident Constraints (Block | "@" LitWord). + Routine ::= "define" Ident Type (Block | "@" LitWord). + | "routine" Ident Constraints (Block | "@" LitWord) + . LocExprs::= LocExpr {"," LocExpr}. LocExpr ::= Register | Flag | Literal | Ident. Register::= "a" | "x" | "y".