# Windows based Parser

**URL:** <https://www.ruby-forum.com/t/windows-based-parser/139837>\
**Category:** Ruby\
**Created:** [June 7, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/windows-based-parser/139837 "2008-06-07T23:41:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@drweb](https://www.ruby-forum.com/u/drweb)\
**Post date:** [June 7, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/windows-based-parser/139837/1 "2008-06-07T23:41:28Z")

</div>

Hi All!

I need to parse a piece Ruby source code file. For that purpose, I need  
a Ruby parser (which can be used on windows plateform). I tried to  
configure ruby\_parser 1.0, but I am unable to configure it on windows  
XP, as it is depending upon RACC parser, which can be installed in unix  
operating system. Any simple to use Ruby parse will be a great help.

Thanks in advance to ALL.

Bye

/Muzaffar

---

<div class="post-metadata">

**Author:** ![drweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@drweb](https://www.ruby-forum.com/u/drweb)\
**Post date:** [June 8, 2008, 3:12am UTC](https://www.ruby-forum.com/t/windows-based-parser/139837/2 "2008-06-08T03:12:06Z")

</div>

On Sat, Jun 7, 2008 at 4:40 PM, Muzaffar H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi All!
> 
> I need to parse a piece Ruby source code file. For that purpose, I need  
> a Ruby parser (which can be used on windows plateform). I tried to  
> configure ruby\_parser 1.0, but I am unable to configure it on windows  
> XP, as it is depending upon RACC parser.

ParseTree comes precompiled for windows, is faster, and does the exact  
same thing as ruby\_parser.

Daniel Brumbaugh K.

---

<div class="post-metadata">

**Author:** ![drweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@drweb](https://www.ruby-forum.com/u/drweb)\
**Post date:** [June 8, 2008, 9:07am UTC](https://www.ruby-forum.com/t/windows-based-parser/139837/3 "2008-06-08T09:07:06Z")

</div>

Muzaffar H. wrote:

> Hi All!
> 
> I need to parse a piece Ruby source code file. For that purpose, I need  
> a Ruby parser (which can be used on windows plateform). I tried to  
> configure ruby\_parser 1.0, but I am unable to configure it on windows  
> XP, as it is depending upon RACC parser, which can be installed in unix  
> operating system. Any simple to use Ruby parse will be a great help.
> 
> Thanks in advance to ALL.
> 
> Bye
> 
> /Muzaffar

If you’re truly adventurous you could try to download the win32 mingw  
sandbox  
[http://rubyinstaller.rubyforge.org/wiki/wiki.pl?Mingw](http://rubyinstaller.rubyforge.org/wiki/wiki.pl?Mingw)  
and then install a mingw version of RACC.  
Good luck with that.  
-R

---

<div class="post-metadata">

**Author:** ![drweb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@drweb](https://www.ruby-forum.com/u/drweb)\
**Post date:** [June 8, 2008, 1:18pm UTC](https://www.ruby-forum.com/t/windows-based-parser/139837/4 "2008-06-08T13:18:07Z")

</div>

Hi Daniel!

Thanks for helping me. I am able to install ParseTree on my windows  
system. Further, it also requirs RubyInline, so I also installed it. But  
I am still unable to run a simple example of parse tree so far.

I read in it documentations that

def conditional1(arg1)  
if arg1 == 0 then  
return 1  
end  
return 0  
end

becomes:

[:defn,  
:conditional1,  
[:scope,  
[:block,  
[:args, :arg1],  
[:if,  
[:call, [:lvar, :arg1], :==, [:array, [:lit, 0]]],  
[:return, [:lit, 1]],  
nil],  
[:return, [:lit, 0]]]]]

But how can I get this output. I am unable to do so. Actually I am  
farely new to Ruby & specially parsing. Further, I have to run this  
parser on Rails but no way yet. I am not able to run a simple example of  
parsetree. I study much material about parsing but donot have a clue  
that how to get the above output of the source file. I will be very  
thankful,if you can guide me with a very simple example how to use  
parsetree to get above output. I am waiting your kind reply.

Bye

/Muzaffar

Daniel Brumbaugh K. wrote:

> On Sat, Jun 7, 2008 at 4:40 PM, Muzaffar H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Hi All!
> > 
> > I need to parse a piece Ruby source code file. For that purpose, I need  
> > a Ruby parser (which can be used on windows plateform). I tried to  
> > configure ruby\_parser 1.0, but I am unable to configure it on windows  
> > XP, as it is depending upon RACC parser.
> 
> ParseTree comes precompiled for windows, is faster, and does the exact  
> same thing as ruby\_parser.
> 
> Daniel Brumbaugh K.
