[antlr-interest] Freemarker grammer w/ JavaScript target

Gerald Rosenberg gerald at certiv.net
Wed Nov 14 10:29:03 PST 2012


Although your editor's approach is line at a time, no reason to try and 
force Antlr to do the same.  Antlr is more than fast and light enough to 
re-parse the entire source file between each keystroke and walk the AST 
to provide highlighting info (and walk the AST to adjust error markers 
and to collect code assist hints and ... ).

On 11/14/2012 12:26 AM, Roded wrote:
> 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,
> Roded
>
> P.S. anyone encountered a Freemarker grammar?
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>




More information about the antlr-interest mailing list