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;
}

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 ; }
parses definition of token constants . package visible for testing .
