freeride-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FR-devel] Source parser changes


From: Richard Kilmer
Subject: [FR-devel] Source parser changes
Date: Wed, 2 Jul 2003 10:54:43 -0400

All,

I have been quite worried for some time regarding the source parser (ripper) that we were using. Specifically, it was built off of a 2 year old Ruby parser, and it has problems running under 1.8 on some platforms. Since there is no Ruby parser that we can use, I wrote a basic parser that creates the source parser tree by simply using the indent levels of lines...and matches on

class <name>

module <name>

def <name>

It uses regex's and is quite fast. As an optimization, I do a SHA1 hash of the parsed data and if it has not changed it returns the prior parse tree. To test it load a couple of the big ruby files (like databus.rb, etc) and open the source parser and flip back and forth between files. I added files to the rubyide_tools_fox_source_browser and rubyide_tools_source_parser plugins and change the plugin.yaml files to point to these...so it is possible to go back to the old ripper-based parser by simply changing these files.

If a couple of folks could use this and let me know how it works for you it would be great.

-rich





reply via email to

[Prev in Thread] Current Thread [Next in Thread]