From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-11-08T17:51:28+09:00 Subject: Re: bRuby? (Yet another Ruby parser) In article , Tanaka Akira wrote: >In article , > ptkwt@shell1.aracnet.com (Phil Tomson) writes: > >> I guess the point of my question is that there seem to be at least six >> projects out there that are essentially doing the same thing. Aren't we >> duplicating a lot of effort? Is there any way we can work together on one >> of these parsers and possibly get results quicker? > >Ruth calls Ruby's internal parser. >Ripper reuse parse.y including the lexer but not actions. >My xmlize reuse production rules from parse.y but not actions and the >lexer. >Maybe, Mark's parser for cocorb don't reuse production rules parse.y because >the rules are not LL(1). > >The hardest problem for writing Ruby parser is cloning the heuristics >of lex_state to resolve ambiguity especially with "do" and "{". I >tried to understand the heuristics but I couldn't. So xmlize behaves >differently to the original parser in subtle cases. > >So, I think Ruth and Ripper are right direction if perfect >compatibility is required. However Ruth may have some restrictions >because internal parser rip off some information such as comments, >exact token position, etc. That's fine for my applications - for example: as a parser for generating Parrot bytecode. It would of course be a problem for FreeRIDE or ruby documentation packages. Phil