public abstract class Reference
extends java.lang.Object
| Constructor and Description |
|---|
Reference(Type type)
Create a new reference.
|
| Modifier and Type | Method and Description |
|---|---|
Reference |
add(java.math.BigInteger val)
Add the specified value to this reference.
|
Reference |
add(long val)
Add the specified value to this reference.
|
java.math.BigInteger |
difference(Reference ref)
Determine the difference between the two references.
|
Reference |
getBase()
Get this reference's base.
|
java.lang.String |
getField()
Get this reference's field.
|
java.math.BigInteger |
getIndex()
Get this reference's index.
|
java.math.BigInteger |
getLocation(C ops)
Get this reference's absolute memory location.
|
Type |
getType()
Get this reference's type.
|
boolean |
hasBase()
Determine whether this reference has a base.
|
boolean |
hasField()
Determine whether this reference has a field.
|
boolean |
hasIndex()
Determine whether this reference has an index.
|
boolean |
hasLocation()
Determine whether this reference has an absolute memory location.
|
Reference |
indirect(Type type)
Indirect this reference.
|
boolean |
isCast()
Determine whether this reference is a cast reference.
|
boolean |
isConstant()
Determine whether this reference represents a compile-time
constant memory location.
|
boolean |
isDynamic()
Determine whether this reference is a dynamic reference.
|
boolean |
isIndirect()
Determine whether this reference is an indirect reference.
|
boolean |
isNull()
Determine whether this reference is a null reference.
|
boolean |
isPrefix()
Determine whether this reference represents a prefix operator in
C syntax.
|
boolean |
isStatic()
Determine whether this reference is a static reference.
|
boolean |
isString()
Determine whether this reference is a string reference.
|
boolean |
isVariable()
Determine whether this reference is a variable reference.
|
Reference |
subtract(java.math.BigInteger val)
Subtract the specified value from this reference.
|
Reference |
subtract(long val)
Subtract the specified value from this reference.
|
java.lang.String |
toString() |
abstract void |
write(java.lang.Appendable out)
Write a human readable representation to the specified
appendable.
|
protected final Type type
public Reference(Type type)
type - The type.public Type getType()
public boolean isNull()
NullReference.NULL may still
return true; notably, an index reference with a null
base and a zero offset still is null.true if this reference is a null
reference.NullReferencepublic boolean isString()
true if this reference is a string
reference.StringReferencepublic boolean isVariable()
true if this reference is a variable
reference.VariableReferencepublic boolean isStatic()
true if this reference is a static
reference.StaticReferencepublic boolean isDynamic()
true if this reference is a dynamic
reference.DynamicReferencepublic boolean isPrefix()
true if this reference represents a
prefix operator.public boolean isCast()
true if this reference is a cast
reference.public boolean isIndirect()
true if this reference is an indirect
reference.public boolean hasBase()
true if this reference has a base.RelativeReferencepublic Reference getBase()
java.lang.IllegalStateException - Signals that this reference does
not have a base.RelativeReferencepublic boolean hasIndex()
true if this reference has an index.IndexReferencepublic java.math.BigInteger getIndex()
java.lang.IllegalStateException - Signals that this reference does
not have an index.public boolean hasField()
true if this reference has a field.FieldReferencepublic java.lang.String getField()
java.lang.IllegalStateException - Signals that this reference does
not have a field.public boolean hasLocation()
true if this reference has an absolute
memory location.public java.math.BigInteger getLocation(C ops)
ops - The C operations.java.lang.IllegalStateException - Signals that this reference does
not have an absolute memory location.public boolean isConstant()
true if this reference represents a
compile-time memory location.public Reference indirect(Type type)
type - The reference's declared type (before pointer decay).public Reference add(long val)
val - The value.val.public Reference add(java.math.BigInteger val)
val - The value.val.public Reference subtract(long val)
val - The value.val.public Reference subtract(java.math.BigInteger val)
val - The value.val.public java.math.BigInteger difference(Reference ref)
ref - The other reference.null if the difference
cannot be statically determined.public abstract void write(java.lang.Appendable out)
throws java.io.IOException
out - The appendable.java.io.IOException - Signals an I/O error.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014. All Rights Reserved.