@Override public void visit(Macro node) { appendIndent(); code.append(node.getName()); code.append(" = {\n"); indent++; if (node.getBody().size() > 0) { node.getBody().get(0).accept(this); } if (node.getReturnValue() != null) { appendIndent(); code.append(node.getReturnValue()); } indent--; appendIndent(); code.append("}\n"); node.getSuccessor().accept(this); }
@Override public void visit(Macro node) { output.println("MacroNode: "+node.toString()); super.visit(node); }
@Override public void visit(Macro node) { // ignore body of macro node.getSuccessor().accept(this); }
@Override public void visit(Macro node) { int argsCount = Math.max(getMaxCountOfUsedArguments(node.getBody()),MaxFunctionArgumentNumberGetter.getMaxFunctionArgumentNumber(node.getReturnValue())); macrosMap.put(new StringIntContainer(node.getName(), argsCount), node); super.visit(node); }
for (SequentialNode sNode: macro.getBody()) { if (sNode instanceof AssignmentNode) { AssignmentNode assignmentNode = (AssignmentNode) sNode; for (SequentialNode sNode: macro.getBody()) { SequentialNode copySNode = sNode.copy(); Expression copiedReturnVal = macro.getReturnValue().copy();
public Macro handleMacroDefinition(String id, List<SequentialNode> body, Expression ret) { // reset current macro name to allow further calls currentMacroDefinition = ""; Macro macro = new Macro(graph, id, body, ret); addNode(macro); graph.addMacro(macro); rewireNodes(body, macro); return macro; }
/** * Adds a new macro definition. * * @param macro new macro definition */ public void addMacro(Macro macro) { macros.put(macro.getName(), macro); }
/** * {@inheritDoc} * * This empty implementation visits the successor node by default. */ @Override public void visit(Macro node) { node.getSuccessor().accept(this); }
public Macro handleMacroDefinition(String id, List<SequentialNode> body, Expression ret) { // reset current macro name to allow further calls currentMacroDefinition = ""; Macro macro = new Macro(graph, id, body, ret); addNode(macro); graph.addMacro(macro); rewireNodes(body, macro); return macro; }
@Override public void visit(Macro node) { // ignore body of macro node.getSuccessor().accept(this); }
/** * {@inheritDoc} * * This empty implementation visits the successor node by default. */ @Override public void visit(Macro node) { node.getSuccessor().accept(this); }
@Override public void visit(Macro node) { node.getSuccessor().accept(this); }
@Override public void visit(Macro node) { node.getSuccessor().accept(this); }