de.gaalop.cfg.Node.accept()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中de.gaalop.cfg.Node.accept()方法的一些代码示例,展示了Node.accept()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.accept()方法的具体详情如下:
包路径:de.gaalop.cfg.Node
类名称:Node
方法名:accept

Node.accept介绍

[英]This method must be implemented by every concrete subclass. It should call a visit method in ControlFlowVisitor whose only parameter has the concrete type of the object calling the method.

Please see the Visitor Pattern for more detail.
[中]这个方法必须由每个具体的子类实现。它应该在ControlFlowVisitor中调用一个访问方法,该方法的唯一参数具有调用该方法的对象的具体类型。
请查看访客模式以了解更多详细信息。

代码示例

代码示例来源:origin: CallForSanity/Gaalop

/**
 * Returns the type of a ControlFlowGraphNode
 * @param node The node
 * @return The type of the given node
 */
public static CFGNodeType getTypeOfCFGNode(Node node) {
  if (node == null) {
    return null;
  }
  node.accept(getter);
  return getter.type;
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(Macro node) {
  // ignore body of macro
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * {@inheritDoc}
 *
 * This empty implementation visits the successor node by default.
 */
@Override
public void visit(BreakNode node) {
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * {@inheritDoc}
 *
 * This empty implementation visits the successor node by default.
 */
@Override
public void visit(Macro node) {
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(StartNode node) {
  code.append("\\begin{align*}\n");
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(BreakNode breakNode) {
  code.append("\\text{break}\\\\");
  breakNode.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * {@inheritDoc}
 * 
 * This empty implementation visits the successor node by default.
 */
@Override
public void visit(AssignmentNode node) {
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * {@inheritDoc}
 * 
 * This empty implementation visits the successor node by default.
 */
@Override
public void visit(StoreResultNode node) {
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override   //cfg
public void visit(StartNode node) {
  System.out.println("Starting CSE Collections");
  opstor = new OperationStore();
  this.cfg = node.getGraph();
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(StoreResultNode node) {
  assigned.add(node.getValue().getName() + suffix);
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(LoopNode node) {
  node.getBody().accept(this);
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(ExpressionStatement node) {
  appendIndentation();
  node.getExpression().accept(this);
  code.append(";\n");
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * {@inheritDoc}
 * 
 * This empty implementation visits the successor node by default.
 */
@Override
public void visit(LoopNode node) {
  node.getBody().accept(this);
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(AssignmentNode node) {
  node.getSuccessor().accept(this);
  node.getValue().accept(this);
  node.setValue(resultExpr);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(AssignmentNode node) {
  System.out.println("Replacer : Assginment Node " + node.getVariable().toString()+" visited------------------------------------");

  node.getValue().accept(this);
  node.setValue(nx);
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(ExpressionStatement node) {
  appendIndentation();
  node.getExpression().accept(this);
  append(";\n");
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(LoopNode node) {
  node.getCounterVariable().accept(this);
  node.getBody().accept(this);
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(StoreResultNode node) {
  addNode(node, "Output:\\n" + node.getValue());
  addForwardEdge(node, node.getSuccessor());
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(IfThenElseNode node) {
  findUndeclaredVariables(node.getCondition());
  node.getPositive().accept(this);
  node.getNegative().accept(this);
  node.getSuccessor().accept(this);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(IfThenElseNode node) {
  findUndeclaredVariables(node.getCondition());
  node.getPositive().accept(this);
  node.getNegative().accept(this);
  node.getSuccessor().accept(this);
}

相关文章

微信公众号

最新文章

更多