Related articles |
---|
expressions -- functions within function mr.waverlye@verizon.net (Mr.E) (2007-03-08) |
Re: expressions -- functions within function ajo@alumni.cmu.edu (Arthur J. O'Dwyer) (2007-03-08) |
Re: expressions -- functions within function mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2007-03-10) |
From: | "Mr.E" <mr.waverlye@verizon.net> |
Newsgroups: | comp.compilers |
Date: | 8 Mar 2007 09:40:37 -0500 |
Organization: | Compilers Central |
Keywords: | parse, question |
Posted-Date: | 08 Mar 2007 09:40:37 EST |
How would you insert a generic function into the precedence parser?
Actually more specifically, is it possible to insert a representation
of a generic function that has parameters that allows functions with
formal parameters as arguments?
As I thought about the use of an operator precedence parser I
concluded that if I were to encounter an expression that contained a
parameterized function, there would not be a way for me to deal with a
new expression until the original was complete unless I instantiated
another stack to represent the new expression. Example:
a = FN thisFunction( b ,FN thatFunction( c + 1, FN
anotherFunction))
When I start to deal with FN thatFunction which has parameters and
expressions of its own, I would need to start a brand new stack. That
doesn't seem like a good idea. If this were a recursive descent
evaluation just recursively calling the procedure expr0 (the
expression entry point) would be the thing to do. I'm at a loss as to
how I would deal with parameterized functions that have parameterized
functions as expressions.
Would someone mind presenting some ideas that would assist me in
dealing with this problem?
Thanks,
W.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.