Package com.jogamp.gluegen.cgram
Class HeaderParser
- java.lang.Object
-
- antlr.TreeParser
-
- com.jogamp.gluegen.cgram.HeaderParser
-
- All Implemented Interfaces:
HeaderParserTokenTypes
public class HeaderParser extends antlr.TreeParser implements HeaderParserTokenTypes
-
-
Field Summary
Fields Modifier and Type Field Description static String[]_tokenNamesstatic antlr.collections.impl.BitSet_tokenSet_0static antlr.collections.impl.BitSet_tokenSet_1static antlr.collections.impl.BitSet_tokenSet_2static antlr.collections.impl.BitSet_tokenSet_3static antlr.collections.impl.BitSet_tokenSet_4static StringANONYMOUS_ENUM_NAMEName assigned to a anonymous EnumType (e.g., "enum { ...-
Fields inherited from class antlr.TreeParser
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth
-
Fields inherited from interface com.jogamp.gluegen.cgram.HeaderParserTokenTypes
ASSIGN, BadStringLiteral, BAND, BAND_ASSIGN, BNOT, BOR, BOR_ASSIGN, BXOR, BXOR_ASSIGN, CharLiteral, COLON, COMMA, Comment, CPPComment, DEC, DefineExpr, DefineExpr2, Digit, DIV, DIV_ASSIGN, DOT, DoubleDoubleConst, EOF, EQUAL, Escape, Exponent, FloatDoubleConst, FloatSuffix, GT, GTE, ID, INC, IntHexConst, IntIntConst, IntOctalConst, LAND, LBRACKET, LCURLY, LineDirective, LITERAL___alignof, LITERAL___attribute, LITERAL___complex, LITERAL___imag, LITERAL___label__, LITERAL___real, LITERAL_asm, LITERAL_auto, LITERAL_break, LITERAL_case, LITERAL_char, LITERAL_const, LITERAL_continue, LITERAL_default, LITERAL_do, LITERAL_double, LITERAL_else, LITERAL_enum, LITERAL_extern, LITERAL_float, LITERAL_for, LITERAL_goto, LITERAL_if, LITERAL_inline, LITERAL_int, LITERAL_intptr_t, LITERAL_long, LITERAL_ptrdiff_t, LITERAL_register, LITERAL_return, LITERAL_short, LITERAL_signed, LITERAL_size_t, LITERAL_sizeof, LITERAL_static, LITERAL_struct, LITERAL_switch, LITERAL_typedef, LITERAL_typeof, LITERAL_uintptr_t, LITERAL_union, LITERAL_unsigned, LITERAL_void, LITERAL_volatile, LITERAL_wchar_t, LITERAL_while, LNOT, LongDoubleConst, LongHexConst, LongIntConst, LongOctalConst, LongSuffix, LOR, LPAREN, LSHIFT, LSHIFT_ASSIGN, LT, LTE, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NAsmAttribute, NCast, NCommaExpr, NCompoundStatement, NDeclaration, NDeclarator, NEmptyExpression, NExpressionGroup, NFunctionCallArgs, NFunctionDef, NGnuAsmExpr, NInitDecl, NInitializer, NInitializerElementLabel, NLabel, NLcurlyInitializer, NNonemptyAbstractDeclarator, NonWhitespace, NOT_EQUAL, NParameterDeclaration, NParameterTypeList, NPointerGroup, NPostfixExpr, NRangeExpr, NStatementExpr, NStringSeq, NStructDeclarator, NTypedefName, NTypeMissing, NULL_TREE_LOOKAHEAD, Number, NUnaryExpr, PLUS, PLUS_ASSIGN, PREPROC_DIRECTIVE, PTR, QUESTION, RBRACKET, RCURLY, RPAREN, RSHIFT, RSHIFT_ASSIGN, SEMI, Space, STAR, STAR_ASSIGN, StringLiteral, UnsignedHexConst, UnsignedIntConst, UnsignedOctalConst, UnsignedSuffix, VARARGS, Vocabulary, Whitespace
-
-
Constructor Summary
Constructors Constructor Description HeaderParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadditiveExpr(antlr.collections.AST _t)voidargExprList(antlr.collections.AST _t)voidasm_expr(antlr.collections.AST _t)voidassignExpr(antlr.collections.AST _t)voidattributeDecl(antlr.collections.AST _t)voidbitAndExpr(antlr.collections.AST _t)voidcastExpr(antlr.collections.AST _t)protected voidcharConst(antlr.collections.AST _t)voidclearParsedFunctions()Clears the list of functions this HeaderParser has parsed.voidcommaExpr(antlr.collections.AST _t)voidcompoundStatement(antlr.collections.AST _t)voidcompoundStatementExpr(antlr.collections.AST _t)voidconditionalExpr(antlr.collections.AST _t)voiddeclaration(antlr.collections.AST _t)voiddeclarationList(antlr.collections.AST _t)Stringdeclarator(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)com.jogamp.gluegen.cgram.HeaderParser.TypeBoxdeclSpecifiers(antlr.collections.AST _t)voidemptyExpr(antlr.collections.AST _t)ConstantDefinitionenumerator(antlr.collections.AST _t, EnumType enumeration, ConstantDefinition defaultValue)voidenumList(antlr.collections.AST _t, EnumType enumeration)TypeenumSpecifier(antlr.collections.AST _t, int cvAttrs)voidequalityExpr(antlr.collections.AST _t)voidexclusiveOrExpr(antlr.collections.AST _t)voidexpr(antlr.collections.AST _t)voidexternalDef(antlr.collections.AST _t)voidexternalList(antlr.collections.AST _t)protected voidfloatConst(antlr.collections.AST _t)voidfunctionDeclSpecifiers(antlr.collections.AST _t)voidfunctionDef(antlr.collections.AST _t)intfunctionStorageClassSpecifier(antlr.collections.AST _t)MapgetCanonMap()Get the canonicalization map, which is a regular HashMap mapping Type to Type and which is used for looking up the unique instances of e.g.booleangetDebug()List<EnumType>getEnums()Returns the EnumTypes this HeaderParser processed.List<FunctionSymbol>getParsedFunctions()Returns the list of FunctionSymbols this HeaderParser has parsed.TypeDictionarygetStructDictionary()Returns the struct name dictionary this HeaderParser uses.TypeDictionarygetTypedefDictionary()Returns the typedef dictionary this HeaderParser uses.voidgnuAsmExpr(antlr.collections.AST _t)voididList(antlr.collections.AST _t)voidinclusiveOrExpr(antlr.collections.AST _t)voidinitDecl(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)voidinitDeclList(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)voidinitializer(antlr.collections.AST _t)voidinitializerElementLabel(antlr.collections.AST _t)voidinitializerList(antlr.collections.AST _t)protected voidintConst(antlr.collections.AST _t)intintConstExpr(antlr.collections.AST _t)voidlcurlyInitializer(antlr.collections.AST _t)voidlocalLabelDecl(antlr.collections.AST _t)voidlogicalAndExpr(antlr.collections.AST _t)voidlogicalOrExpr(antlr.collections.AST _t)voidmultExpr(antlr.collections.AST _t)voidnonemptyAbstractDeclarator(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclarationparameterDeclaration(antlr.collections.AST _t)List<com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration>parameterTypeList(antlr.collections.AST _t)voidpointerGroup(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)voidpostfixExpr(antlr.collections.AST _t)voidprimaryExpr(antlr.collections.AST _t)voidrangeExpr(antlr.collections.AST _t)voidrelationalExpr(antlr.collections.AST _t)voidsetDebug(boolean debug)voidsetEnums(List<EnumType> enumTypes)Pre-define the list of EnumTypes for this HeaderParser.voidsetJavaConfiguration(JavaConfiguration cfg)Set the configuration for this HeaderParser.voidsetStructDictionary(TypeDictionary dict)Set the dictionary mapping struct names (i.e., the "foo" in "struct foo { ...voidsetTypedefDictionary(TypeDictionary dict)Set the dictionary mapping typedef names to types for this HeaderParser.voidshiftExpr(antlr.collections.AST _t)TypespecifierQualifierList(antlr.collections.AST _t)voidstatement(antlr.collections.AST _t)voidstatementBody(antlr.collections.AST _t)voidstatementList(antlr.collections.AST _t)intstorageClassSpecifier(antlr.collections.AST _t)protected voidstringConst(antlr.collections.AST _t)voidstrOptExprPair(antlr.collections.AST _t)booleanstructDeclaration(antlr.collections.AST _t, CompoundType containingType)booleanstructDeclarationList(antlr.collections.AST _t, CompoundType t)booleanstructDeclarator(antlr.collections.AST _t, CompoundType containingType, Type t)booleanstructDeclaratorList(antlr.collections.AST _t, CompoundType containingType, Type t)CompoundTypestructOrUnionBody(antlr.collections.AST _t, CompoundTypeKind kind, int cvAttrs)TypestructSpecifier(antlr.collections.AST _t, int cvAttrs)voidtranslationUnit(antlr.collections.AST _t)TypetypedefName(antlr.collections.AST _t, int cvAttrs)voidtypelessDeclaration(antlr.collections.AST _t)voidtypeName(antlr.collections.AST _t)inttypeQualifier(antlr.collections.AST _t)TypetypeSpecifier(antlr.collections.AST _t, int attributes)voidunaryExpr(antlr.collections.AST _t)voidunaryOperator(antlr.collections.AST _t)TypeunionSpecifier(antlr.collections.AST _t, int cvAttrs)
-
-
-
Field Detail
-
ANONYMOUS_ENUM_NAME
public static final String ANONYMOUS_ENUM_NAME
Name assigned to a anonymous EnumType (e.g., "enum { ... }").- See Also:
- Constant Field Values
-
_tokenNames
public static final String[] _tokenNames
-
_tokenSet_0
public static final antlr.collections.impl.BitSet _tokenSet_0
-
_tokenSet_1
public static final antlr.collections.impl.BitSet _tokenSet_1
-
_tokenSet_2
public static final antlr.collections.impl.BitSet _tokenSet_2
-
_tokenSet_3
public static final antlr.collections.impl.BitSet _tokenSet_3
-
_tokenSet_4
public static final antlr.collections.impl.BitSet _tokenSet_4
-
-
Method Detail
-
getDebug
public boolean getDebug()
-
setDebug
public void setDebug(boolean debug)
-
setJavaConfiguration
public void setJavaConfiguration(JavaConfiguration cfg)
Set the configuration for this HeaderParser. Must be done before parsing.
-
setTypedefDictionary
public void setTypedefDictionary(TypeDictionary dict)
Set the dictionary mapping typedef names to types for this HeaderParser. Must be done before parsing.
-
getTypedefDictionary
public TypeDictionary getTypedefDictionary()
Returns the typedef dictionary this HeaderParser uses.
-
setStructDictionary
public void setStructDictionary(TypeDictionary dict)
Set the dictionary mapping struct names (i.e., the "foo" in "struct foo { ... };") to types for this HeaderParser. Must be done before parsing.
-
getStructDictionary
public TypeDictionary getStructDictionary()
Returns the struct name dictionary this HeaderParser uses.
-
getCanonMap
public Map getCanonMap()
Get the canonicalization map, which is a regular HashMap mapping Type to Type and which is used for looking up the unique instances of e.g. pointer-to-structure types that have been typedefed and therefore have names.
-
setEnums
public void setEnums(List<EnumType> enumTypes)
Pre-define the list of EnumTypes for this HeaderParser. Must be done before parsing.
-
clearParsedFunctions
public void clearParsedFunctions()
Clears the list of functions this HeaderParser has parsed. Useful when reusing the same HeaderParser for more than one header file.
-
getParsedFunctions
public List<FunctionSymbol> getParsedFunctions()
Returns the list of FunctionSymbols this HeaderParser has parsed.
-
declarator
public final String declarator(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
pointerGroup
public final void pointerGroup(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
parameterTypeList
public final List<com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration> parameterTypeList(antlr.collections.AST _t) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
idList
public final void idList(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
expr
public final void expr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
typelessDeclaration
public final void typelessDeclaration(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
initDeclList
public final void initDeclList(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
declaration
public final void declaration(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
declSpecifiers
public final com.jogamp.gluegen.cgram.HeaderParser.TypeBox declSpecifiers(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
parameterDeclaration
public final com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration parameterDeclaration(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
nonemptyAbstractDeclarator
public final void nonemptyAbstractDeclarator(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
functionDef
public final void functionDef(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
functionDeclSpecifiers
public final void functionDeclSpecifiers(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
compoundStatement
public final void compoundStatement(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
storageClassSpecifier
public final int storageClassSpecifier(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
typeQualifier
public final int typeQualifier(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
typeSpecifier
public final Type typeSpecifier(antlr.collections.AST _t, int attributes) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
functionStorageClassSpecifier
public final int functionStorageClassSpecifier(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
structSpecifier
public final Type structSpecifier(antlr.collections.AST _t, int cvAttrs) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
attributeDecl
public final void attributeDecl(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
unionSpecifier
public final Type unionSpecifier(antlr.collections.AST _t, int cvAttrs) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
enumSpecifier
public final Type enumSpecifier(antlr.collections.AST _t, int cvAttrs) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
typedefName
public final Type typedefName(antlr.collections.AST _t, int cvAttrs) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
typeName
public final void typeName(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
structOrUnionBody
public final CompoundType structOrUnionBody(antlr.collections.AST _t, CompoundTypeKind kind, int cvAttrs) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
structDeclarationList
public final boolean structDeclarationList(antlr.collections.AST _t, CompoundType t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
structDeclaration
public final boolean structDeclaration(antlr.collections.AST _t, CompoundType containingType) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
specifierQualifierList
public final Type specifierQualifierList(antlr.collections.AST _t) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
structDeclaratorList
public final boolean structDeclaratorList(antlr.collections.AST _t, CompoundType containingType, Type t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
structDeclarator
public final boolean structDeclarator(antlr.collections.AST _t, CompoundType containingType, Type t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
enumList
public final void enumList(antlr.collections.AST _t, EnumType enumeration) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
enumerator
public final ConstantDefinition enumerator(antlr.collections.AST _t, EnumType enumeration, ConstantDefinition defaultValue) throws antlr.RecognitionException
- Throws:
antlr.RecognitionException
-
initDecl
public final void initDecl(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
initializer
public final void initializer(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
intConstExpr
public final int intConstExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
translationUnit
public final void translationUnit(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
externalList
public final void externalList(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
externalDef
public final void externalDef(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
asm_expr
public final void asm_expr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
initializerElementLabel
public final void initializerElementLabel(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
lcurlyInitializer
public final void lcurlyInitializer(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
initializerList
public final void initializerList(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
declarationList
public final void declarationList(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
localLabelDecl
public final void localLabelDecl(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
statementList
public final void statementList(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
statement
public final void statement(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
statementBody
public final void statementBody(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
assignExpr
public final void assignExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
conditionalExpr
public final void conditionalExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
logicalOrExpr
public final void logicalOrExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
logicalAndExpr
public final void logicalAndExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
inclusiveOrExpr
public final void inclusiveOrExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
exclusiveOrExpr
public final void exclusiveOrExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
bitAndExpr
public final void bitAndExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
equalityExpr
public final void equalityExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
relationalExpr
public final void relationalExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
shiftExpr
public final void shiftExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
additiveExpr
public final void additiveExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
multExpr
public final void multExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
castExpr
public final void castExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
unaryExpr
public final void unaryExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
postfixExpr
public final void postfixExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
primaryExpr
public final void primaryExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
commaExpr
public final void commaExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
emptyExpr
public final void emptyExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
compoundStatementExpr
public final void compoundStatementExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
rangeExpr
public final void rangeExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
gnuAsmExpr
public final void gnuAsmExpr(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
stringConst
protected final void stringConst(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
strOptExprPair
public final void strOptExprPair(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
unaryOperator
public final void unaryOperator(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
argExprList
public final void argExprList(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
charConst
protected final void charConst(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
intConst
protected final void intConst(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
floatConst
protected final void floatConst(antlr.collections.AST _t) throws antlr.RecognitionException- Throws:
antlr.RecognitionException
-
-