From: Mathieu Bouchard Date: 2002-01-18T07:22:38+09:00 Subject: Re: Markus' ruby-parser On Wed, 16 Jan 2002, Robert Feldt wrote: > On Wed, 16 Jan 2002, Mathieu Bouchard wrote: > Check out Markus tests and the ones in > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/rockit/src/examples/ruby/tests/ > > slight divergences like unneccessary Body[[x]] instead of just x in some > > places, etc. > Ok, I think it would be unfortunate. If we strive for a common test I > think it should only allow one parse for each construct. Okay, let's try it then. > > True. I may add BinOp (or "Op2") to RubySchema while keeping it out of > > MicroRubySchema; this is because the former schema has a fidelity > > requirement (and the latter hasn't) > I like the idea of splitting it into several layers of different > resolution. If its possible to do it fully in a class hierarchy so that > BinOp really inherits M BinOp will be called Op2; unary operator expressions will be Op1. They will inherit from Call, not from M, because M specifies fields, while Call does not. > (which I think is a bit too non-descriptive; any chance we can find a > slightly more descriptive one that is not meaningless?) Originally I thought that M[] would be a *very* common expression type. It occurs to me now that it won't be, at least not as much as the Var types. Using the rule that very common names should be shorter, and very unfrequent names should be longer (in a Huffman-coding kind of way...) then these are more changes I'm making today: LVar = LV IVar = IV CVar = CV GVar = SV # now called special variables XVar = XV # very special variables that won't vary... M = Msg SliceVar = Slice LAtom = Lit # real literals (all other kinds aren't really) > that would probably solve it. But don'tyou agree that the > RubyInRuby parsers should generate schemas/terms/trees at the highest > resolution by default? Well, medium resolution is already quite high. Maybe a file separate from RubySchema could define all those higher resolution types in terms of those already there? You would add types to that file as you'd need them. The point of medium resolution is to have a good balance between what are classes, and what are fields in those classes. Other changes I made: * Expr,Arg,Statement,Literal,Primary merged as module Expr. * Var=Any.of changed to abstract class Var. ________________________________________________________________ Mathieu Bouchard http://hostname.2y.net/~matju