简体   繁体   中英

(E)BNF Parsing to XML

Is there any (E)BNF parser out there which is able to generate XML trees of the AST?

Rephrasing: what is the quickest way to compile an (E)BNF defined language into some sort of XML?

Bonus: Using Javascript :-)

It seems my best bet so far is to use AntLR and the StringTemplate Interface. It also supports a JavaScript target .

Not free, but generates XML: DMS Software Reengineering Toolkit . Available with a variety of predefined langauge defintions (C, C++, C#, Java, COBOL, Javascript, XML, ...).

The question is, what will you do with that? If you are processing some langauge seriously, you need much more than just the AST (almost always you need a symbol table).

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