import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
// check 'for loop' case
BlockNode bn = ln.getInitializer();
bn.getVarTable().setParent(nametable);
-
+ // need to check initialization node
+// checkLocationFromBlockNode(md, bn.getVarTable(), bn, constraint);
+ for(int i=0; i<bn.size(); i++) {
+ BlockStatementNode bsn=bn.get(i);
+ checkLocationFromBlockStatementNode(md, bn.getVarTable(),bsn, constraint);
+ }
+
// calculate glb location of condition and update statements
CompositeLocation condLoc =
checkLocationFromExpressionNode(md, bn.getVarTable(), ln.getCondition(),
private void checkDeclarationInSubBlockNode(MethodDescriptor md, SymbolTable nametable,
SubBlockNode sbn) {
- checkDeclarationInBlockNode(md, nametable.getParent(), sbn.getBlockNode());
+ checkDeclarationInBlockNode(md, nametable, sbn.getBlockNode());
}
private CompositeLocation checkLocationFromBlockExpressionNode(MethodDescriptor md,
SymbolTable nametable, BlockExpressionNode ben, CompositeLocation constraint) {
+
CompositeLocation compLoc =
checkLocationFromExpressionNode(md, nametable, ben.getExpression(), null, constraint, false);
// addTypeLocation(ben.getExpression().getType(), compLoc);