• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1grammar t016actions;
2options {
3  language = Python;
4}
5
6declaration returns [name]
7    :   functionHeader ';'
8        {$name = $functionHeader.name}
9    ;
10
11functionHeader returns [name]
12    :   type ID
13	{$name = $ID.text}
14    ;
15
16type
17    :   'int'
18    |   'char'
19    |   'void'
20    ;
21
22ID  :   ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
23    ;
24
25WS  :   (   ' '
26        |   '\t'
27        |   '\r'
28        |   '\n'
29        )+
30        {$channel=HIDDEN}
31    ;
32