Modifier and Type | Field and Description |
---|---|
static ArraySpecifier |
UNBOUNDED
The unbounded specifier []
|
ABSTRACT, AUTO, BOOL, BOOLEAN, BYTE, CBOOL, CCOMPLEX, CHAR, CIMAGINARY, CONST, DOUBLE, EXPLICIT, EXTERN, FINAL, FLOAT, FRIEND, INLINE, INT, LONG, MUTABLE, NATIVE, PRIVATE, PROTECTED, PUBLIC, REFERENCE, REGISTER, RESTRICT, SHORT, SIGNED, STATIC, STRICTFP, SYNCHRONIZED, THREADSAFE, TRANSIENT, TYPEDEF, UNSIGNED, VIRTUAL, VOID, VOLATILE, WCHAR_T
Constructor and Description |
---|
ArraySpecifier()
Constructs a new array specifier with an empty dimension.
|
ArraySpecifier(Expression expr)
Constructs a new array specifier with the given dimension expression.
|
ArraySpecifier(java.util.List dimensions)
Constructs a new array specifier with the given dimension expressions.
|
Modifier and Type | Method and Description |
---|---|
Expression |
getDimension(int n)
Gets the nth dimension of this array specifier.
|
int |
getNumDimensions()
Returns the number of index expressions used in this array specifier.
|
void |
print(java.io.PrintWriter o)
Prints the specifier to the print writer.
|
void |
setDimension(int n,
Expression expr)
Sets the nth dimension of this array specifier.
|
void |
setDimensions(java.util.List dimensions)
Set the list of dimension expressions.
|
fromString, isCType, toString
public static final ArraySpecifier UNBOUNDED
public ArraySpecifier()
public ArraySpecifier(Expression expr)
expr
- the dimension expression.public ArraySpecifier(java.util.List dimensions)
dimensions
- the list of dimension expressions.public Expression getDimension(int n)
n
- The position of the dimension.java.lang.IndexOutOfBoundsException
- if there is no expression at that
position.public int getNumDimensions()
public void print(java.io.PrintWriter o)
Specifier
public void setDimension(int n, Expression expr)
n
- The position of the dimension.expr
- The expression defining the size of the dimension.java.lang.IndexOutOfBoundsException
- if there is no dimension at that
position.public void setDimensions(java.util.List dimensions)
dimensions
- A list of expressions.