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

Andreas Ravnestad andreas.ravnestad at gmail.com
Mon Oct 8 07:51:18 PDT 2007


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


More information about the antlr-interest mailing list