简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM