On Thu, Mar 5, 2009 at 2:49 PM, thyrsus <[email protected]> wrote:

>
> Is there someone not preoccupied with bug fixing who could give me a
> conceptual guide to class baseScannerClass in leoImport.py?


I'm not *that* preoccupied with bugs :-)

Yes, all the work is done in the baseScannerClass.  To create a ruby
scanner, you would subclass this class.

You probably will need only to override parts of the parser.  The code
generator probably does not need to be changed.

startsHelper is where just about all the action is.  This detects the start
of classes and functions.  Almost all the overrides in the various
subclasses of baseScannerClass relate to changing the functions called by
startsHelper.  In particular, most of the various constants defined in the
ctor for each language affect startsHelper or the methods called from
startsHelper.

Your plan is simple: hack startsHelper until it works :-)  There are three
possible kinds of hacks:

1. Override the methods called by startsHelper.
2. Override the default constants that affect startsHelper.
3. If necessary, make startsHelper more flexible by changing it.  If you do
this, the default action should be equivalent to the old startsHelper so the
existing subclasses of baseScannerClass will not have to change.

This is about all you need to know.  To understand in detail, more
description will *not* help.  Instead, you should enable parsing traces, and
single-step through *small* python programs to see how the python parser
works.  You can then take your new-found knowledge and apply it to writing a
ruby parser.  That's what I would do: I don't remember *any* of the details.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to