Syntax highlighting for custom language on the GTInspector

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Syntax highlighting for custom language on the GTInspector

Ronie Salgado
Hi,

I have some custom programming languages (Lowtalk for low-level programming, and Dastrel for GPU shaders) whose grammar are defined by using PetitParser.

How can I add syntax highlighting support for them by using the GTInspector?

Best regards,
Ronie

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighting for custom language on the GTInspector

Tudor Girba-2
Hi,

Thanks for the ping :).

Please take a look at the Pillar syntax highlighter. You can find it in the following way:

- Download Pillar:
        Gofer new smalltalkhubUser: 'Pier' project: 'Pillar'; configuration; loadDevelopment.
- Browse
        GTPillarHighlighterTextDecorator (this is what hooks the parser with Rubric)
        GTPillarHighlighter (this is the parser that produces syntax highlighting)

Please let me know if you have issues with this.

Cheers,
Doru


> On Sep 12, 2017, at 12:11 PM, Ronie Salgado <[hidden email]> wrote:
>
> Hi,
>
> I have some custom programming languages (Lowtalk for low-level programming, and Dastrel for GPU shaders) whose grammar are defined by using PetitParser.
>
> How can I add syntax highlighting support for them by using the GTInspector?
>
> Best regards,
> Ronie
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"Every successful trip needs a suitable vehicle."





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighting for custom language on the GTInspector

Ronie Salgado
Hi Doru,

Thanks for the response. I managed to make the following:

Imágenes integradas 1
Imágenes integradas 2

The only problem with this is that I end duplicating some logic, and that it could also be not easy for supporting the different themes. Maybe I should try making a syntax highlighting framework that can use either, PetitParser grammars, or regular expressions for basic support of languages as C/C++/Java (comments, keyword, identifiers, literals).

Best regards,
Ronie

2017-09-12 14:26 GMT+02:00 Tudor Girba <[hidden email]>:
Hi,

Thanks for the ping :).

Please take a look at the Pillar syntax highlighter. You can find it in the following way:

- Download Pillar:
        Gofer new smalltalkhubUser: 'Pier' project: 'Pillar'; configuration; loadDevelopment.
- Browse
        GTPillarHighlighterTextDecorator (this is what hooks the parser with Rubric)
        GTPillarHighlighter (this is the parser that produces syntax highlighting)

Please let me know if you have issues with this.

Cheers,
Doru


> On Sep 12, 2017, at 12:11 PM, Ronie Salgado <[hidden email]> wrote:
>
> Hi,
>
> I have some custom programming languages (Lowtalk for low-level programming, and Dastrel for GPU shaders) whose grammar are defined by using PetitParser.
>
> How can I add syntax highlighting support for them by using the GTInspector?
>
> Best regards,
> Ronie
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"Every successful trip needs a suitable vehicle."





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
cbc
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighting for custom language on the GTInspector

cbc


On Wed, Sep 13, 2017 at 2:28 PM, Ronie Salgado <[hidden email]> wrote:
Hi Doru,

Thanks for the response. I managed to make the following:
...
The only problem with this is that I end duplicating some logic, and that it could also be not easy for supporting the different themes. Maybe I should try making a syntax highlighting framework that can use either, PetitParser grammars, or regular expressions for basic support of languages as C/C++/Java (comments, keyword, identifiers, literals).
This sounds interesting.  A nice syntax working off of PetitParser that I could use for SQL and COBOL would be where my interest would lie.  (Do not feel obliged at all doing that (COBOL/SQL) part, but I would be interested in any syntax that you come up with for working with PetitParser grammers.)

-cbc

Best regards,
Ronie

2017-09-12 14:26 GMT+02:00 Tudor Girba <[hidden email]>:
Hi,

Thanks for the ping :).

Please take a look at the Pillar syntax highlighter. You can find it in the following way:

- Download Pillar:
        Gofer new smalltalkhubUser: 'Pier' project: 'Pillar'; configuration; loadDevelopment.
- Browse
        GTPillarHighlighterTextDecorator (this is what hooks the parser with Rubric)
        GTPillarHighlighter (this is the parser that produces syntax highlighting)

Please let me know if you have issues with this.

Cheers,
Doru


> On Sep 12, 2017, at 12:11 PM, Ronie Salgado <[hidden email]> wrote:
>
> Hi,
>
> I have some custom programming languages (Lowtalk for low-level programming, and Dastrel for GPU shaders) whose grammar are defined by using PetitParser.
>
> How can I add syntax highlighting support for them by using the GTInspector?
>
> Best regards,
> Ronie
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.list.inf.unibe.ch/listinfo/moose-dev

--
www.tudorgirba.com
www.feenk.com

"Every successful trip needs a suitable vehicle."





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Syntax highlighting for custom language on the GTInspector

monty-3
In reply to this post by Ronie Salgado
> Sent: Wednesday, September 13, 2017 at 5:28 PM
> From: "Ronie Salgado" <[hidden email]>
> To: "Moose-related development" <[hidden email]>
> Subject: [Moose-dev] Re: Syntax highlighting for custom language on the GTInspector
>
> Hi Doru,
>  Thanks for the response. I managed to make the following:
>
>
>
>  The only problem with this is that I end duplicating some logic, and that it could also be not easy for supporting the different themes.

The solution I used for supporting different themes for XML and XPath highlighting was to reuse the current theme's Shout styles, like this:

SHTextStylerST80 new attributesFor: aShoutProperty

where aShoutProperty is something like #comment or #string. Not every language construct will have an equivalent in Pharo, so you may have to get creative.

>Maybe I should try making a syntax highlighting framework that can use either, PetitParser grammars, or regular expressions for basic support of languages as C/C++/Java (comments, keyword, identifiers, literals).
>  Best regards,Ronie
>  
> 2017-09-12 14:26 GMT+02:00 Tudor Girba <[hidden email][mailto:[hidden email]]>:Hi,
>
> Thanks for the ping :).
>
> Please take a look at the Pillar syntax highlighter. You can find it in the following way:
>
> - Download Pillar:
>         Gofer new smalltalkhubUser: 'Pier' project: 'Pillar'; configuration; loadDevelopment.
> - Browse
>         GTPillarHighlighterTextDecorator (this is what hooks the parser with Rubric)
>         GTPillarHighlighter (this is the parser that produces syntax highlighting)
>
> Please let me know if you have issues with this.
>
> Cheers,
> Doru
>
> > On Sep 12, 2017, at 12:11 PM, Ronie Salgado <[hidden email][mailto:[hidden email]]> wrote:
> >
> > Hi,
> >
> > I have some custom programming languages (Lowtalk for low-level programming, and Dastrel for GPU shaders) whose grammar are defined by using PetitParser.
> >
> > How can I add syntax highlighting support for them by using the GTInspector?
> >
> > Best regards,
> > Ronie> _______________________________________________
> > Moose-dev mailing list
> > [hidden email][mailto:[hidden email]]
> > https://www.list.inf.unibe.ch/listinfo/moose-dev[https://www.list.inf.unibe.ch/listinfo/moose-dev]
>
> --
> www.tudorgirba.com[http://www.tudorgirba.com]
> www.feenk.com[http://www.feenk.com]
>
> "Every successful trip needs a suitable vehicle."
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email][mailto:[hidden email]]
> https://www.list.inf.unibe.ch/listinfo/moose-dev_______________________________________________ Moose-dev mailing list [hidden email] https://www.list.inf.unibe.ch/listinfo/moose-dev[https://www.list.inf.unibe.ch/listinfo/moose-dev]
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev