alphadogg
alphadogg

Reputation: 12900

Perl Regex Grammar For ANTLR Use

I need to create a regex parser for a project and I am using ANTLR v3 to do this. I am trying to find an up-to-date, Perl6-like regex grammar. Does anyone have a source? Googling for this has been difficult for some reason.

Upvotes: 5

Views: 1914

Answers (1)

Bart Kiers
Bart Kiers

Reputation: 170158

By no means a complete coverage of Perl 6 PCRE's grammar, but it's a start: https://github.com/bkiers/PCREParser

EDIT

A bit of a late update, I know, but it may be of interest to future visitors of this Q&A.

I've updated the grammar to conform more closely to the PCRE specs. Before delving in the code on Github, you can give the generated parser a test on the page: pcreparser.appspot.com

Upvotes: 3

Related Questions