Re: Object-oriented compiler construction: ideas?

bronnikov@aol.com (Bronnikov)
24 Jun 1996 10:58:59 -0400

          From comp.compilers

Related articles
[6 earlier articles]
Re: Object-oriented compiler construction: ideas? darius@phidani.be (Darius Blasbans) (1996-06-08)
Re: Object-oriented compiler construction: ideas? poe@theory.lcs.mit.edu (1996-06-13)
Re: Object-oriented compiler construction: ideas? euahjn@eua.ericsson.se (1996-06-14)
Re: Object-oriented compiler construction: ideas? kalsow@winternet.com (1996-06-14)
Re: Object-oriented compiler construction: ideas? darius@phidani.be (Darius Blasband) (1996-06-21)
Re: Object-oriented compiler construction: ideas? rwatson@CAM.ORG (Richard Edward Watson) (1996-06-23)
Re: Object-oriented compiler construction: ideas? bronnikov@aol.com (1996-06-24)
Re: Object-oriented compiler construction: ideas? bobduff@world.std.com (1996-06-26)
Re: Object-oriented compiler construction: ideas? leichter@smarts.com (Jerry Leichter) (1996-06-27)
Re: Object-oriented compiler construction: ideas? jgm@CS.Cornell.EDU (Greg Morrisett) (1996-06-27)
Re: Object-oriented compiler construction: ideas? cliffc@ami.sps.mot.com (1996-06-30)
Re: Object-oriented compiler construction: ideas? compres@world.std.com (1996-06-30)
Re: Object-oriented compiler construction: ideas? jdean@cs.washington.edu (1996-06-30)
[4 later articles]
| List of all articles for this month |
From: bronnikov@aol.com (Bronnikov)
Newsgroups: comp.compilers
Date: 24 Jun 1996 10:58:59 -0400
Organization: America Online, Inc. (1-800-827-6364)
References: 96-06-096
Keywords: OOP

Richard E. Watson (Compiler Architect) wrote


> The actual parsing code is
> part of each object. It knows how to choose its own right hand side by
> looking ahead zero or more tokens


Do not see how having an object per RHS with parsing code can be helpful
unless you know what derivation rule has to be applied. If you know that,
then it is LL(N) parser. If you do not, then parsing code will have to
take care of parsing more than one derivation rules, not necessarily
beginning with the same NTS. For instance, in the following example, you'd
have to look ahead indefinitely until you can figure out if 'a' or 'b'
object has to be processed. Or, combine parsing code (and objects) into
a_or_b, c_or_d...


root : a | b


a : c '.'


b : d ';'


c : ident_list


d : ident_list


ident_list : ident | ident_list ',' ident


Please clarify your idea if it really handles LALR(1) nicely.


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.