1grammar t016actions; 2options { 3 language =Cpp; 4} 5 6@lexer::includes 7{ 8#include "UserTestTraits.hpp" 9} 10@lexer::namespace 11{ Antlr3Test } 12 13@parser::includes { 14#include "UserTestTraits.hpp" 15} 16@parser::namespace 17{ Antlr3Test } 18 19declaration returns [name] 20 : functionHeader ';' 21 {$name = $functionHeader.name} 22 ; 23 24functionHeader returns [name] 25 : type ID 26 {$name = $ID.text} 27 ; 28 29type 30 : 'int' 31 | 'char' 32 | 'void' 33 ; 34 35ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* 36 ; 37 38WS : ( ' ' 39 | '\t' 40 | '\r' 41 | '\n' 42 )+ 43 {$channel=HIDDEN} 44 ; 45