This commit is contained in:
Tom Everett
2016-02-29 20:24:34 -07:00
parent bcc2b4162b
commit 7f782ab66f
+18 -3
View File
@@ -37,7 +37,7 @@ prog
; ;
line line
: ( label | declarations)* comment? eol : declarations? comment? eol
; ;
declarations declarations
@@ -46,6 +46,7 @@ declarations
declaration declaration
: instruction : instruction
| label
; ;
instruction instruction
@@ -85,7 +86,7 @@ comment
; ;
label label
: IDENTIFIER ':' : LABEL argument?
; ;
variable variable
@@ -103,6 +104,16 @@ opcode
| 'sys' | 'sys'
| 'sna' | 'sna'
| 'spa' | 'spa'
| 'lacq'
| 'lrss'
| 'dzm'
| 'sza'
| 'lmq'
| 'cll'
| 'als'
| 'omq'
| 'isz'
| 'sma'
; ;
LOC LOC
@@ -129,8 +140,12 @@ DIV
: '/' : '/'
; ;
LABEL
: IDENTIFIER ':'
;
IDENTIFIER IDENTIFIER
: [a-zA-Z]+ : [a-zA-Z0-9]+
; ;
OCTAL_LITERAL OCTAL_LITERAL