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 Details

    • ANONYMOUS_ENUM_NAME

      public static final String ANONYMOUS_ENUM_NAME
      Name assigned to a anonymous EnumType (e.g., "enum { ... }").
      See Also:
    • _tokenNames

      public static final String[] _tokenNames
    • _tokenSet_0

      public static final BitSet _tokenSet_0
    • _tokenSet_1

      public static final BitSet _tokenSet_1
    • _tokenSet_2

      public static final BitSet _tokenSet_2
    • _tokenSet_3

      public static final BitSet _tokenSet_3
    • _tokenSet_4

      public static final BitSet _tokenSet_4
  • Constructor Details

    • HeaderParser

      public HeaderParser()
  • Method Details

    • 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.
    • getEnums

      public List<EnumType> getEnums()
      Returns the EnumTypes this HeaderParser processed.
    • 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(AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws RecognitionException
      Throws:
      RecognitionException
    • pointerGroup

      public final void pointerGroup(AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws RecognitionException
      Throws:
      RecognitionException
    • parameterTypeList

      public final List<com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration> parameterTypeList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • idList

      public final void idList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • expr

      public final void expr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • typelessDeclaration

      public final void typelessDeclaration(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • initDeclList

      public final void initDeclList(AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws RecognitionException
      Throws:
      RecognitionException
    • declaration

      public final void declaration(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • declSpecifiers

      public final com.jogamp.gluegen.cgram.HeaderParser.TypeBox declSpecifiers(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • parameterDeclaration

      public final com.jogamp.gluegen.cgram.HeaderParser.ParameterDeclaration parameterDeclaration(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • nonemptyAbstractDeclarator

      public final void nonemptyAbstractDeclarator(AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws RecognitionException
      Throws:
      RecognitionException
    • functionDef

      public final void functionDef(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • functionDeclSpecifiers

      public final void functionDeclSpecifiers(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • compoundStatement

      public final void compoundStatement(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • storageClassSpecifier

      public final int storageClassSpecifier(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • typeQualifier

      public final int typeQualifier(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • typeSpecifier

      public final Type typeSpecifier(AST _t, int attributes) throws RecognitionException
      Throws:
      RecognitionException
    • functionStorageClassSpecifier

      public final int functionStorageClassSpecifier(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • structSpecifier

      public final Type structSpecifier(AST _t, int cvAttrs) throws RecognitionException
      Throws:
      RecognitionException
    • attributeDecl

      public final void attributeDecl(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • unionSpecifier

      public final Type unionSpecifier(AST _t, int cvAttrs) throws RecognitionException
      Throws:
      RecognitionException
    • enumSpecifier

      public final Type enumSpecifier(AST _t, int cvAttrs) throws RecognitionException
      Throws:
      RecognitionException
    • typedefName

      public final Type typedefName(AST _t, int cvAttrs) throws RecognitionException
      Throws:
      RecognitionException
    • typeName

      public final void typeName(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • structOrUnionBody

      public final CompoundType structOrUnionBody(AST _t, CompoundTypeKind kind, int cvAttrs) throws RecognitionException
      Throws:
      RecognitionException
    • structDeclarationList

      public final boolean structDeclarationList(AST _t, CompoundType t) throws RecognitionException
      Throws:
      RecognitionException
    • structDeclaration

      public final boolean structDeclaration(AST _t, CompoundType containingType) throws RecognitionException
      Throws:
      RecognitionException
    • specifierQualifierList

      public final Type specifierQualifierList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • structDeclaratorList

      public final boolean structDeclaratorList(AST _t, CompoundType containingType, Type t) throws RecognitionException
      Throws:
      RecognitionException
    • structDeclarator

      public final boolean structDeclarator(AST _t, CompoundType containingType, Type t) throws RecognitionException
      Throws:
      RecognitionException
    • enumList

      public final void enumList(AST _t, EnumType enumeration) throws RecognitionException
      Throws:
      RecognitionException
    • enumerator

      public final ConstantDefinition enumerator(AST _t, EnumType enumeration, ConstantDefinition defaultValue) throws RecognitionException
      Throws:
      RecognitionException
    • initDecl

      public final void initDecl(AST _t, com.jogamp.gluegen.cgram.HeaderParser.TypeBox tb) throws RecognitionException
      Throws:
      RecognitionException
    • initializer

      public final void initializer(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • intConstExpr

      public final int intConstExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • translationUnit

      public final void translationUnit(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • externalList

      public final void externalList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • externalDef

      public final void externalDef(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • asm_expr

      public final void asm_expr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • initializerElementLabel

      public final void initializerElementLabel(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • lcurlyInitializer

      public final void lcurlyInitializer(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • initializerList

      public final void initializerList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • declarationList

      public final void declarationList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • localLabelDecl

      public final void localLabelDecl(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • statementList

      public final void statementList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • statement

      public final void statement(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • statementBody

      public final void statementBody(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • assignExpr

      public final void assignExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • conditionalExpr

      public final void conditionalExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • logicalOrExpr

      public final void logicalOrExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • logicalAndExpr

      public final void logicalAndExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • inclusiveOrExpr

      public final void inclusiveOrExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • exclusiveOrExpr

      public final void exclusiveOrExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • bitAndExpr

      public final void bitAndExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • equalityExpr

      public final void equalityExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • relationalExpr

      public final void relationalExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • shiftExpr

      public final void shiftExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • additiveExpr

      public final void additiveExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • multExpr

      public final void multExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • castExpr

      public final void castExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • unaryExpr

      public final void unaryExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • postfixExpr

      public final void postfixExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • primaryExpr

      public final void primaryExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • commaExpr

      public final void commaExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • emptyExpr

      public final void emptyExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • compoundStatementExpr

      public final void compoundStatementExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • rangeExpr

      public final void rangeExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • gnuAsmExpr

      public final void gnuAsmExpr(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • stringConst

      protected final void stringConst(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • strOptExprPair

      public final void strOptExprPair(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • unaryOperator

      public final void unaryOperator(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • argExprList

      public final void argExprList(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • charConst

      protected final void charConst(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • intConst

      protected final void intConst(AST _t) throws RecognitionException
      Throws:
      RecognitionException
    • floatConst

      protected final void floatConst(AST _t) throws RecognitionException
      Throws:
      RecognitionException