|
GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java (public API).
|
Represents a [native] constant expression, comprises the [native] expression, see getNativeExpr() and the optional CNumber representation, see getNumber().
More...
Classes | |
| class | CNumber |
| A Number, either integer, optionally [long, unsigned], or floating point, optionally [double]. More... | |
| class | JavaExpr |
A valid java expression, including its result type, usually generated from a native [C] expression, see JavaExpr#create(ConstantDefinition). More... | |
Public Member Functions | |
| ConstantDefinition (final String name, final String nativeExpr, final CNumber number, final ASTLocusTag astLocus) | |
| Constructor for plain const-values, non-enumerates. More... | |
| ConstantDefinition (final String name, final String nativeExpr, final CNumber number, final String enumName, final ASTLocusTag astLocus) | |
| Constructor for enumerates. More... | |
| ASTLocusTag | getASTLocusTag () |
Returns this instance's ASTLocusTag, if available, otherwise returns null. More... | |
| final int | hashCode () |
Hash by its given name. More... | |
| final boolean | equals (final Object arg) |
Equality test by its given name. More... | |
| final int | hashCodeSemantics () |
Semantic hashcode for Types exclusive its given name. More... | |
| final boolean | equalSemantics (final SemanticEqualityOp arg) |
Semantic equality test for Types exclusive its given name. More... | |
| String | getNativeExpr () |
| Returns the original [native] expression. More... | |
| CNumber | getNumber () |
Returns the parsed CNumber of the native expression, or null if the latter does not comprise a single number, i.e. More... | |
| boolean | hasNumber () |
Returns true if this instance represents has a number, otherwise false. More... | |
| String | getEnumName () |
Returns null if this definition was not part of an enumeration, or if the enumeration is anonymous. More... | |
| boolean | isEnum () |
| String | toString () |
| final JavaExpr | computeJavaExpr (final Map< String, ConstantDefinition.JavaExpr > constMap) |
Computes the java expression based on this instance, see JavaExpr#create(ConstantDefinition). More... | |
Public Member Functions inherited from com.jogamp.gluegen.cgram.types.AliasedSymbol.AliasedSymbolImpl | |
| AliasedSymbolImpl (final String origName) | |
| AliasedSymbolImpl (final AliasedSymbolImpl o) | |
| void | rename (final String newName) |
Rename this symbol with the given newName if not equal current-name. More... | |
| void | addAliasedName (final String origName) |
Add the given origName to the list of aliases if not equal current-name. More... | |
| boolean | hasAliases () |
Returns true if this symbol has aliases, i.e. More... | |
| Set< String > | getAliasedNames () |
| Return all aliases for this symbol, i.e. More... | |
| String | getOrigName () |
| Return the original-name as set at creation. More... | |
| String | getName () |
Return the current-name, which is the last renamed-name if issued, or the original-name. More... | |
| String | getAliasedString () |
Return this object's toString() wrapped w/ the current-name and all aliases. More... | |
| void | rename (final String newName) |
Rename this symbol with the given newName if not equal current-name. More... | |
| void | addAliasedName (final String origName) |
Add the given origName to the list of aliases if not equal current-name. More... | |
| boolean | hasAliases () |
Returns true if this symbol has aliases, i.e. More... | |
| Set< String > | getAliasedNames () |
| Return all aliases for this symbol, i.e. More... | |
| String | getOrigName () |
| Return the original-name as set at creation. More... | |
| String | getName () |
Return the current-name, which is the last renamed-name if issued, or the original-name. More... | |
| String | getAliasedString () |
Return this object's toString() wrapped w/ the current-name and all aliases. More... | |
| int | hashCodeSemantics () |
Semantic hashcode for Types exclusive its given name. More... | |
| boolean | equalSemantics (final SemanticEqualityOp arg) |
Semantic equality test for Types exclusive its given name. More... | |
| ASTLocusTag | getASTLocusTag () |
Returns this instance's ASTLocusTag, if available, otherwise returns null. More... | |
Static Public Member Functions | |
| static boolean | isConstantExpression (final String value) |
| static boolean | isIdentifier (final String value) |
| static CNumber | decodeANumber (final String v) |
Returns either decodeIntegerNumber(String), decodeDecimalNumber(String) or null. More... | |
| static CNumber | decodeIntegerNumber (final String v) |
If the given string isIntegerNumber(String), return the decoded integer value, represented as a ANumber, otherwise returns null. More... | |
| static CNumber | decodeDecimalNumber (final String v) |
If the given string isDecimalNumber(String), return the decoded floating-point value, represented as a ANumber object, otherwise returns null. More... | |
| static boolean | isNumber (final String s) |
Matches isHexNumber(String) or isDecimalOrIntNumber(String). More... | |
| static boolean | isIntegerNumber (final String s) |
Matches isHexNumber(String) or patternIntegerNumber. More... | |
| static boolean | isHexNumber (final String s) |
Matches patternHexNumber. More... | |
| static boolean | isDecimalNumber (final String s) |
Matches pattern for floating point number, compatible and described in Double#valueOf(String). More... | |
| static boolean | isDecimalOrIntNumber (final String s) |
Complete pattern for floating point and integer number, covering patternDecimalNumber and patternIntegerNumber. More... | |
| static boolean | isCPPOperand (final String s) |
Matches pattern for valid CPP operands, see patternCPPOperand. More... | |
Static Public Attributes | |
| static final long | UNSIGNED_INT_MAX_VALUE = 0xffffffffL |
| static final BigInteger | UNSIGNED_LONG_MAX_VALUE = new BigInteger("ffffffffffffffff", 16) |
| static Pattern | patternHexNumber |
Complete pattern for hexadecimal number, including an optional sign [+-] and optional suffixes [uUlL]. More... | |
| static final Pattern | patternDecimalNumber |
Complete pattern for floating point number, compatible and described in Double#valueOf(String). More... | |
| static final Pattern | patternDecimalOrIntNumber |
Complete pattern for floating point and integer number, covering patternDecimalNumber and patternIntegerNumber. More... | |
| static final Pattern | patternIntegerNumber |
Complete pattern for integer number, including an optional sign [+-] and optional suffixes [uUlL]. More... | |
| static Pattern | patternCPPOperand |
One of: + - * / | & ( ) << >> ~ @endiliteral. More... | |
Represents a [native] constant expression, comprises the [native] expression, see 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.
Definition at line 54 of file ConstantDefinition.java.
| com.jogamp.gluegen.ConstantDefinition.ConstantDefinition | ( | final String | name, |
| final String | nativeExpr, | ||
| final CNumber | number, | ||
| final ASTLocusTag | astLocus | ||
| ) |
Constructor for plain const-values, non-enumerates.
| name | unique name of this constant expression |
| nativeExpr | original [native] expression |
| number | optional CNumber representing this constant. If null, implementation attempts to derive a CNumber of the given nativeExpr. |
| astLocus | AST location of the represented constant. |
Definition at line 329 of file ConstantDefinition.java.
| com.jogamp.gluegen.ConstantDefinition.ConstantDefinition | ( | final String | name, |
| final String | nativeExpr, | ||
| final CNumber | number, | ||
| final String | enumName, | ||
| final ASTLocusTag | astLocus | ||
| ) |
Constructor for enumerates.
| name | unique name of this constant expression |
| nativeExpr | original [native] expression |
| number | optional CNumber representing this constant. If null, implementation attempts to derive a CNumber of the given nativeExpr. |
| enumName | optional name of the represented enumeration |
| astLocus | AST location of the represented constant. |
Definition at line 345 of file ConstantDefinition.java.
| final JavaExpr com.jogamp.gluegen.ConstantDefinition.computeJavaExpr | ( | final Map< String, ConstantDefinition.JavaExpr > | constMap | ) |
Computes the java expression based on this instance, see JavaExpr#create(ConstantDefinition).
Definition at line 494 of file ConstantDefinition.java.
|
static |
Returns either decodeIntegerNumber(String), decodeDecimalNumber(String) or null.
| v |
Definition at line 558 of file ConstantDefinition.java.
|
static |
If the given string isDecimalNumber(String), return the decoded floating-point value, represented as a ANumber object, otherwise returns null.
Method utilizes Double#valueOf(String).
| v | |
| isDouble | return value for double flag |
Definition at line 670 of file ConstantDefinition.java.
|
static |
If the given string isIntegerNumber(String), return the decoded integer value, represented as a ANumber, otherwise returns null.
Method strips off sign prefix + and integer modifier suffixes [uUlL] before utilizing Long#decode(String).
| v |
Definition at line 577 of file ConstantDefinition.java.
| final boolean com.jogamp.gluegen.ConstantDefinition.equals | ( | final Object | arg | ) |
Equality test by its given name.
Definition at line 404 of file ConstantDefinition.java.
| final boolean com.jogamp.gluegen.ConstantDefinition.equalSemantics | ( | final SemanticEqualityOp | arg | ) |
Semantic equality test for Types exclusive its given name.
Implements com.jogamp.gluegen.cgram.types.TypeComparator.SemanticEqualityOp.
Definition at line 426 of file ConstantDefinition.java.
| ASTLocusTag com.jogamp.gluegen.ConstantDefinition.getASTLocusTag | ( | ) |
Returns this instance's ASTLocusTag, if available, otherwise returns null.
Implements com.jogamp.gluegen.ASTLocusTag.ASTLocusTagProvider.
Definition at line 390 of file ConstantDefinition.java.
| String com.jogamp.gluegen.ConstantDefinition.getEnumName | ( | ) |
Returns null if this definition was not part of an enumeration, or if the enumeration is anonymous.
Definition at line 467 of file ConstantDefinition.java.
| String com.jogamp.gluegen.ConstantDefinition.getNativeExpr | ( | ) |
Returns the original [native] expression.
Definition at line 452 of file ConstantDefinition.java.
| CNumber com.jogamp.gluegen.ConstantDefinition.getNumber | ( | ) |
Returns the parsed CNumber of the native expression, or null if the latter does not comprise a single number, i.e.
is a complex expression.
Definition at line 458 of file ConstantDefinition.java.
| final int com.jogamp.gluegen.ConstantDefinition.hashCode | ( | ) |
Hash by its given name.
Definition at line 396 of file ConstantDefinition.java.
| final int com.jogamp.gluegen.ConstantDefinition.hashCodeSemantics | ( | ) |
Semantic hashcode for Types exclusive its given name.
Implements com.jogamp.gluegen.cgram.types.TypeComparator.SemanticEqualityOp.
Definition at line 416 of file ConstantDefinition.java.
| boolean com.jogamp.gluegen.ConstantDefinition.hasNumber | ( | ) |
Returns true if this instance represents has a number, otherwise false.
Definition at line 463 of file ConstantDefinition.java.
|
static |
Definition at line 502 of file ConstantDefinition.java.
|
static |
Matches pattern for valid CPP operands, see patternCPPOperand.
Definition at line 736 of file ConstantDefinition.java.
|
static |
Matches pattern for floating point number, compatible and described in Double#valueOf(String).
Definition at line 721 of file ConstantDefinition.java.
|
static |
Complete pattern for floating point and integer number, covering patternDecimalNumber and patternIntegerNumber.
Definition at line 729 of file ConstantDefinition.java.
| boolean com.jogamp.gluegen.ConstantDefinition.isEnum | ( | ) |
Definition at line 469 of file ConstantDefinition.java.
|
static |
Matches patternHexNumber.
Definition at line 713 of file ConstantDefinition.java.
|
static |
Definition at line 532 of file ConstantDefinition.java.
|
static |
Matches isHexNumber(String) or patternIntegerNumber.
Definition at line 702 of file ConstantDefinition.java.
|
static |
Matches isHexNumber(String) or isDecimalOrIntNumber(String).
Definition at line 691 of file ConstantDefinition.java.
| String com.jogamp.gluegen.ConstantDefinition.toString | ( | ) |
|
static |
One of: + - * / | & ( ) << >> ~ @endiliteral.
Expression excludes patternDecimalOrIntNumber.
Definition at line 770 of file ConstantDefinition.java.
|
static |
Complete pattern for floating point number, compatible and described in Double#valueOf(String).
Definition at line 750 of file ConstantDefinition.java.
|
static |
Complete pattern for floating point and integer number, covering patternDecimalNumber and patternIntegerNumber.
Definition at line 756 of file ConstantDefinition.java.
|
static |
Complete pattern for hexadecimal number, including an optional sign [+-] and optional suffixes [uUlL].
Definition at line 744 of file ConstantDefinition.java.
|
static |
Complete pattern for integer number, including an optional sign [+-] and optional suffixes [uUlL].
Definition at line 762 of file ConstantDefinition.java.
|
static |
Definition at line 55 of file ConstantDefinition.java.
|
static |
Definition at line 56 of file ConstantDefinition.java.