You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
482 B

grammar t016actions;
options {
language = JavaScript;
}
declaration returns [name]
: functionHeader ';'
{$name = $functionHeader.name;}
;
functionHeader returns [name]
: type ID
{$name = $ID.text;}
;
type
: 'int'
| 'char'
| 'void'
;
ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
;
WS : ( ' '
| '\t'
| '\r'
| '\n'
)+
{_channel=HIDDEN}
;