I'm new to CongoCC and migrating a JavaCC-generated expression parser, sqlexpr-javacc, to a CongoCC-generated parser, sqlexpr-congocc. The language is a subset of SQL WHERE clause expressions.
I migrated the Javacc SqlExprParser.jj definition to the CongoCC SqlExprParser.ccc definition. When I run the goodFilters() unit test in ParserTest.java, I get the following error.
FAILED: net.magneticpotato.sqlexpr.congocc.parser.ParserTest.goodFilters
jakarta.jms.InvalidSelectorException: name = 'Bud' AND tenant_id = 'iplantc.org'
at net.magneticpotato.sqlexpr.congocc.parser.SqlExprParser.parse(SqlExprParser.java:91)
at net.magneticpotato.sqlexpr.congocc.parser.SqlExprParser.parse(SqlExprParser.java:63)
at net.magneticpotato.sqlexpr.congocc.parser.ParserTest.goodFilters(ParserTest.java:26)
...
Caused by: java.lang.NullPointerException: Cannot invoke "net.magneticpotato.sqlexpr.congocc.parser.Token.getTokenSource()" because "this.lastConsumedToken" is null
at net.magneticpotato.sqlexpr.congocc.parser.SqlExprParser.openNodeScope(SqlExprParser.java:3556)
at net.magneticpotato.sqlexpr.congocc.parser.SqlExprParser.JmsSelector(SqlExprParser.java:289)
at net.magneticpotato.sqlexpr.congocc.parser.SqlExprParser.parse(SqlExprParser.java:89)
The test code is the same as in the JavaCC-generated parser and it works there. Before I go down a rabbit hole, is this a familiar error that has an simple fix? Thanks!