コード例 #1
0
  /**
   * Loop through all of the children of this node, visiting each one of them, which will cause
   * their token value to be determined.
   */
  protected Type[] _inferAllChildren(ASTPtRootNode node) throws IllegalActionException {
    Type[] types = new Type[node.jjtGetNumChildren()];
    int numChildren = node.jjtGetNumChildren();

    for (int i = 0; i < numChildren; i++) {
      _inferChild(node, i);

      Type type = _inferredChildType;

      if (type == null) {
        throw new RuntimeException("node " + node.jjtGetChild(i) + " has no type.");
      }

      types[i] = type;
    }

    return types;
  }
コード例 #2
0
  /**
   * Loop through all of the children of this node, visiting each one of them; this will cause their
   * token value to be determined.
   *
   * @param node The node whose children are evaluated.
   * @exception IllegalActionException If an evaluation error occurs.
   */
  protected ptolemy.data.Token[] _evaluateAllChildren(ASTPtRootNode node)
      throws IllegalActionException {
    int numChildren = node.jjtGetNumChildren();
    ptolemy.data.Token[] tokens = new ptolemy.data.Token[numChildren];

    for (int i = 0; i < numChildren; i++) {
      /* ASTPtRootNode child = (ASTPtRootNode) */ node.jjtGetChild(i);
      tokens[i] = _evaluateChild(node, i);
    }

    return tokens;
  }