Package ghidra.app.util.cparser.C
Class CParser
java.lang.Object
ghidra.app.util.cparser.C.CParser
- All Implemented Interfaces:
CParserConstants
-
Field Summary
Modifier 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, 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, SHORT, SIGNED, SIZEOF, STATIC, STATICASSERT, STDCALL, STRING_LITERAL, STRUCT, SWITCH, THREADLOCAL, tokenImage, TYPEDEF, UNALIGNED, UNION, UNSIGNED, VOID, VOLATILE, W64, WHILE
-
Constructor Summary
ConstructorDescriptionCParser()
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 Declaration
final Object
final void
final Object
final void
final void
AsmLine()
final void
final Object
final void
final void
AttributeList
(Declaration dec) final void
AttributeSpec
(Declaration dec) final void
final void
final Declaration
final Declaration
final Object
final void
final Object
final Object
Constant()
final Object
final Declaration
final void
final Declaration
DeclarationSpecifiers
(Declaration specDT) final Declaration
Declarator
(Declaration dt, DataType container) final void
final void
DeclSpec
(Declaration dec) final void
DeclSpecifier
(Declaration dec) final void
final void
final void
boolean
final Declaration
final Declaration
DirectDeclarator
(Declaration dt, DataType container) final void
Disable tracing.final void
Enable tracing.final int
Enumerator
(ArrayList<ghidra.app.util.cparser.C.CParser.EnumMember> list, int value) final ArrayList
<ghidra.app.util.cparser.C.CParser.EnumMember> final DataType
final Object
final Object
final Object
final void
final void
final void
Generate ParseException.Get composite definitionsGet the data type managerGet Global variable declarationsgetEnums()
Get Defined EnumerationsGet Function signaturesfinal Token
Get the next Token.final Token
getToken
(int index) Get the specific Token.getTypes()
Get Type definitionsfinal void
IdentifierList
(FunctionDefinitionDataType funcDT, DataType retDT) final Object
final void
final void
final void
final void
final void
final void
final void
final void
LineDef()
final Object
final Object
static void
final Token
final Object
final DataType
ObjcDef()
final void
final ArrayList
<Declaration> final Declaration
ParameterTypeList
(FunctionDefinitionDataType funcDT, DataType retDT) void
parse
(InputStream fis) final Declaration
Pointer
(Declaration dec) final Object
final Token
final void
final void
final Object
void
Reinitialise.void
ReInit
(InputStream stream) Reinitialise.void
ReInit
(InputStream stream, String encoding) Reinitialise.void
Reinitialise.final Object
final void
void
setMonitor
(TaskMonitor monitor) void
setParseFileName
(String fName) final Object
final Declaration
final void
final void
final void
final Declaration
StorageClassSpecifier
(Declaration specDT) final void
StructDeclaration
(Composite comp, CompositeHandler compositeHandler) final void
final void
StructDeclarator
(Declaration dt, Composite comp, CompositeHandler compositeHandler) final void
StructDeclaratorList
(Declaration dt, Composite comp, CompositeHandler compositeHandler) final Composite
final DataType
final void
SubIdent
(Declaration dec) final void
final DataType
final Declaration
TypeName()
final Declaration
TypeQualifier
(Declaration dec) final Declaration
final Declaration
TypeSpecifier
(Declaration dec) final Object
final 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.
-