1 grammar t023scopes; 2 3 options { 4 language=JavaScript; 5 } 6 7 prog 8 scope { 9 name 10 } 11 : ID {$prog::name=$ID.text;} 12 ; 13 14 ID : ('a'..'z')+ 15 ; 16 17 WS : (' '|'\n'|'\r')+ {$channel=org.antlr.runtime.BaseRecognizer.HIDDEN;} 18 ; 19