简体   繁体   中英

get regex from antlr grammar

there is a way to get regexes from an antlr grammar file? I have a langage grammar and I need token regexes to make an ace editor?

thanks in advance

Sure. Build a parser for ANTLR grammars (ANTLR itself in fact already does this) that constructs a tree for the regexps.

You'll still have to translate those regexps into a form compatible for your ACE editor. Such a project is likely to take you days.

I think the effort to do this likely exceeds the cost to simply convert the regexes by hand. I already said this to you once.

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