Hi everyone,
I need an XQuery parser, and to that end I have copied and then massaged the original XQuery 3.1 grammar I copied from
here. The resulting work-in-progress grammar can be found
here, the only changes so far are to make the grammar palatable to ANTLR 4, which includes splitting up a couple of rules.
However the grammar as it is gives me errors:
error(134): xquery31.g4:178:26: rule reference PragmaContentsInternal is not currently supported in a set
The same errors appear at other src locations for DirPIContentsInternal, CDataSectionContentsInternal, StringConstructorCharsInternal, and CommentContentsInternal.
In addition to the above there are a couple of warnings but they look unrelated to this specific problem.
A quick google search suggests that I should inline the offending rules. Unfortunately that also results in errors:
error(50): xquery31.g4:177:31: syntax error: missing RPAREN at '*' while looking for lexer rule element
error(50): xquery31.g4:177:44: syntax error: extraneous input ')' expecting SEMI while matching a lexer rule
There are similar errors for DirPIContentsInternal, CDataSectionContentsInternal, StringConstructorCharsInternal, and CommentContentsInternal.
Given this catch22 I'm not really sure what I can do about this. Can anyone help me out?