{
input = new NoCaseSensitiveStream(new StringReader(propertyName));
}
catch (IOException ex)
{
throw new PropertyAccessException("IOException parsing property name '" + propertyName + '\'', ex);
}
EsperEPL2GrammarLexer lex = new EsperEPL2GrammarLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lex);
EsperEPL2GrammarParser g = new EsperEPL2GrammarParser(tokens);
EsperEPL2GrammarParser.startEventPropertyRule_return r;
try
{
r = g.startEventPropertyRule();
}
catch (RuntimeException e)
{
if (log.isDebugEnabled())
{
log.debug("Error parsing property expression [" + propertyName + "]", e);
}
if (e.getCause() instanceof RecognitionException)
{
throw ExceptionConvertor.convertProperty((RecognitionException)e.getCause(), propertyName, true, g);
}
else
{
throw e;
}
}
catch (RecognitionException e)
{
// Check for keywords and escape each, parse again
String escapedPropertyName = escapeKeywords(tokens);
CharStream inputEscaped;
try
{
inputEscaped = new NoCaseSensitiveStream(new StringReader(escapedPropertyName));
}
catch (IOException ex)
{
throw new PropertyAccessException("IOException parsing property name '" + propertyName + '\'', ex);
}
EsperEPL2GrammarLexer lexEscaped = new EsperEPL2GrammarLexer(inputEscaped);
CommonTokenStream tokensEscaped = new CommonTokenStream(lexEscaped);
EsperEPL2GrammarParser gEscaped = new EsperEPL2GrammarParser(tokensEscaped);