public Collection<String> getAllVariables(ValueMapPath path) { Vector<String> vars = new Vector<String>(); vars.add(getName()); Collection<String> moreVars = JavaParser.getAllVariables(path.substitute(variable.getInitialValue())); for (String var : moreVars) if (!vars.contains(var)) vars.add(var); Collection<String> ifVars = getCodeBundleContainingMe().getIfClauseVariables(path); vars.addAll(ifVars); return (vars); }
public Collection<VariableDependency> getVariableDependencies(ValueMapPath path) { Vector<VariableDependency> deps = new Vector<VariableDependency>(); String leftVar = path.substituteJavaName(getName()); Collection<String> rightVars = JavaParser.getAllVariables(path.substitute(variable.getInitialValue())); for (String var : rightVars) deps.add(new VariableDependency(leftVar, var, VariableDependency.ASSIGN)); Collection<String> ifVars = getCodeBundleContainingMe().getIfClauseVariables(path); for (String var : ifVars) deps.add(new VariableDependency(leftVar, var, VariableDependency.LITERAL_if)); return (deps); }
public Collection<Instruction> getInstructions() { if (instructions == null) { instructions = new Vector<Instruction>(); instructions.add(new DeclarationInstruction()); } return (instructions); }
public void addChild(Keyword keyword) { if (!children.contains(keyword)) children.add(keyword); }
public Collection<String> getSetVariables(ValueMapPath path) { Vector<String> vars = new Vector(); vars.add(path.substituteJavaName(getName())); return (vars); }