blob: 1b7ac6586ba19a53430b4f96d5b1f895f3c6bb8f [file] [log] [blame]
grammar t016actions;
options {
language = Python;
}
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}
;