mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-16 15:30:26 +00:00
Attempt to bring the grammar up to date.
This commit is contained in:
parent
043872584b
commit
783d8764ca
@ -501,11 +501,22 @@ The sense of the test can be inverted with `not`.
|
|||||||
Grammar
|
Grammar
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Program ::= {Defn} {Routine}.
|
Program ::= {TypeDefn} {Defn} {Routine}.
|
||||||
|
TypeDefn::= "typedef" Type Ident<new>.
|
||||||
Defn ::= Type Ident<new> [Constraints] (":" Literal | "@" LitWord).
|
Defn ::= Type Ident<new> [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].
|
Constrnt::= ["inputs" LocExprs] ["outputs" LocExprs] ["trashes" LocExprs].
|
||||||
Routine ::= "routine" Ident<new> Constraints (Block | "@" LitWord).
|
Routine ::= "define" Ident<new> Type (Block | "@" LitWord).
|
||||||
|
| "routine" Ident<new> Constraints (Block | "@" LitWord)
|
||||||
|
.
|
||||||
LocExprs::= LocExpr {"," LocExpr}.
|
LocExprs::= LocExpr {"," LocExpr}.
|
||||||
LocExpr ::= Register | Flag | Literal | Ident.
|
LocExpr ::= Register | Flag | Literal | Ident.
|
||||||
Register::= "a" | "x" | "y".
|
Register::= "a" | "x" | "y".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user