Grammar lexer = eg.getLexerGrammar();
if(lexer == null) {
throw new RuntimeException("Lexer is null. Check the grammar before running the interpreterTab.");
}
Interpreter lexEngine = new CustomInterpreter(lexer, input);
FilteringTokenStream tokens = new FilteringTokenStream(lexEngine);
StringTokenizer tk = new StringTokenizer(tokensToIgnoreLabel.getText(), " ");
while ( tk.hasMoreTokens() ) {
String tokenName = tk.nextToken();
tokens.setTokenTypeChannel(lexer.getTokenType(tokenName), Token.HIDDEN_CHANNEL);
}
Interpreter parseEngine = new CustomInterpreter(parser, tokens);
ParseTree t = null;
try {
if(ATEToken.isLexerName(startSymbol)) {
t = lexEngine.parse(startSymbol);
} else {
t = parseEngine.parse(startSymbol);
}
} catch (Exception e) {
window.consoleTab.println(e);
}