|newbie questions about AST email@example.com (Felix Mish) (1998-10-05)|
|Re:newbie question on AST KPRASAD@us.oracle.com (KPRASAD.US.ORACLE.COM) (1998-10-17)|
|Date:||17 Oct 1998 01:45:58 -0400|
You need to construct a data structure that will hold all function
calls and their corresponding stacks. Pascal/C/C++ will have a tree
of stacks as the AST for procedure calls. Each node in a tree will
contain a stack of all variables defined within the function. If a
variable outside the scope of the function is refered, then we look at
the parent node 's stack and so on. if in the while loop, you are
defining variables, then its like a nested function call. A *while*
will be a node that has an expression evvaluation subtree and on
evaluation that will lead to loop/end-of-loop .
Return to the
Search the comp.compilers archives again.