[antlr-interest] The unary not (~) vs. W3C EBNF dash operator

Johannes Luber jaluber at gmx.de
Mon Oct 8 07:56:40 PDT 2007


Andreas Ravnestad wrote:
> The W3C uses an operator in their EBNFs designated by a dash (-), and
> it is defined as follows (see [1]): A - B matches any string that
> matches A but does not match B.
> 
> For now, I have simply replaced the dashes with tilde in the ANTLR
> grammar, however this is not semantically correct. Is there a
> semantically equivalent operator in ANTLR, or is it necessary to
> rewrite grammar rules that uses the dash operator?
> 
> - Andreas Ravnestad
> 
> [1] http://www.w3.org/TR/REC-xml/#sec-notation
> 

ANTLR doesn't support this dash notation. For now the only correct way
is create the subset manually.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list