directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <>
Subject Re: Client API Schema support
Date Fri, 06 Feb 2015 21:35:56 GMT
On 02/06/2015 04:17 PM, Radovan Semancik wrote:
> Hi,
> After some delay I finally found a time to work on this. After few
> simple fixes I got to this:
> java.text.ParseException: ERR_04243 Parser failure on matching rule
> description:
>         ( NAME ( 'relativeTimeLTOrderingMatch'
> '' ) SYNTAX )
> Antlr message: unexpected token:
> Antlr column: 33
>  I'm quite new to antlr and I'm still tring to find my way around. But
> I'm sure that there is someone on the list that can save me a huge
> amount of time. I do not expect anyone to fix this for me ... but ...
> the grammar is not trivial and it is difficult to figure out what
> exactly is wrong. How do you usually debug the antlr rule? Is there any
> logging mode that can be turned on and which will dump the tokens and
> rules that antlr encoures? Or some other trick?

Short answer: for all the schema parsers (in this case
MatchingRuleDescriptionSchemaParser) enable the quirks mode with
setQuirksMode(true). The 2nd name contains a dot which is not allowed
according to RFC 4512, but the quirks mode relaxes that rule.

I don't think there is a way to dump the antlr state. In general you
need to debug through the generated AntlrSchemaParser. Please look into
MatchingRuleDescriptionSchemaParser line 99. There we catch the original
exception thrown by antlr which contains the detailed stack trace,
probably it's not good to swallow the original exception and stack trace.

Kind Regards,

View raw message