Beispiel #1
0
 /**
  * Set the node's type and also update the binding, if there is one (if the new type is not
  * undefined).
  *
  * @param node the AST node
  * @param type the type to assign to the node and binding
  */
 void setNodeTypeAndMaybeBinding(LatteAST node, LatteType type) {
   node.setNodeType(type);
   if (type != tUNDEFINED && node.getBinding() != null) {
     node.getBinding().setType(type);
   }
 }
Beispiel #2
0
 /**
  * This is an imperitive command to set the node type and its binding to the specified type.
  * Calling this method means that the caller assumes the responsibility for ensuring that there is
  * a binding corresponding to the node and that the type there is appropriate. This is used mainly
  * for declarations where there is no doubt about the types.
  *
  * @param node the AST node
  * @param type the type to assign to the node and binding
  */
 void setNodeTypeAndBinding(LatteAST node, LatteType type) {
   node.setNodeType(type);
   node.getBinding().setType(type);
 }