Re: Question on Compiler parse semantic analysis

"Kamal R. Prasad" <kamalp@ix.netcom.com>
29 Jul 2000 23:18:41 -0400

          From comp.compilers

Related articles
Re: Question on Compiler parse semantic analysis comments@vrml3d.com (vrml3d.com) (2000-07-23)
Re: Question on Compiler parse semantic analysis kamalp@ix.netcom.com (Kamal R. Prasad) (2000-07-29)
| List of all articles for this month |
From: "Kamal R. Prasad" <kamalp@ix.netcom.com>
Newsgroups: comp.compilers
Date: 29 Jul 2000 23:18:41 -0400
Organization: Compilers Central
References: <8lbs8s$vge$1@nnrp1.deja.com> 00-07-060
Keywords: parse, semantics

If you are referring to variables defined in function scope, the answer is:-
you need an AST for the language. In the simplest of cases, you would have a
linked list with variabkes defined in a function hanging from the
corresponding nodes. this way variables with same names in different
functions can be distinguished. if the langauge permits recursion/nested
calls, you would use a tree of stacks as the data structure eg: pascal/C.
regards
-kamal
------------------------------------------------------------
kamalpr@yahoo.com


Post a followup to this message

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