Package ghidra.app.util.cparser.C
Class CParser
java.lang.Object
ghidra.app.util.cparser.C.CParser
- All Implemented Interfaces:
CParserConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface ghidra.app.util.cparser.C.CParserConstants
ALIGNAS, ALIGNOF, ASM, ASM_SEMI, ASMBLOCK, ASMBLOCKB, ASMBLOCKP, ATTRIBUTE, AUTO, BOOL, BREAK, CASE, CDECL, CHAR, CHARACTER_LITERAL, CONST, CONTINUE, DECIMAL_LITERAL, DECLSPEC, DEFAULT, DFLT, DIGIT, DO, DOUBLE, ELSE, ENUM, EOF, EXPONENT, EXTENSION, EXTERN, FAR, FASTCALL, FLOAT, FLOATING_POINT_LITERAL, FOR, GOTO, HEX_LITERAL, IDENTIFIER, IF, INLINE, INT, INT16, INT32, INT64, INT8, INTEGER_LITERAL, INTERFACE, LETTER, LINE, LINEALT, LINEBLOCK, LINENUMBER_LITERAL, LONG, NEAR, NORETURN, OBJC, OBJC_DIGIT, OBJC_IDENTIFIER, OBJC_IGNORE, OBJC_LETTER, OBJC_SEMI, OBJC2, OBJC2_END, OBJC2_IGNORE, OCTAL_LITERAL, PACKED, PASCALCALL, PATH_LITERAL, PCLOSE, PCOLON, PCOMMA, PDECIMAL_LITERAL, PDIGIT, PHEX_LITERAL, PIDENTIFIER, PINTEGER_LITERAL, PLETTER, PMINUS, POCTAL_LITERAL, POPEN, PPLUS, PRAGMA, PRAGMA_FUNC, PRAGMALINE, PROTOCOL, PSTAR, PSTRING_LITERAL, PTR32, PTR64, QUOTE_C, READABLETO, REGISTER, RESTRICT, RETURN, RUSTCALL, SHORT, SIGNED, SIZEOF, STATIC, STATICASSERT, STDCALL, STRING_LITERAL, STRUCT, SWITCH, THREADLOCAL, tokenImage, TYPEDEF, UNALIGNED, UNION, UNSIGNED, VECTORCALL, VOID, VOLATILE, W64, WHILE -
Constructor Summary
ConstructorsConstructorDescriptionCParser()Constructor with generated Token Manager.CParser(DataTypeManager dtmgr) CParser(DataTypeManager dtmgr, boolean storeDataType, DataTypeManager[] subDTMgrs) CParser(InputStream stream) Constructor with InputStream.CParser(InputStream stream, String encoding) Constructor with InputStream and supplied encodingConstructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal Declarationfinal Objectfinal voidfinal Objectfinal voidfinal voidAsmLine()final voidfinal Objectfinal voidfinal voidAttributeList(Declaration dec) final voidAttributeSpec(Declaration dec) final voidfinal voidfinal Declarationfinal Declarationfinal Objectfinal voidfinal Objectfinal ObjectConstant()final Objectfinal Declarationfinal voidfinal DeclarationDeclarationSpecifiers(Declaration specDT) final DeclarationDeclarator(Declaration dt, DataType container) final voidfinal voidDeclSpec(Declaration dec) final voidDeclSpecifier(Declaration dec) final voidfinal voidfinal voidbooleanfinal Declarationfinal DeclarationDirectDeclarator(Declaration dt, DataType container) final voidDisable tracing.final voidEnable tracing.final intEnumerator(ArrayList<ghidra.app.util.cparser.C.CParser.EnumMember> list, int value) final ArrayList<ghidra.app.util.cparser.C.CParser.EnumMember> final DataTypefinal Objectfinal Objectfinal Objectfinal voidfinal voidfinal voidGenerate ParseException.Get composite definitionsGet the data type managerGet Global variable declarationsgetEnums()Get Defined EnumerationsGet Function signaturesfinal TokenGet the next Token.final TokengetToken(int index) Get the specific Token.getTypes()Get Type definitionsfinal voidIdentifierList(FunctionDefinitionDataType funcDT, DataType retDT) final Objectfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidfinal voidLineDef()final Objectfinal Objectstatic voidfinal Tokenfinal Objectfinal DataTypeObjcDef()final voidfinal ArrayList<Declaration> final DeclarationParameterTypeList(FunctionDefinitionDataType funcDT, DataType retDT) voidparse(InputStream fis) final DeclarationPointer(Declaration dec) final Objectfinal Tokenfinal voidfinal voidfinal ObjectvoidReinitialise.voidReInit(InputStream stream) Reinitialise.voidReInit(InputStream stream, String encoding) Reinitialise.voidReinitialise.final Objectfinal voidvoidsetMonitor(TaskMonitor monitor) voidsetParseFileName(String fName) final Objectfinal Declarationfinal voidfinal voidfinal voidfinal DeclarationStorageClassSpecifier(Declaration specDT) final voidStructDeclaration(Composite comp, CompositeHandler compositeHandler) final voidfinal voidStructDeclarator(Declaration dt, Composite comp, CompositeHandler compositeHandler) final voidStructDeclaratorList(Declaration dt, Composite comp, CompositeHandler compositeHandler) final Compositefinal DataTypefinal voidSubIdent(Declaration dec) final voidfinal DataTypefinal DeclarationTypeName()final DeclarationTypeQualifier(Declaration dec) final Declarationfinal DeclarationTypeSpecifier(Declaration dec) final Objectfinal void
-
Field Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token.
-
-
Constructor Details
-
CParser
public CParser() -
CParser
-
CParser
-
CParser
Constructor with InputStream. -
CParser
Constructor with InputStream and supplied encoding -
CParser
Constructor. -
CParser
Constructor with generated Token Manager.
-
-
Method Details
-
setParseFileName
-
getParseMessages
-
didParseSucceed
public boolean didParseSucceed() -
setMonitor
-
getDataTypeManager
Get the data type manager- Returns:
-
getLastDataType
- Returns:
- the last data type parsed
-
getDeclarations
Get Global variable declarations- Returns:
-
getEnums
Get Defined Enumerations- Returns:
- Defined enumeration names
-
getFunctions
Get Function signatures- Returns:
- Function signatures
-
getComposites
Get composite definitions- Returns:
- Composite (structure/union) definitions
-
getTypes
Get Type definitions- Returns:
- Type definitions
-
parse
- Throws:
ParseException
-
parse
- Throws:
ParseException
-
main
-
TranslationUnit
- Throws:
ParseException
-
ExternalDeclaration
- Throws:
ParseException
-
LineDef
- Throws:
ParseException
-
ObjcDef
- Throws:
ParseException
-
FunctionDefinition
- Throws:
ParseException
-
Declaration
- Throws:
ParseException
-
DeclarationList
- Throws:
ParseException
-
DeclarationSpecifiers
- Throws:
ParseException
-
StorageClassSpecifier
- Throws:
ParseException
-
BuiltInTypeSpecifier
- Throws:
ParseException
-
BuiltInDeclarationSpecifier
- Throws:
ParseException
-
TypeSpecifier
- Throws:
ParseException
-
TypeQualifier
- Throws:
ParseException
-
AttributeSpec
- Throws:
ParseException
-
AlignmentSpecifier
- Throws:
ParseException
-
AttributeList
- Throws:
ParseException
-
AttributeToken
- Throws:
ParseException
-
AttributeSpecList
- Throws:
ParseException
-
SubIdent
- Throws:
ParseException
-
DeclSpec
- Throws:
ParseException
-
DeclSpecifier
- Throws:
ParseException
-
DeclConstant
- Throws:
ParseException
-
MultiLineString
- Throws:
ParseException
-
PragmaSpec
- Throws:
ParseException
-
PragmaSpecifier
- Throws:
ParseException
-
PragmaConstant
- Throws:
ParseException
-
StaticAssert
- Throws:
ParseException
-
StructOrUnionSpecifier
- Throws:
ParseException
-
StructOrUnion
- Throws:
ParseException
-
StructDeclarationList
- Throws:
ParseException
-
InitDeclaratorList
- Throws:
ParseException
-
InitDeclarator
- Throws:
ParseException
-
StructDeclaration
public final void StructDeclaration(Composite comp, CompositeHandler compositeHandler) throws ParseException - Throws:
ParseException
-
SpecifierQualifierList
- Throws:
ParseException
-
StructDeclaratorList
public final void StructDeclaratorList(Declaration dt, Composite comp, CompositeHandler compositeHandler) throws ParseException - Throws:
ParseException
-
StructDeclarator
public final void StructDeclarator(Declaration dt, Composite comp, CompositeHandler compositeHandler) throws ParseException - Throws:
ParseException
-
EnumSpecifier
- Throws:
ParseException
-
EnumeratorList
public final ArrayList<ghidra.app.util.cparser.C.CParser.EnumMember> EnumeratorList() throws ParseException- Throws:
ParseException
-
Enumerator
public final int Enumerator(ArrayList<ghidra.app.util.cparser.C.CParser.EnumMember> list, int value) throws ParseException - Throws:
ParseException
-
Declarator
- Throws:
ParseException
-
DirectDeclarator
- Throws:
ParseException
-
Pointer
- Throws:
ParseException
-
TypeQualifierList
- Throws:
ParseException
-
ParameterTypeList
public final Declaration ParameterTypeList(FunctionDefinitionDataType funcDT, DataType retDT) throws ParseException - Throws:
ParseException
-
ParameterList
- Throws:
ParseException
-
ParameterDeclaration
- Throws:
ParseException
-
IdentifierList
public final void IdentifierList(FunctionDefinitionDataType funcDT, DataType retDT) throws ParseException - Throws:
ParseException
-
Initializer
- Throws:
ParseException
-
InitializerList
- Throws:
ParseException
-
Designation
- Throws:
ParseException
-
DesignatorList
- Throws:
ParseException
-
Designator
- Throws:
ParseException
-
TypeName
- Throws:
ParseException
-
AbstractDeclarator
- Throws:
ParseException
-
DirectAbstractDeclarator
- Throws:
ParseException
-
TypedefName
- Throws:
ParseException
-
Statement
- Throws:
ParseException
-
LabeledStatement
- Throws:
ParseException
-
ExpressionStatement
- Throws:
ParseException
-
CompoundStatement
- Throws:
ParseException
-
StatementList
- Throws:
ParseException
-
AsmStatement
- Throws:
ParseException
-
AsmLine
- Throws:
ParseException
-
SelectionStatement
- Throws:
ParseException
-
IterationStatement
- Throws:
ParseException
-
JumpStatement
- Throws:
ParseException
-
Expression
- Throws:
ParseException
-
AssignmentExpression
- Throws:
ParseException
-
AssignmentOperator
- Throws:
ParseException
-
ConditionalExpression
- Throws:
ParseException
-
ConstantExpression
- Throws:
ParseException
-
LogicalORExpression
- Throws:
ParseException
-
LogicalANDExpression
- Throws:
ParseException
-
InclusiveORExpression
- Throws:
ParseException
-
ExclusiveORExpression
- Throws:
ParseException
-
ANDExpression
- Throws:
ParseException
-
EqualityExpression
- Throws:
ParseException
-
RelationalExpression
- Throws:
ParseException
-
ShiftExpression
- Throws:
ParseException
-
AdditiveExpression
- Throws:
ParseException
-
MultiplicativeExpression
- Throws:
ParseException
-
CastExpression
- Throws:
ParseException
-
UnaryExpression
- Throws:
ParseException
-
UnaryOperator
- Throws:
ParseException
-
PostfixExpression
- Throws:
ParseException
-
PrimaryExpression
- Throws:
ParseException
-
ArgumentExpressionList
- Throws:
ParseException
-
Constant
- Throws:
ParseException
-
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
ReInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
generateParseException
Generate ParseException. -
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-