Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
teverett committed Jul 15, 2018
1 parent ee7a73d commit b854a7b
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions mumps/mumps.g4
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
BSD License
Copyright (c) 2013, Tom Everett
Copyright (c) 2013, 2018, Tom Everett
All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -105,6 +105,7 @@ expression

term
: variable
| function
| NUMBER
| LPAREN expression RPAREN
;
Expand All @@ -119,9 +120,13 @@ identifier
;

variable
: (CARAT | DOLLAR | AMPERSAND)* identifier (LPAREN arglist RPAREN)?
: (CARAT | AMPERSAND)* identifier
;

function
: DOLLAR identifier (LPAREN arglist RPAREN)?
;

/*
* COMMANDS
*
Expand All @@ -132,19 +137,19 @@ variable
* command word and its post-conditional, if present, and the argument.
*/
break_
: (BREAK) postcondition?
: BREAK postcondition?
;

do_
: (DO) postcondition? SPACE + identifier (LPAREN paramlist? RPAREN)?
: DO postcondition? SPACE + identifier (LPAREN paramlist? RPAREN)?
;

for_
: FOR SPACE + term EQUALS term COLON (term COLON)? term SPACE + (command SPACE?)* COLON SPACE* condition
;

halt_
: (HALT) postcondition?
: HALT postcondition?
;

hang_
Expand All @@ -164,27 +169,27 @@ merge_
;

new_
: (NEW) postcondition? SPACE + arglist
: NEW postcondition? SPACE + arglist
;

quit_
: (QUIT) postcondition? (SPACE + term)?
: QUIT postcondition? (SPACE + term)?
;

read_
: (READ) postcondition? SPACE + arglist
: READ postcondition? SPACE + arglist
;

set_
: (SET) postcondition? SPACE + assign (',' assign)*
: SET postcondition? SPACE + assign (',' assign)*
;

view_
: VIEW postcondition? SPACE + IDENTIFIER
;

write_
: (WRITE) postcondition? SPACE + arglist
: WRITE postcondition? SPACE + arglist
;

xecute_
Expand Down Expand Up @@ -488,11 +493,6 @@ NUMBER
;


SPACE
: ' '
;


NOT
: '\''
;
Expand Down Expand Up @@ -632,9 +632,12 @@ COMMENT
: ';' ~[\r\n]* -> skip
;

SPACE
: ' '
;

CR
: '\r'? '\n'
: [\r\n]+
;


Expand Down

0 comments on commit b854a7b

Please sign in to comment.