Skip to content

Parser combinator "exception" operator #1229

Closed
@scabug

Description

@scabug

Scala's parser combinator library doesn't have an analogue to the
EVNF "except symbol" - from the ISO standard for EBNF (14977), where

p - q

accepts if the left hand side accepts and the right hand side rejects.

Adding support for it would make it easier to translate EBNF notation
directly into parser combinators. As far as I can tell, this would be
simple, as:

p - q == not(q) ~> p

A proposed patch against r15798 is attached.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions