private Set < TokenDefinition > extractHiddenAndIgnoredTokensFromGrammar ( ) { Set < TokenDefinition > hiddenAndIgnoredTokens = new LinkedHashSet < TokenDefinition > ( ) ; for ( TokenDefinition tokenDefinition : grammar . getTokenDefinitions ( ) . getDefinitions ( ) ) { Visibility visibility = tokenDefinition . getVisibility ( ) ; if ( ( visibility == Visibility . HIDDEN ) || ( visibility == Visibility . IGNORED ) ) { hiddenAndIgnoredTokens . add ( tokenDefinition ) ; } } return hiddenAndIgnoredTokens ; }
This method extracts all token definitions which are to be ignored or hidden to process them separately and to put them into special locations into the parser tree .