I switched from JavaCC to ANTLR but for my case Nothing is good 😃 (Bringing C# to NetBeans, there is no real lexer file). Someone said that the future of JavaCC is unknown so ANTLR is better IMHO to use and better maintained. Here you can find a repo for a lot of ANTLR Grammar files: https://github.com/antlr/grammars-v4
It would be nice to see more JFlex too. It seems to be a good alternative to ANTLR. IntelliJ uses it more or less official to bring a new language to their platform. Make your own choice: https://github.com/antlr/antlr4 and https://github.com/jflex-de/jflex Cheers Chris Von: Mario Schroeder Gesendet: Mittwoch, 31. Oktober 2018 08:19 An: [email protected] Betreff: Re: recommendation for language support Thanks a lot to all of you! Actually I only want syntax coloring. So I will try my best with ANTLR since I already found a book about it. Seems like I can get support when I'm stuck;-) Am Mi., 31. Okt. 2018, 07:47 hat Emilian Bold <[email protected]> geschrieben: > Getting the AST from your ANTLR grammar is super helpful. > > --emi > > > On Wed, Oct 31, 2018 at 7:28 AM Peter Blemel <[email protected]> wrote: > > > Hi Mario, > > > > I have written 3 language plugins for Netbeans. I think the answer to > > your question depends on what you want to do, and what you already have > in > > hand. > > > > The Netbeans platform differentiates between support for lexing and > > support for parsing. While I have not used JFlex, JFlex is a lexer / > token > > generator. You could add token coloring to NetBeans using it (glossing > > over details about how to adapt JFlex tokens to Netbeans). Unlike a > parser > > generator, JFlex won't parse syntax which by definition limits the > > functionality you'll be able to implement for your language users in the > > IDE. As an aside, all of the JFlex web pages I've found without digging > > too deeply are circa 2011. > > > > JavaCC and ANTLR are parser generators that create parsers that in turn > > generate syntax trees (again, glossing over important implementation > > details). In addition to finding errors in the users' input to support > > features like markup in the editor (as opposed to just coloring tokens > with > > a lexer), components such as the Navigator need data that a parser can > > produce. > > > > In my case my integrations use JavaCC for no other reason other than that > > I had already written the parsers for my languages in JavaCC (first and > > second order predicate logic languages, and a music language), but having > > walked through the ANTLR tutorials it seems to be a matter of personal > > preference at the end of the day. My suggestion is use whichever one > > you're familiar with, or in my case already have code for which saved me > > the step of re-writing grammars for different parser generators. > > > > I hope to be trying to migrate my language support to the Apache Netbeans > > platform soon, but other things have been persistently stuck at the top > of > > my stack :-/. At that point I will be able to speak to issues regarding > > JavaCC support moving forward. > > > > Best, > > Peter > > > > ________________________________ > > From: Mario Schroeder <[email protected]> > > Sent: Tuesday, October 30, 2018 1:37 PM > > To: [email protected] > > Subject: recommendation for language support > > > > Hi, > > > > I would appreciate when someone could set me on the right track. I'm > > wondering what is the best way to write a plugin with a support for a new > > language. > > > > I have found this old tutorial: > > http://wiki.netbeans.org/How_to_create_support_for_a_new_language > > It uses JavaCC. The tutorial is linked to another one, which makes use of > > ANTLR. When I have a look at NetBeans source code, there are some > templates > > written with JFlex. So I'm confused. Which one should I use? > > > > I would prefer ANTLR, since there seems to be more documentation for it. > > Does anyone have a recommendation? > > > > Regards, > > Mario > > >
