[antlr-interest] Freemarker grammer w/ JavaScript target

Roded rodedb at gmail.com
Wed Nov 14 00:26:04 PST 2012

Hi list,
I'm planning on using ANTLR 3.3's JavaScript target for creating a
Freemarker <http://freemarker.sourceforge.net/> parser for the sake of
syntax highlighting (and auto-completion at a later stage) in a web-based
editor. Considering my lacking experience in ANTLR, I thought I'd ask for
any input or tips on accomplishing my goal.
As for highlighting, using a generated AST is simple enough, however my
editor component's (CodeMirror <http://codemirror.net/>) syntax
highlighting mechanism works on individual lines of the source. Is there a
way to use the ANTLR parser in an interruptible mode so it could be called
for every line separately while retaining its state? and perhaps
even remedying the last parsing error in view of the new input (as not all
source lines pass parsing by themselves)?
Any help and points in the right direction (whether in regards to the JS
target or ANTLR in general) would be much appreciated.
Many thanks,

P.S. anyone encountered a Freemarker grammar?

More information about the antlr-interest mailing list