< Markup spec
The definitive tutorial on ANTLR4. Learn everything you need to know; with code in JavaScript, Python, Java and C#. Best practices and tips included.
EBNF grammar project
- BNF
I will henceforth be describing the wikitext grammar uniquely in ANTLR format, which has many advantages. Primarily it can be readily validated right now using ANTLR or ANTLRWorks.
- In this tutorial, I’ll show you how to create a simple programming language using ANTLR4 and Java. You’ll learn how to create a simple grammar, generate a parse tree for it, and interpret a program that conforms to it.
- ANTLRWorks is a novel grammar development environment for ANTLR v3 grammars written by Jean Bovet (with suggested use cases from Terence Parr). It combines an excellent grammar-aware editor with an interpreter for rapid prototyping and a language-agnostic debugger for isolating grammar errors. ANTLRWorks helps eliminate grammar nondeterminisms.
- /draft - Steve Bennett's horrible draft version of the grammar. Feel free to improve.
Status[edit]
Currently 'promising vaporware'.
- Good: ANTLR grammar looks capable of describing much more of MediaWiki wikitext than EBNF.
- Bad:
- ANTLR doesn't yet render to PHP.
- Will need someone to write the PHP generation target. Supposedly it is about a week's work for someone well versed in PHP.
- ANTLR's generated Java is huge and slow.
- I'm not certain it's that slow, and with a bit of fine tuning should be fast enough. It's certainly huge though. Best not to look at it before breakfast.
- ANTLR is buggy.
- I think many of the bugs I've seen are really ANTLRworks (the IDE) bugs, rather than ANTLR itself. It has some bugs, and is in active development. So, while the instability of the IDE is a bit of a pain for developing the grammar, once the grammar itself is stable, that shouldn't be a big problem.
- ANTLR doesn't yet render to PHP.
GitHub - Tunnelvisionlabs/antlrworks2: Tunnel Vision Labs ...
Retrieved from 'https://www.mediawiki.org/w/index.php?title=Markup_spec/ANTLR&oldid=2595034'