Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 586
alphadogg Avatar asked Oct 25 '22 19:10

alphadogg


1 Answers

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

like image 94
Bart Kiers Avatar answered Nov 08 '22 04:11

Bart Kiers