|[15 earlier articles]|
|Re: Is C++ really used ? email@example.com (Cliff Click) (1997-05-08)|
|Re: Is C++ really used ? nasser@apldbio.COM (Nasser Abbasi) (1997-05-08)|
|Re: Is C++ really used ? firstname.lastname@example.org (1997-05-08)|
|Re: Is C++ really used ? email@example.com (Bruce Duncan) (1997-05-08)|
|Re: Is C++ really used ? firstname.lastname@example.org (1997-05-12)|
|Re: Is C++ really used ? email@example.com (Jocelyn Coulmance) (1997-05-12)|
|Re: Is C++ really used ? firstname.lastname@example.org (1997-05-13)|
|From:||email@example.com (Daniel J. Salomon)|
|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 <firstname.lastname@example.org> 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
Return to the
Search the comp.compilers archives again.