1

For example in rfc2047

token = 1*<Any CHAR except SPACE, CTLs, and especials>
especials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "
<"> / "/" / "[" / "]" / "?" / "." / "="

Write all permitted characters for token rule or how to combine especials rule?

1 Answer 1

3

ANTLR 4 includes an inclusive set notation similar to regular expressions. The set can then be negated by using the ~ operator. Here are two examples showing an inclusive and exclusive set.

LETTER : [a-zA-Z];
NOT_LETTER : ~[a-zA-Z];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.