regexp-tree icon indicating copy to clipboard operation
regexp-tree copied to clipboard

Parser/generator: implement PCRE mode

Open DmitrySoshnikov opened this issue 7 years ago • 1 comments

Currently we support only JavaScript regexes. However, regexp-tree can be language-agnostic, and support any other formats/modes/syntaxes of regular expressions. Thus, transform, and traverse modules can be fully reused for any syntax.

E.g., a named capturing group in PCRE, and Python syntax is:

(?P<foo>bar)

Similarly, we should support other syntax specifics.

DmitrySoshnikov avatar Apr 10 '17 04:04 DmitrySoshnikov

We can have plugins directory with own parser, generator, etc.

src/plugins
  /pcre
    /parser
    /generator

The PCREGenerator class can extend default generator with own node types.

For parser we can copy original BNF file, and extend it with functionality needed for PCRE.

DmitrySoshnikov avatar Jun 25 '19 18:06 DmitrySoshnikov