soot.dava.internal.AST.ASTForLoopNode Maven / Gradle / Ivy
package soot.dava.internal.AST;
/*-
* #%L
* Soot - a J*va Optimization Framework
* %%
* Copyright (C) 2005 Nomair A. Naeem
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import soot.Unit;
import soot.UnitPrinter;
import soot.dava.internal.SET.SETNodeLabel;
import soot.dava.internal.asg.AugmentedStmt;
import soot.dava.toolkits.base.AST.analysis.Analysis;
/*
Will contain the For loop Construct
________ _______ _______
for ( |___A____| ;|___B___| ;|___C___| )
* A has to be the following (look at the java grammar specs)
--> local variable declarations (int a=0,b=3,c=10)
OR
--> assignment expressions
--> increment/decrement expressions both pre and post e.g. ++bla,--bla,bla++,bla--
--> all sorts of method invocations
--> new class instance declaration (dont know exactly what these include)
* B can be any ASTCondition
* C can be
--> assignment expressions
--> increment/decrement expressions both pre and post e.g. ++bla,--bla,bla++,bla--
--> all sorts of method invocations
--> new class instance declaration (dont know exactly what these include)
Extend the ASTControlFlowNode since there is a B (ASTCondition involved)
and also since that extends ASTlabeledNoce and a for loop can have an associated label
*/
public class ASTForLoopNode extends ASTControlFlowNode {
private List init; // list of values
// notice B is an ASTCondition and is stored in the parent
private List update; // list of values
private List