Hello all. How is this DisplayScanner class to be used? I am familiar with parsing scanners (tokenizers) but this seems to be something else. Regards, Rick
-- I insist on rapport! _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Rick Hedin <cubsno1 <at> gmail.com> writes:
> > Hello all. How is this DisplayScanner class to be used? I am familiar with parsing scanners (tokenizers) but this seems to be something else. Regards, Rick-- I insist on rapport! > Hello Rick, DisplayScanner are not supposed to be used directly. It's an internal class used for displaying characters on a graphics context. 'Scanner' here comes from superclass, CharacterScanners. It scan characters for looking at some control characters (like space tabulation or carriage return), or for determining the display width, etc... Does it help ? Nicolas _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
...and if you want to create your own parser, SmaCC is probably the best approach. It's in the public repository, and documented here: http://www.refactoryworkers.com/SmaCC/index.html
BTW, the latest version there has fairly major changes - does anyone know what the benefits are to an existing grammar, or how backwards compatible it would be for an existing grammar (including the Smalltalk snippets that form part of the grammar)?
Steve From: [hidden email] on behalf of nicolas cellier Sent: Sun 17/04/2011 23:38 To: [hidden email] Subject: Re: [vwnc] DisplayScanner Rick Hedin <cubsno1 <at> gmail.com> writes: _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Dear Steve,
>BTW, the latest version there has fairly major changes - does anyone know what the benefits are to an existing grammar, or how backwards compatible it would be for an existing grammar (including the Smalltalk snippets that form part of the grammar)? > > I believe older SmaCC grammars will run OK in version 2.whatever, but if you want to regenerate them then you need to be aware of changes. IIRC the component restructuring gives an exaggerated impression of the amount of change, that the actual change between 2 and earlier is easy to adapt to, but I can't find my notes of my review / discussion with John Brant about this earlier this year and cannot recall details. Hopefully, he will respond in this thread. This latest version in the OR, 2.0.3, is the one released in VW 7.8. Yours faithfully Niall Ross _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Steven Kelly
Steven Kelly <stevek <at> metacase.com> writes:
> > ...and if you want to create your own parser, SmaCC is probably the best approach. It's in the public repository, and documented here: http://www.refactoryworkers.com/SmaCC/index.html > > You might also want to check for PEG parser at http://code.google.com/p/xtreams/ This project is available in Cincom public store. Of course it's scanner free, but nonetheless interesting... Nicolas _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
There's also PetitParser,
http://www.lukas-renggli.ch/blog/petitparser-1 http://www.lukas-renggli.ch/blog/petitparser-2 http://stackoverflow.com/questions/5703309/where-could-i-find-more-examples-of-using-petitparser -Boris -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of nicolas cellier Sent: 18 April 2011 10:22 To: [hidden email] Subject: Re: [vwnc] DisplayScanner Steven Kelly <stevek <at> metacase.com> writes: > > ...and if you want to create your own parser, SmaCC is probably the > best approach. It's in the public repository, and documented here: http://www.refactoryworkers.com/SmaCC/index.html > > You might also want to check for PEG parser at http://code.google.com/p/xtreams/ This project is available in Cincom public store. Of course it's scanner free, but nonetheless interesting... Nicolas _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Niall Ross
On 4/17/2011 4:48 PM, Niall Ross wrote:
> I believe older SmaCC grammars will run OK in version 2.whatever, but if > you want to regenerate them then you need to be aware of changes. Yes, I think they should run fine. > IIRC the component restructuring gives an exaggerated impression of the > amount of change, that the actual change between 2 and earlier is easy > to adapt to, but I can't find my notes of my review / discussion with > John Brant about this earlier this year and cannot recall details. > Hopefully, he will respond in this thread. We added support for creating ASTs while parsing. These ASTs have support for transforming code which we used to convert a 1.5MLOC Delphi project into C#. The AST support is added by annotating the parser's grammar. When we added the AST annotations we removed support for the ?, *, and + from the parser's grammar -- they are still supported in the scanner's grammar. These are fairly easy to convert to the new format: ------------- ... : ... Something? ... -> ... : ... Something_opt ... Something_opt : Something | ; ------------- ... : ... Something* ... -> ... : ... Something_star ... Something_star : Something_star Something | ; ------------- ... : ... Something+ ... -> ... : ... Something_plus ... Something_plus : Something_plus Something | Something ; ------------- Someone could probably make a refactoring tool to automatically convert these... :) John Brant _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |