> To continue in that front, since i'm using NewTextMorph , i would like to 
> remove also the dependency to SHOUT.
>
> To continue in this front , is was thinking to get rid of the SHOUT parser 
> and styler by reusing the already present RB, by subclassing the already 
> present RBProgramNodeVisitor, such as RBFormatter, in order to implement a 
> RBCodeStyler.
>
> Are you aware if this has been done already? If i'll implement it and publish 
> it.

Not that I know.

That's certainly a good idea, however I am not sure if RB can help you
to highlight. RBParser stops parsing when there is an error, something
you don't want to do when highlighting. Also for highlighting you
typically are not able/do not want to build an AST beforehand, so
RBProgramNodeVisitor is kind of useless. AFAIK in VW the RBHighlighter
is implemented as a completely new parser.

In Helvetia I use a PetitParser grammar that I "subclasses" to build
an AST identical to the RBParser. For syntax highlighting I take the
first-class Smalltalk grammar and programmatically transform it to be
less strict about errors. Furthermore I attach actions that add the
formatting to the parsed text as a side-effect. This is sketched in
Section 3.4 of our DYLA 2010 paper:
http://bergel.eu/download/Dyla2010/dyla10_submission_4.pdf.

Lukas

-- 
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to