Interface ArrayInit

All Superinterfaces:
java.lang.Cloneable, Copy, Expr, JL, Node, NodeOps, Prefix, Receiver, Term, Typed
All Known Implementing Classes:

public interface ArrayInit
extends Expr

An ArrayInit is an immutable representation of an array initializer, such as { 3, 1, { 4, 1, 5 } }. Note that the elements of these array may be expressions of any type (e.g., Call).

Method Summary
 java.util.List elements()
          Get the initializer elements.
 ArrayInit elements(java.util.List elements)
          Set the initializer elements.
 void typeCheckElements(Type lhsType)
          Type check the individual elements of the array initializer against the left-hand-side type.
Methods inherited from interface polyglot.ast.Expr
constantValue, isConstant, precedence, printSubExpr, printSubExpr, type
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
Methods inherited from interface polyglot.ast.JL
init, node
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
Methods inherited from interface polyglot.util.Copy
Methods inherited from interface polyglot.ast.Typed
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable

Method Detail


java.util.List elements()
Get the initializer elements.

A list of Expr.


ArrayInit elements(java.util.List elements)
Set the initializer elements.

elements - A list of Expr.


void typeCheckElements(Type lhsType)
                       throws SemanticException
Type check the individual elements of the array initializer against the left-hand-side type. Each element is checked to see if it can be assigned to a variable of type lhsType.

lhsType - Type to compare against.
SemanticException - if there is a type error.