kurt%kong@gatech.edu (Erick Kurt Stirewalt) (07/27/90)
Hello - I am using the f77 front end (derived from the pcc front end) to generate a different type of intermediate code than normal from its internal expression trees. My question relates to the characteristics of the tree nodes. Say we have the expression: i = 1 This will result in a tree with the left subtree being an address node, the right subtree being a constant type node, and the root an assignment operation. Now look at the expression: j = i This will result in a tree with the left subtree being an address node, the right subtree being an address node, and the root an assignment operation. My question is, is there any way to know by looking *only at the address node* to see if this node is a left hand side of an assignment operation, or a right hand side? My first impression is that there probably is no difference in the first pass, and that the second pass knows whether or not it is a lhs or an rhs based on some tree walking procedure. This comes about because I am converting the f77 internal expression trees into a stack based intermediate code, and i need to know whether to leave the address of the operand on the stack (in the case of j in example 2), or leave the value of the operand on the stack (in the case of i in example 2). Thanks. Kurt Stirewalt % Georgia Tech Software Engineering Research Center. Atlanta, Georgia. % uucp: ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!kong!kurt % ARPA: kurt@kong.gatech.edu % -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus| world}!esegue. Meta-mail to compilers-request@esegue.