question: Map < String , Integer > createConstMap ( String grammarContent ) { Map < String , Integer > parserConstMap = new HashMap < > ( ) ; Matcher matcher = CONST_DEF_PATTERN . matcher ( grammarContent ) ; while ( matcher . find ( ) ) { String name = matcher . group ( 1 ) ; int value = Integer . parseInt ( matcher . group ( 2 ) ) ; parserConstMap . put ( name , value ) ; } return parserConstMap ; }
target:  Parses definition of token constants. Package visible for testing.