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[]
_tokenNames
static antlr.collections.impl.BitSet
_tokenSet_0
static antlr.collections.impl.BitSet
_tokenSet_1
static antlr.collections.impl.BitSet
_tokenSet_2
static antlr.collections.impl.BitSet
_tokenSet_3
static antlr.collections.impl.BitSet
_tokenSet_4
static String
ANONYMOUS_ENUM_NAME
Name 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 void
additiveExpr(antlr.collections.AST _t)
void
argExprList(antlr.collections.AST _t)
void
asm_expr(antlr.collections.AST _t)
void
assignExpr(antlr.collections.AST _t)
void
attributeDecl(antlr.collections.AST _t)
void
bitAndExpr(antlr.collections.AST _t)
void
castExpr(antlr.collections.AST _t)
protected void
charConst(antlr.collections.AST _t)
void
clearParsedFunctions()
Clears the list of functions this HeaderParser has parsed.void
commaExpr(antlr.collections.AST _t)
void
compoundStatement(antlr.collections.AST _t)
void
compoundStatementExpr(antlr.collections.AST _t)
void
conditionalExpr(antlr.collections.AST _t)
void
declaration(antlr.collections.AST _t)
void
declarationList(antlr.collections.AST _t)
String
declarator(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)
com.jogamp.gluegen.cgram.HeaderParser.TypeBox
declSpecifiers(antlr.collections.AST _t)
void
emptyExpr(antlr.collections.AST _t)
ConstantDefinition
enumerator(antlr.collections.AST _t, EnumType enumeration, ConstantDefinition defaultValue)
void
enumList(antlr.collections.AST _t, EnumType enumeration)
Type
enumSpecifier(antlr.collections.AST _t, int cvAttrs)
void
equalityExpr(antlr.collections.AST _t)
void
exclusiveOrExpr(antlr.collections.AST _t)
void
expr(antlr.collections.AST _t)
void
externalDef(antlr.collections.AST _t)
void
externalList(antlr.collections.AST _t)
protected void
floatConst(antlr.collections.AST _t)
void
functionDeclSpecifiers(antlr.collections.AST _t)
void
functionDef(antlr.collections.AST _t)
int
functionStorageClassSpecifier(antlr.collections.AST _t)
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.boolean
getDebug()
List<EnumType>
getEnums()
Returns the EnumTypes this HeaderParser processed.List<FunctionSymbol>
getParsedFunctions()
Returns the list of FunctionSymbols this HeaderParser has parsed.TypeDictionary
getStructDictionary()
Returns the struct name dictionary this HeaderParser uses.TypeDictionary
getTypedefDictionary()
Returns the typedef dictionary this HeaderParser uses.void
gnuAsmExpr(antlr.collections.AST _t)
void
idList(antlr.collections.AST _t)
void
inclusiveOrExpr(antlr.collections.AST _t)
void
initDecl(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)
void
initDeclList(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)
void
initializer(antlr.collections.AST _t)
void
initializerElementLabel(antlr.collections.AST _t)
void
initializerList(antlr.collections.AST _t)
protected void
intConst(antlr.collections.AST _t)
int
intConstExpr(antlr.collections.AST _t)
void
lcurlyInitializer(antlr.collections.AST _t)
void
localLabelDecl(antlr.collections.AST _t)
void
logicalAndExpr(antlr.collections.AST _t)
void
logicalOrExpr(antlr.collections.AST _t)
void
multExpr(antlr.collections.AST _t)
void
nonemptyAbstractDeclarator(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)
com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration
parameterDeclaration(antlr.collections.AST _t)
List<com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration>
parameterTypeList(antlr.collections.AST _t)
void
pointerGroup(antlr.collections.AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb)
void
postfixExpr(antlr.collections.AST _t)
void
primaryExpr(antlr.collections.AST _t)
void
rangeExpr(antlr.collections.AST _t)
void
relationalExpr(antlr.collections.AST _t)
void
setDebug(boolean debug)
void
setEnums(List<EnumType> enumTypes)
Pre-define the list of EnumTypes for this HeaderParser.void
setJavaConfiguration(JavaConfiguration cfg)
Set the configuration for this HeaderParser.void
setStructDictionary(TypeDictionary dict)
Set the dictionary mapping struct names (i.e., the "foo" in "struct foo { ...void
setTypedefDictionary(TypeDictionary dict)
Set the dictionary mapping typedef names to types for this HeaderParser.void
shiftExpr(antlr.collections.AST _t)
Type
specifierQualifierList(antlr.collections.AST _t)
void
statement(antlr.collections.AST _t)
void
statementBody(antlr.collections.AST _t)
void
statementList(antlr.collections.AST _t)
int
storageClassSpecifier(antlr.collections.AST _t)
protected void
stringConst(antlr.collections.AST _t)
void
strOptExprPair(antlr.collections.AST _t)
boolean
structDeclaration(antlr.collections.AST _t, CompoundType containingType)
boolean
structDeclarationList(antlr.collections.AST _t, CompoundType t)
boolean
structDeclarator(antlr.collections.AST _t, CompoundType containingType, Type t)
boolean
structDeclaratorList(antlr.collections.AST _t, CompoundType containingType, Type t)
CompoundType
structOrUnionBody(antlr.collections.AST _t, CompoundTypeKind kind, int cvAttrs)
Type
structSpecifier(antlr.collections.AST _t, int cvAttrs)
void
translationUnit(antlr.collections.AST _t)
Type
typedefName(antlr.collections.AST _t, int cvAttrs)
void
typelessDeclaration(antlr.collections.AST _t)
void
typeName(antlr.collections.AST _t)
int
typeQualifier(antlr.collections.AST _t)
Type
typeSpecifier(antlr.collections.AST _t, int attributes)
void
unaryExpr(antlr.collections.AST _t)
void
unaryOperator(antlr.collections.AST _t)
Type
unionSpecifier(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
-
-