Re: Is C++ really used ? (Daniel J. Salomon)
13 May 1997 22:56:56 -0400

          From comp.compilers

Related articles
[15 earlier articles]
Re: Is C++ really used ? (Cliff Click) (1997-05-08)
Re: Is C++ really used ? nasser@apldbio.COM (Nasser Abbasi) (1997-05-08)
Re: Is C++ really used ? (1997-05-08)
Re: Is C++ really used ? (Bruce Duncan) (1997-05-08)
Re: Is C++ really used ? (1997-05-12)
Re: Is C++ really used ? (Jocelyn Coulmance) (1997-05-12)
Re: Is C++ really used ? (1997-05-13)
| List of all articles for this month |

From: (Daniel J. Salomon)
Newsgroups: comp.compilers
Date: 13 May 1997 22:56:56 -0400
Organization: Computer Science, University of Manitoba, Winnipeg, Canada
References: 97-04-156 97-05-016 97-05-125 97-05-145
Keywords: OOP, practice, parse

Jocelyn Coulmance <> wrote:
|> You can easily produce an object-oriented parse tree out of BNF-like
|> syntax ...

Since my posting, it has been pointed out to me that one can perform a
recursive-descent parse using object-oriented techniques, provided one
is generating a parse-tree. One simply defines a class for each
nonterminal, then has the constructor for that class create the
appropriate node, and invoke the constructors for each of the subnodes
needed in the tree, based on the lookahead information.

The reason that I missed this technique was because neither of my
translator projects used a parse-tree as the intermediate form. One
project interpreted source directly, and another used three-address
code as the intermediate form for the translation.

I am grateful for those who pointed out the parse-tree method of designing
and object-oriented translator.

Daniel J. Salomon -- salomon@cs.UManitoba.CA
              Dept. of Computer Science / University of Manitoba
              Winnipeg, Manitoba, Canada R3T 2N2 / (204) 474-8687

Post a followup to this message

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