You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Peter Nabbefeld <pe...@gmx.de> on 2018/06/01 17:02:44 UTC

How to implement a new language support?

Hello,

latest tutorial I found is at 
https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but 
JavaCC seems to be no longer actively supported. I'm also not sure, if 
this is using latest language infrastructure: Though it states "Requires 
NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy". 
IIRC this is older than GSF/CSL API, which is used e.g. for the 
(netbeans-internal) YAML module.

Which API should I use?

Kind regards
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to implement a new language support?

Posted by Peter Nabbefeld <pe...@gmx.de>.
Hi Stephen,

thank You for these explanations. For Flex, Bison etc. I found this: 
http://jflex.de/ (despite of the German TLD it's in English). There are 
links on this page to further related technologies.

However, while the responses are all very interesting, none of them are 
really addressing the original question in its context: The original 
posting was a question primarily about which NetBeans API to use, but 
the (incomplete) subject was obviously misleading, so I'll repost my 
question with a more exact subject.

Kind regards
Peter


Am 02.06.2018 um 17:22 schrieb Stephen Parry:
> ANTLR is cool (stable supported mature) but the plugins are a bit of a nightmare. ANTLR itself generates an LALR recursive descent parser, which will mean something to those who understand compilers. My understanding is limited to knowing that that means the generated code has less reliance on state machines, which consist of a very efficient but horrible, java-hostile nest of spaghetti gotos. Another plus to ANTLR is that the grammars and the implementation code are kept separate, easing porting to other languages.
> There are three plugins to my knowledge:
> ANTLRworks: not available for NB8.2
> Fred Vinet's: Supports syntax highlighting / completion and includes an  ANT build task. It includes some bugs which I am currently working to fix as FYV seems to have gone very quiet.
> Peter Cheung's: supports realtime compilation, highlighting and I think completion, but I could get not the compilation / building to work reliably - lack of clear instructions.
> I do remember someone having ported / adapted Flex and Bison to Java? Not sure how well they work or if that project is still live.
>
>
> On 2 June 2018 15:14:52 BST, constantin drabo <dr...@hotmail.com> wrote:
>> Hi all ,
>> ANTRL is fine.  There 's a plugin for NetBeans too
>> http://www.antlr.org/tools.html
>> Constantin
>> ANTLR Development Tools<http://www.antlr.org/tools.html>
>> ANTLR Development Tools There are plug-ins for Intellij, NetBeans,
>> Eclipse, Visual Studio Code, and jEdit. Intellij 12+ Plugin for ANTLR
>> 4. We have a ANTLR v4 plugin for Intellij 12+.
>> www.antlr.org
>>
>>
>>
>> ?? La Terre est le berceau de l'humanit??, mais on ne passe pas sa vie
>> enti??re dans un berceau. ??
>> - Constantin????E. Tsiolkovski , p??re de l'astronautique?? et de
>> l'a??rospatiale modernes.
>> ________________________________
>> De : Christian Lenz <ch...@gmx.net>
>> Envoyé : samedi 2 juin 2018 00:27
>> À : dev@netbeans.incubator.apache.org
>> Objet : AW: How to implement a new language support?
>>
>> I used both too, but I switched to ANTLR, it seems more maintained and
>> up to date. I can recommend this. IntelliJ has an other stuff, which is
>> new, but I couldn’t remember the Name, and I think NetBeans doesn’t
>> support it.
>>
>>
>> Cheers
>>
>> Chris
>>
>> Von: Oliver Rettig
>> Gesendet: Samstag, 2. Juni 2018 11:28
>> An: dev@netbeans.incubator.apache.org
>> Betreff: Re: How to implement a new language support?
>>
>> Hi,
>>
>> sometimes I play around to build a simple language to allow me to work
>> with mathematical
>> operations - a simple but high speed version of matlab for timeseries
>> analysis. So I found
>> Truffle and Graal a very interesting technology to implement new
>> languages in general.
>>
>> There is a blog entry
>>
>> https://blog.plan99.net/graal-truffle-134d8f28fb69
>>
>> which may be is an easier starting point than the original
>> documentation of Jaruslaw Tulach.
>>
>> best regards
>> Oliver
>>
>>> Hello,
>>>
>>> latest tutorial I found is at
>>> https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
>>> JavaCC seems to be no longer actively supported. I'm also not sure,
>> if
>>> this is using latest language infrastructure: Though it states
>> "Requires
>>> NetBeans 8.1", it uses e.d.
>> "org.netbeans.spi.lexer.LanguageHierarchy".
>>> IIRC this is older than GSF/CSL API, which is used e.g. for the
>>> (netbeans-internal) YAML module.
>>>
>>> Which API should I use?
>>>
>>> Kind regards
>>> Peter
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>>> For additional commands, e-mail:
>> dev-help@netbeans.incubator.apache.org
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




RE: How to implement a new language support?

Posted by Stephen Parry <sg...@mainscreen.com>.
ANTLR is cool (stable supported mature) but the plugins are a bit of a nightmare. ANTLR itself generates an LALR recursive descent parser, which will mean something to those who understand compilers. My understanding is limited to knowing that that means the generated code has less reliance on state machines, which consist of a very efficient but horrible, java-hostile nest of spaghetti gotos. Another plus to ANTLR is that the grammars and the implementation code are kept separate, easing porting to other languages.
There are three plugins to my knowledge:
ANTLRworks: not available for NB8.2
Fred Vinet's: Supports syntax highlighting / completion and includes an  ANT build task. It includes some bugs which I am currently working to fix as FYV seems to have gone very quiet.
Peter Cheung's: supports realtime compilation, highlighting and I think completion, but I could get not the compilation / building to work reliably - lack of clear instructions.
I do remember someone having ported / adapted Flex and Bison to Java? Not sure how well they work or if that project is still live.


On 2 June 2018 15:14:52 BST, constantin drabo <dr...@hotmail.com> wrote:
>Hi all ,
>ANTRL is fine.  There 's a plugin for NetBeans too 
>http://www.antlr.org/tools.html
>Constantin
>ANTLR Development Tools<http://www.antlr.org/tools.html>
>ANTLR Development Tools There are plug-ins for Intellij, NetBeans,
>Eclipse, Visual Studio Code, and jEdit. Intellij 12+ Plugin for ANTLR
>4. We have a ANTLR v4 plugin for Intellij 12+.
>www.antlr.org
>
>
>
>?? La Terre est le berceau de l'humanit??, mais on ne passe pas sa vie
>enti??re dans un berceau. ??
>- Constantin????E. Tsiolkovski , p??re de l'astronautique?? et de
>l'a??rospatiale modernes.
>________________________________
>De : Christian Lenz <ch...@gmx.net>
>Envoyé : samedi 2 juin 2018 00:27
>À : dev@netbeans.incubator.apache.org
>Objet : AW: How to implement a new language support?
>
>I used both too, but I switched to ANTLR, it seems more maintained and
>up to date. I can recommend this. IntelliJ has an other stuff, which is
>new, but I couldn’t remember the Name, and I think NetBeans doesn’t
>support it.
>
>
>Cheers
>
>Chris
>
>Von: Oliver Rettig
>Gesendet: Samstag, 2. Juni 2018 11:28
>An: dev@netbeans.incubator.apache.org
>Betreff: Re: How to implement a new language support?
>
>Hi,
>
>sometimes I play around to build a simple language to allow me to work
>with mathematical
>operations - a simple but high speed version of matlab for timeseries
>analysis. So I found
>Truffle and Graal a very interesting technology to implement new
>languages in general.
>
>There is a blog entry
>
>https://blog.plan99.net/graal-truffle-134d8f28fb69
>
>which may be is an easier starting point than the original
>documentation of Jaruslaw Tulach.
>
>best regards
>Oliver
>
>> Hello,
>>
>> latest tutorial I found is at
>> https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
>> JavaCC seems to be no longer actively supported. I'm also not sure,
>if
>> this is using latest language infrastructure: Though it states
>"Requires
>> NetBeans 8.1", it uses e.d.
>"org.netbeans.spi.lexer.LanguageHierarchy".
>> IIRC this is older than GSF/CSL API, which is used e.g. for the
>> (netbeans-internal) YAML module.
>>
>> Which API should I use?
>>
>> Kind regards
>> Peter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>> For additional commands, e-mail:
>dev-help@netbeans.incubator.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

RE: How to implement a new language support?

Posted by constantin drabo <dr...@hotmail.com>.
Hi all ,
ANTRL is fine.  There 's a plugin for NetBeans too  http://www.antlr.org/tools.html
Constantin
ANTLR Development Tools<http://www.antlr.org/tools.html>
ANTLR Development Tools There are plug-ins for Intellij, NetBeans, Eclipse, Visual Studio Code, and jEdit. Intellij 12+ Plugin for ANTLR 4. We have a ANTLR v4 plugin for Intellij 12+.
www.antlr.org



?? La Terre est le berceau de l'humanit??, mais on ne passe pas sa vie enti??re dans un berceau. ??
- Constantin????E. Tsiolkovski , p??re de l'astronautique?? et de l'a??rospatiale modernes.
________________________________
De : Christian Lenz <ch...@gmx.net>
Envoyé : samedi 2 juin 2018 00:27
À : dev@netbeans.incubator.apache.org
Objet : AW: How to implement a new language support?

I used both too, but I switched to ANTLR, it seems more maintained and up to date. I can recommend this. IntelliJ has an other stuff, which is new, but I couldn’t remember the Name, and I think NetBeans doesn’t support it.


Cheers

Chris

Von: Oliver Rettig
Gesendet: Samstag, 2. Juni 2018 11:28
An: dev@netbeans.incubator.apache.org
Betreff: Re: How to implement a new language support?

Hi,

sometimes I play around to build a simple language to allow me to work with mathematical
operations - a simple but high speed version of matlab for timeseries analysis. So I found
Truffle and Graal a very interesting technology to implement new languages in general.

There is a blog entry

https://blog.plan99.net/graal-truffle-134d8f28fb69

which may be is an easier starting point than the original documentation of Jaruslaw Tulach.

best regards
Oliver

> Hello,
>
> latest tutorial I found is at
> https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
> JavaCC seems to be no longer actively supported. I'm also not sure, if
> this is using latest language infrastructure: Though it states "Requires
> NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy".
> IIRC this is older than GSF/CSL API, which is used e.g. for the
> (netbeans-internal) YAML module.
>
> Which API should I use?
>
> Kind regards
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




AW: How to implement a new language support?

Posted by Christian Lenz <ch...@gmx.net>.
I used both too, but I switched to ANTLR, it seems more maintained and up to date. I can recommend this. IntelliJ has an other stuff, which is new, but I couldn’t remember the Name, and I think NetBeans doesn’t support it.


Cheers

Chris

Von: Oliver Rettig
Gesendet: Samstag, 2. Juni 2018 11:28
An: dev@netbeans.incubator.apache.org
Betreff: Re: How to implement a new language support?

Hi,

sometimes I play around to build a simple language to allow me to work with mathematical 
operations - a simple but high speed version of matlab for timeseries analysis. So I found 
Truffle and Graal a very interesting technology to implement new languages in general. 

There is a blog entry 

https://blog.plan99.net/graal-truffle-134d8f28fb69

which may be is an easier starting point than the original documentation of Jaruslaw Tulach.

best regards
Oliver

> Hello,
> 
> latest tutorial I found is at
> https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
> JavaCC seems to be no longer actively supported. I'm also not sure, if
> this is using latest language infrastructure: Though it states "Requires
> NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy".
> IIRC this is older than GSF/CSL API, which is used e.g. for the
> (netbeans-internal) YAML module.
> 
> Which API should I use?
> 
> Kind regards
> Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to implement a new language support?

Posted by Oliver Rettig <Ol...@orat.de>.
Hi,

sometimes I play around to build a simple language to allow me to work with mathematical 
operations - a simple but high speed version of matlab for timeseries analysis. So I found 
Truffle and Graal a very interesting technology to implement new languages in general. 

There is a blog entry 

https://blog.plan99.net/graal-truffle-134d8f28fb69

which may be is an easier starting point than the original documentation of Jaruslaw Tulach.

best regards
Oliver

> Hello,
> 
> latest tutorial I found is at
> https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
> JavaCC seems to be no longer actively supported. I'm also not sure, if
> this is using latest language infrastructure: Though it states "Requires
> NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy".
> IIRC this is older than GSF/CSL API, which is used e.g. for the
> (netbeans-internal) YAML module.
> 
> Which API should I use?
> 
> Kind regards
> Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Re: How to implement a new language support?

Posted by Peter Nabbefeld <pe...@gmx.de>.
Hi Eirik,

thank You very much, Eirik, especially for making the source code freely 
available!

Kind regards
Peter



Am 01.06.2018 um 20:16 schrieb Eirik Bakke:
> Ah, sorry, here’s the latest version of the LexerInputCharStream file:
>
> https://gist.github.com/eirikbakke/fdda0e6b43ed1b2d54eb
>
> (This one avoids the Google Guava dependency.)
>
> — Eirik
>
> On 6/1/18, 2:03 PM, "Eirik Bakke" <eb...@ultorg.com>> wrote:
>
> I have used both JavaCC and ANTLR in the past, and I highly recommend using ANTLR for new projects.
>
> You can use the following adapter class to hook ANTLR’s org.antlr.v4.runtime.CharStream interface up to NetBeans’ org.netbeans.spi.lexer.LexerInput interface:
>
> https://gist.github.com/eirikbakke/51cf4c9375880acd4741
>
> — Eirik
>
> On 6/1/18, 1:02 PM, "Peter Nabbefeld" <pe...@gmx.de>> wrote:
>
>
> Hello,
>
> latest tutorial I found is at
> https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
> JavaCC seems to be no longer actively supported. I'm also not sure, if
> this is using latest language infrastructure: Though it states "Requires
> NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy".
> IIRC this is older than GSF/CSL API, which is used e.g. for the
> (netbeans-internal) YAML module.
>
> Which API should I use?
>
> Kind regards
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org<ma...@netbeans.incubator.apache.org>
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org<ma...@netbeans.incubator.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: How to implement a new language support?

Posted by Eirik Bakke <eb...@ultorg.com>.
Ah, sorry, here’s the latest version of the LexerInputCharStream file:

https://gist.github.com/eirikbakke/fdda0e6b43ed1b2d54eb

(This one avoids the Google Guava dependency.)

— Eirik

On 6/1/18, 2:03 PM, "Eirik Bakke" <eb...@ultorg.com>> wrote:

I have used both JavaCC and ANTLR in the past, and I highly recommend using ANTLR for new projects.

You can use the following adapter class to hook ANTLR’s org.antlr.v4.runtime.CharStream interface up to NetBeans’ org.netbeans.spi.lexer.LexerInput interface:

https://gist.github.com/eirikbakke/51cf4c9375880acd4741

— Eirik

On 6/1/18, 1:02 PM, "Peter Nabbefeld" <pe...@gmx.de>> wrote:


Hello,

latest tutorial I found is at
https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
JavaCC seems to be no longer actively supported. I'm also not sure, if
this is using latest language infrastructure: Though it states "Requires
NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy".
IIRC this is older than GSF/CSL API, which is used e.g. for the
(netbeans-internal) YAML module.

Which API should I use?

Kind regards
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org<ma...@netbeans.incubator.apache.org>
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org<ma...@netbeans.incubator.apache.org>

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists






Re: How to implement a new language support?

Posted by Eirik Bakke <eb...@ultorg.com>.
I have used both JavaCC and ANTLR in the past, and I highly recommend using ANTLR for new projects.

You can use the following adapter class to hook ANTLR’s org.antlr.v4.runtime.CharStream interface up to NetBeans’ org.netbeans.spi.lexer.LexerInput interface:

https://gist.github.com/eirikbakke/51cf4c9375880acd4741

— Eirik

On 6/1/18, 1:02 PM, "Peter Nabbefeld" <pe...@gmx.de>> wrote:


Hello,

latest tutorial I found is at
https://platform.netbeans.org/tutorials/nbm-javacc-lexer.html - but
JavaCC seems to be no longer actively supported. I'm also not sure, if
this is using latest language infrastructure: Though it states "Requires
NetBeans 8.1", it uses e.d. "org.netbeans.spi.lexer.LanguageHierarchy".
IIRC this is older than GSF/CSL API, which is used e.g. for the
(netbeans-internal) YAML module.

Which API should I use?

Kind regards
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org<ma...@netbeans.incubator.apache.org>
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org<ma...@netbeans.incubator.apache.org>

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists