getNativeExpr()
and the optional CNumber representation, see getNumber().
The representation of the equivalent java expression including
the result type is covered by JavaExpr,
which can be computed via computeJavaExpr(Map).
This class and its sub-classes define and convert all native expressions to Java space.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ConstantDefinition.
A Number, either integer, optionally [long, unsigned], or floating point, optionally [double]. |
| public static class | ConstantDefinition.
A valid java expression, including its result type,
usually generated from a native [C] expression,
see |
| Modifier and Type | Field and Description |
|---|---|
| private final ASTLocusTag | |
| private final String | |
| private final boolean | |
| private final String | |
| private final ConstantDefinition. | |
| public static Pattern | |
| public static final Pattern | patternDecimalNumber
Complete pattern for |
| public static final Pattern | patternDecimalOrIntNumber
Complete pattern for |
| public static Pattern | patternHexNumber
Complete pattern for |
| public static final Pattern | patternIntegerNumber
Complete pattern for |
| private final boolean | |
| public static final long | |
| public static final BigInteger |
| Access | Constructor and Description |
|---|---|
| public | ConstantDefinition(final String
unique name of this constant expression name, final String original [native] expression nativeExpr, final ConstantDefinition.AST location of the represented constant. astLocus)Constructor for plain const-values, non-enumerates. |
| public | ConstantDefinition(final String
unique name of this constant expression name, final String original [native] expression nativeExpr, final ConstantDefinition.optional name of the represented enumeration enumName, final ASTLocusTag AST location of the represented constant. astLocus)Constructor for enumerates |
| private | ConstantDefinition(final String
unique name of this constant expression name, final String original [native] expression nativeExpr, final ConstantDefinition.true if this constant is an enumerate, otherwise false.optional name of the represented enumeration enumName, final ASTLocusTag AST location of the represented constant. astLocus)
|
| Modifier and Type | Method and Description |
|---|---|
| public final ConstantDefinition. | computeJavaExpr(final Map<String, ConstantDefinition.
Computes the |
| public static ConstantDefinition. | decodeANumber(final String v)
Returns either |
| public static ConstantDefinition. | decodeDecimalNumber(final String v)
If the given string |
| public static ConstantDefinition. | decodeIntegerNumber(final String v)
If the given string |
| private static long | |
| public final boolean | equals(final Object
the reference object with which to compare. arg)Overrides java. name.
|
| private static boolean | |
| public final boolean | equalSemantics(final TypeComparator.
Implements com. name.
|
| public ASTLocusTag | getASTLocusTag()
Implements com. ASTLocusTag, if available,
otherwise returns null.
|
| public String | getEnumName()
Returns |
| public String | |
| public ConstantDefinition. | getNumber()
Returns the parsed |
| public final int | |
| public final int | hashCodeSemantics()
Implements com. name.
|
| public boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | isDecimalNumber(final String s)
Matches pattern for |
| public static boolean | isDecimalOrIntNumber(final String s)
Complete pattern for |
| public boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public String |
| astLocus | back to summary |
|---|---|
| private final ASTLocusTag astLocus | |
| enumName | back to summary |
|---|---|
| private final String enumName | |
| isEnum | back to summary |
|---|---|
| private final boolean isEnum | |
| nativeExpr | back to summary |
|---|---|
| private final String nativeExpr | |
| number | back to summary |
|---|---|
| private final ConstantDefinition. | |
| patternCPPOperand | back to summary |
|---|---|
| public static Pattern patternCPPOperand One of:
Expression excludes | |
| patternDecimalNumber | back to summary |
|---|---|
| public static final Pattern patternDecimalNumber Complete pattern for | |
| patternDecimalOrIntNumber | back to summary |
|---|---|
| public static final Pattern patternDecimalOrIntNumber Complete pattern for | |
| patternHexNumber | back to summary |
|---|---|
| public static Pattern patternHexNumber Complete pattern for | |
| patternIntegerNumber | back to summary |
|---|---|
| public static final Pattern patternIntegerNumber Complete pattern for | |
| relaxedEqSem | back to summary |
|---|---|
| private final boolean relaxedEqSem | |
| UNSIGNED_INT_MAX_VALUE | back to summary |
|---|---|
| public static final long UNSIGNED_INT_MAX_VALUE | |
| UNSIGNED_LONG_MAX_VALUE | back to summary |
|---|---|
| public static final BigInteger UNSIGNED_LONG_MAX_VALUE | |
| ConstantDefinition | back to summary |
|---|---|
| public ConstantDefinition(final String name, final String nativeExpr, final ConstantDefinition. Constructor for plain const-values, non-enumerates.
| |
| ConstantDefinition | back to summary |
|---|---|
| public ConstantDefinition(final String name, final String nativeExpr, final ConstantDefinition. Constructor for enumerates
| |
| ConstantDefinition | back to summary |
|---|---|
private ConstantDefinition(final String name, final String nativeExpr, final ConstantDefinition.
| |
| computeJavaExpr | back to summary |
|---|---|
| public final ConstantDefinition. Computes the | |
| decodeANumber | back to summary |
|---|---|
| public static ConstantDefinition. Returns either | |
| decodeDecimalNumber | back to summary |
|---|---|
| public static ConstantDefinition. If the given string
Method utilizes | |
| decodeIntegerNumber | back to summary |
|---|---|
| public static ConstantDefinition. If the given string
Method strips off sign prefix | |
| decodeULong | back to summary |
|---|---|
| private static long decodeULong(final String v, final boolean neg) throws NumberFormatException | |
| equals | back to summary |
|---|---|
| public final boolean equals(final Object arg) Overrides java. Equality test by its given
| |
| equals | back to summary |
|---|---|
| private static boolean equals(final String s1, final String s2) | |
| equalSemantics | back to summary |
|---|---|
| public final boolean equalSemantics(final TypeComparator. Implements com. Doc from com. Semantic equality test for Types exclusive its given
| |
| getASTLocusTag | back to summary |
|---|---|
| public ASTLocusTag getASTLocusTag() Implements com. Doc from com. Returns this instance's
| |
| getEnumName | back to summary |
|---|---|
| public String getEnumName() Returns | |
| getNativeExpr | back to summary |
|---|---|
| public String getNativeExpr() Returns the original [native] expression. | |
| getNumber | back to summary |
|---|---|
| public ConstantDefinition. Returns the parsed | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Hash by its given
| |
| hashCodeSemantics | back to summary |
|---|---|
| public final int hashCodeSemantics() Implements com. Doc from com. Semantic hashcode for Types exclusive its given
| |
| hasNumber | back to summary |
|---|---|
| public boolean hasNumber() Returns | |
| isConstantExpression | back to summary |
|---|---|
| public static boolean isConstantExpression(final String value) | |
| isCPPOperand | back to summary |
|---|---|
| public static boolean isCPPOperand(final String s) Matches pattern for valid CPP operands, see | |
| isDecimalNumber | back to summary |
|---|---|
| public static boolean isDecimalNumber(final String s) Matches pattern for | |
| isDecimalOrIntNumber | back to summary |
|---|---|
| public static boolean isDecimalOrIntNumber(final String s) Complete pattern for | |
| isEnum | back to summary |
|---|---|
| public boolean isEnum() | |
| isHexNumber | back to summary |
|---|---|
| public static boolean isHexNumber(final String s) Matches | |
| isIdentifier | back to summary |
|---|---|
| public static boolean isIdentifier(final String value) | |
| isIntegerNumber | back to summary |
|---|---|
| public static boolean isIntegerNumber(final String s) Matches | |
| isNumber | back to summary |
|---|---|
| public static boolean isNumber(final String s) Matches | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public final double | f
The value if ! |
| public final long | |
| public final boolean | isDouble
|
| public final boolean | |
| public final boolean | |
| public final boolean | isUnsigned
|
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object
the reference object with which to compare. arg)Overrides java. |
| public int | |
| public final String | |
| public final String |
| f | back to summary |
|---|---|
| public final double f The value if ! | |
| i | back to summary |
|---|---|
| public final long i The value if | |
| isDouble | back to summary |
|---|---|
| public final boolean isDouble
| |
| isInteger | back to summary |
|---|---|
| public final boolean isInteger
| |
| isLong | back to summary |
|---|---|
| public final boolean isLong
| |
| isUnsigned | back to summary |
|---|---|
| public final boolean isUnsigned
| |
| CNumber | back to summary |
|---|---|
| public CNumber(final boolean isLong, final boolean isUnsigned, final long value) ctor for integer number | |
| CNumber | back to summary |
|---|---|
| public CNumber(final boolean isDouble, final double value) ctor for floating point number | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object arg) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toJavaString | back to summary |
|---|---|
| public final String toJavaString() | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
JavaExpr#create(ConstantDefinition).
| Modifier and Type | Field and Description |
|---|---|
| public final String | |
| public final Number | |
| public final String | |
| public final ConstantDefinition. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static ConstantDefinition. | compute(final ConstantDefinition constDef, final Map<String, ConstantDefinition.
Computes a valid |
| private static ConstantDefinition. | |
| private static ConstantDefinition. | |
| private static ConstantDefinition. | processValue(final ConstantDefinition constDef, final String sValue, final Map<String, ConstantDefinition.
|
| javaExpression | back to summary |
|---|---|
| public final String javaExpression | |
| resultJavaType | back to summary |
|---|---|
| public final Number resultJavaType | |
| resultJavaTypeName | back to summary |
|---|---|
| public final String resultJavaTypeName | |
| resultType | back to summary |
|---|---|
| public final ConstantDefinition. | |
| JavaExpr | back to summary |
|---|---|
| public JavaExpr(final String javaExpression, final ConstantDefinition. | |
| compute | back to summary |
|---|---|
| public static ConstantDefinition. Computes a valid | |
| evalType | back to summary |
|---|---|
| private static ConstantDefinition. | |
| getANumber | back to summary |
|---|---|
| private static ConstantDefinition. | |
| processValue | back to summary |
|---|---|
| private static ConstantDefinition. | |