Package ghidra.app.util.cparser.CPP
Class PreProcessor
- java.lang.Object
-
- ghidra.app.util.cparser.CPP.PreProcessor
-
- All Implemented Interfaces:
PreProcessorConstants
public class PreProcessor extends java.lang.Object implements PreProcessorConstants
-
-
Field Summary
Fields Modifier and Type Field Description Token
jj_nt
Next token.Token
token
Current token.PreProcessorTokenManager
token_source
Generated Token Manager.-
Fields inherited from interface ghidra.app.util.cparser.CPP.PreProcessorConstants
__LT, _AND, _BLANKLINE, _CMT, _CMT0, _CMT11, _CMT3, _CMT4, _CMT5, _COD, _COD1, _COD2, _COD3, _COD4, _CODC, _COLON, _COMMENT, _CTRL, _ECMT10, _ECMT3, _ECMT5, _ECMT7, _ECMT8, _ECMT9, _EECMT7, _EECMT9, _EEECMT9, _ENDREL, _EQ, _EQT, _EQT1, _EWSP, _GE, _GT, _HEX, _INCCOD, _INCCP, _INCOP, _INCSTANDARD, _INCWSP, _LCMT, _LCMT0, _LCMT11, _LCMT20, _LCMT21, _LCMT4, _LCMT7, _LE, _LEADIN1, _LEADIN2, _LINECOMMENT, _LOG_AND, _LOG_OR, _LSH, _LT, _MACWSP, _MINUS, _MWSP, _NEQ, _OR, _PLUS, _QMARK, _QTE, _QTE0, _QTE1, _RSH, _TOEOL, _WSP, _WSP_INFO, _WSP0, _WSP1, _WSP2, _WSP3, _WSP4, _WSP5, _WSP6, _WSP7, _WSP8, _XSYM, _XSYMENDL, AND, BEGITEM, CMT, COD, COLON, COMMA, COMMENT, CONLINE, CONSTANT, CONSTITUENT, CONTARG, CP, DECIMAL_LITERAL, DEFAULT, DEFD, DEFINE, DEFINED, DIR, DIRECTIVE, DIRECTIVECOMMENT, DIRLINE, ECMT, EIFLINE, ELIF, ELSE, ENDCMT, ENDIF, ENDITEM, ENDL, ENDREL, EOF, EQ, ERRLINE, ERROR, ERROR_EXPRN, ESTD, EXPATH, EXPONENT, FP_LITERAL, FP_NUMERIC, GE, GT, HASINCLUDE, HASINCLUDENEXT, HEX_DIGIT, HEX_LITERAL, IF, IFDEF, IFDEF_EXPRN, IFDEFED, IFDLINE, IFNDEF, IFNDEF_EXPRN, IFNDEFED, IFNDLINE, IGNORETOEOL, INCDEF, INCLINE, INCLUDE, INFO, INFO_EXPRN, INFOLINE, INTEGER_LITERAL, ITEM, LE, LEADIN3, LINE, LINECOMMENT, LINEINFO, LINLINE, LOG_AND, LOG_OR, LSH, LT, MACEXPPATH, MACROARGS, MACROMV, MACRORV, MACROVALS, MACROVALS_COMMENT, MANIFEST, MCVLINE, MINUS, MOREARG, MOREVAL, MQUOTED_VAL, MQUOTED_VALUE, NEQ, NEWLINE, NOPAR, NOT, NOTCHR, NOTCMT, NOTCMTCOD, NOTENDL, NOTENDLC, NOTENDLSTAR, NOTVALCMT, NOTWQC, NOTWS, NOTWSQ, NOTWSQLT, NOTWWSQLT, NUMERIC, OCTAL_LITERAL, OP, OPTD, OPTIONED, OR, OTHER_TEXT, OUTER_TEXT, PLUS, PRAGMA, PRAGMA_EXPRN, PRGLINE, QMARK, QUOTED_TEXT, QUOTED_VAL, QUOTED_VALUE, REL, RELATIVE, RELPATH, RSH, RVALUES, RVALUES_COMMENT, RVSLINE, STANDARD, STARTCMT, STD, STDPATH, TIMES, tokenImage, UNDEFINE, UNDIR, UNDIRALL, UNDLINE, VALUES, WARNING, WARNING_EXPRN, WARNLINE, WS, WSP, XSYM, XSYMLINK, XSYMLINKPATH, XSYMPATH
-
-
Constructor Summary
Constructors Constructor Description PreProcessor()
PreProcessor(PreProcessorTokenManager tm)
Constructor with generated Token Manager.PreProcessor(java.io.InputStream stream)
Constructor with InputStream.PreProcessor(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encodingPreProcessor(java.io.Reader stream)
Constructor.PreProcessor(java.lang.String filename)
PreProcessor(java.lang.String[] args)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIncludePath(java.lang.String path)
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
And()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Assertion()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
CompoundAndExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
CompoundConditionalExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
CompoundOrExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
ConditionalExpression()
boolean
ControlLine()
java.lang.String
curFileStackTop()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Define()
void
disable_tracing()
Disable tracing.ghidra.app.util.cparser.CPP.PreProcessor.PPToken
ElIf()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Else()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
ElseIfCondition()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
ElseMark()
void
enable_tracing()
Enable tracing.ghidra.app.util.cparser.CPP.PreProcessor.PPToken
EndIf()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
EqualityExpression()
PPToken EqualityExpression() : {PPToken t,u,v;} { (t=RelationalExpression() ( LOOKAHEAD(2) u=EqualTo(){ if (verboseLevel()==7) print(u.image); } v=RelationalExpression(){ t.setTruth(t.compareTo(v)==0); if (verboseLevel()==7) print(": "); })* ){return t;} }ghidra.app.util.cparser.CPP.PreProcessor.PPToken
EqualTo()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Error()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Expression()
ParseException
generateParseException()
Generate ParseException.ghidra.app.util.cparser.CPP.PreProcessor.PPToken
getDef(ghidra.app.util.cparser.CPP.PreProcessor.PPToken def)
DefineTable
getDefinitions()
java.lang.Double
getDoubleValue(java.lang.String val)
Token
getNextToken()
Get the next Token.int
getNumericType(java.lang.String val)
Token
getToken(int index)
Get the specific Token.ghidra.app.util.cparser.CPP.PreProcessor.PPToken
GreaterThan()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
GreaterThanExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
GreaterThanOrEqual()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
GreaterThanOrEqualExpression()
boolean
Group()
boolean
GroupPart()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
If()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
IfCondition()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
IfDef()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
IfDefExpr()
boolean
IFGroup()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
IfNDef()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
IfNDefExpr()
boolean
IFSection()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Include()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
InEqualityExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Info()
void
Input()
boolean
isArg(ghidra.app.util.cparser.CPP.PreProcessor.PPToken arg)
boolean
isDef(ghidra.app.util.cparser.CPP.PreProcessor.PPToken def)
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LessExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LessThan()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LessThanOrEqual()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LessThanOrEqualExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LineInfo()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LogicalAndExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LogicalOrExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
LogNegation()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
MacroArgs()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
MacroVals()
static void
main(java.lang.String[] args)
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Negation()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
NewLines()
void
NoMas()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
NotEqualTo()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Or()
void
parse(java.lang.String filename)
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Pragma()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Qmark()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
QuotedText()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
QuotedValue()
void
ReInit(PreProcessorTokenManager tm)
Reinitialise.void
ReInit(java.io.InputStream stream)
Reinitialise.void
ReInit(java.io.InputStream stream, java.lang.String encoding)
Reinitialise.void
ReInit(java.io.Reader stream)
Reinitialise.ghidra.app.util.cparser.CPP.PreProcessor.PPToken
RelationalExpression()
void
setArgs(java.lang.String[] args)
void
setOutputStream(java.io.OutputStream fos)
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
SubtractFrom()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Text()
boolean
TranslationUnit()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
UnDef()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
ValueExpression()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Values()
int
verboseLevel()
ghidra.app.util.cparser.CPP.PreProcessor.PPToken
Warning()
-
-
-
Field Detail
-
token_source
public PreProcessorTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
PreProcessor
public PreProcessor(java.lang.String[] args) throws ParseException
- Throws:
ParseException
-
PreProcessor
public PreProcessor(java.lang.String filename) throws ParseException
- Throws:
ParseException
-
PreProcessor
public PreProcessor() throws ParseException
- Throws:
ParseException
-
PreProcessor
public PreProcessor(java.io.InputStream stream)
Constructor with InputStream.
-
PreProcessor
public PreProcessor(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encoding
-
PreProcessor
public PreProcessor(java.io.Reader stream)
Constructor.
-
PreProcessor
public PreProcessor(PreProcessorTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
verboseLevel
public int verboseLevel()
-
curFileStackTop
public java.lang.String curFileStackTop()
-
getDefinitions
public DefineTable getDefinitions()
-
getDef
public ghidra.app.util.cparser.CPP.PreProcessor.PPToken getDef(ghidra.app.util.cparser.CPP.PreProcessor.PPToken def)
-
isDef
public boolean isDef(ghidra.app.util.cparser.CPP.PreProcessor.PPToken def)
-
isArg
public boolean isArg(ghidra.app.util.cparser.CPP.PreProcessor.PPToken arg)
-
addIncludePath
public void addIncludePath(java.lang.String path)
-
getNumericType
public int getNumericType(java.lang.String val)
-
getDoubleValue
public java.lang.Double getDoubleValue(java.lang.String val)
-
setArgs
public void setArgs(java.lang.String[] args) throws ParseException
- Throws:
ParseException
-
setOutputStream
public void setOutputStream(java.io.OutputStream fos)
-
parse
public void parse(java.lang.String filename)
-
main
public static void main(java.lang.String[] args)
-
Input
public final void Input() throws ParseException
- Throws:
ParseException
-
TranslationUnit
public final boolean TranslationUnit() throws ParseException
- Throws:
ParseException
-
NoMas
public final void NoMas() throws ParseException
- Throws:
ParseException
-
Group
public final boolean Group() throws ParseException
- Throws:
ParseException
-
GroupPart
public final boolean GroupPart() throws ParseException
- Throws:
ParseException
-
ControlLine
public final boolean ControlLine() throws ParseException
- Throws:
ParseException
-
IFSection
public final boolean IFSection() throws ParseException
- Throws:
ParseException
-
IFGroup
public final boolean IFGroup() throws ParseException
- Throws:
ParseException
-
IfCondition
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken IfCondition() throws ParseException
- Throws:
ParseException
-
ElseIfCondition
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken ElseIfCondition() throws ParseException
- Throws:
ParseException
-
Include
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Include() throws ParseException
- Throws:
ParseException
-
LineInfo
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LineInfo() throws ParseException
- Throws:
ParseException
-
Define
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Define() throws ParseException
- Throws:
ParseException
-
UnDef
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken UnDef() throws ParseException
- Throws:
ParseException
-
MacroArgs
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken MacroArgs() throws ParseException
- Throws:
ParseException
-
MacroVals
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken MacroVals() throws ParseException
- Throws:
ParseException
-
Pragma
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Pragma() throws ParseException
- Throws:
ParseException
-
IfDef
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken IfDef() throws ParseException
- Throws:
ParseException
-
IfDefExpr
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken IfDefExpr() throws ParseException
- Throws:
ParseException
-
IfNDef
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken IfNDef() throws ParseException
- Throws:
ParseException
-
IfNDefExpr
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken IfNDefExpr() throws ParseException
- Throws:
ParseException
-
Error
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Error() throws ParseException
- Throws:
ParseException
-
Warning
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Warning() throws ParseException
- Throws:
ParseException
-
Info
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Info() throws ParseException
- Throws:
ParseException
-
EndIf
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken EndIf() throws ParseException
- Throws:
ParseException
-
Else
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Else() throws ParseException
- Throws:
ParseException
-
If
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken If() throws ParseException
- Throws:
ParseException
-
ElIf
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken ElIf() throws ParseException
- Throws:
ParseException
-
Values
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Values() throws ParseException
- Throws:
ParseException
-
QuotedValue
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken QuotedValue() throws ParseException
- Throws:
ParseException
-
Text
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Text() throws ParseException
- Throws:
ParseException
-
NewLines
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken NewLines() throws ParseException
- Throws:
ParseException
-
QuotedText
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken QuotedText() throws ParseException
- Throws:
ParseException
-
CompoundConditionalExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken CompoundConditionalExpression() throws ParseException
- Throws:
ParseException
-
CompoundAndExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken CompoundAndExpression() throws ParseException
- Throws:
ParseException
-
CompoundOrExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken CompoundOrExpression() throws ParseException
- Throws:
ParseException
-
ConditionalExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken ConditionalExpression() throws ParseException
- Throws:
ParseException
-
LogicalOrExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LogicalOrExpression() throws ParseException
- Throws:
ParseException
-
LogicalAndExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LogicalAndExpression() throws ParseException
- Throws:
ParseException
-
EqualityExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken EqualityExpression() throws ParseException
PPToken EqualityExpression() : {PPToken t,u,v;} { (t=RelationalExpression() ( LOOKAHEAD(2) u=EqualTo(){ if (verboseLevel()==7) print(u.image); } v=RelationalExpression(){ t.setTruth(t.compareTo(v)==0); if (verboseLevel()==7) print(": "); })* ){return t;} }- Throws:
ParseException
-
InEqualityExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken InEqualityExpression() throws ParseException
- Throws:
ParseException
-
RelationalExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken RelationalExpression() throws ParseException
- Throws:
ParseException
-
GreaterThanExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken GreaterThanExpression() throws ParseException
- Throws:
ParseException
-
GreaterThanOrEqualExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken GreaterThanOrEqualExpression() throws ParseException
- Throws:
ParseException
-
LessThanOrEqualExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LessThanOrEqualExpression() throws ParseException
- Throws:
ParseException
-
LessExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LessExpression() throws ParseException
- Throws:
ParseException
-
Or
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Or() throws ParseException
- Throws:
ParseException
-
And
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken And() throws ParseException
- Throws:
ParseException
-
EqualTo
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken EqualTo() throws ParseException
- Throws:
ParseException
-
NotEqualTo
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken NotEqualTo() throws ParseException
- Throws:
ParseException
-
LessThan
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LessThan() throws ParseException
- Throws:
ParseException
-
LessThanOrEqual
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LessThanOrEqual() throws ParseException
- Throws:
ParseException
-
GreaterThan
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken GreaterThan() throws ParseException
- Throws:
ParseException
-
GreaterThanOrEqual
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken GreaterThanOrEqual() throws ParseException
- Throws:
ParseException
-
Qmark
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Qmark() throws ParseException
- Throws:
ParseException
-
ElseMark
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken ElseMark() throws ParseException
- Throws:
ParseException
-
LogNegation
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken LogNegation() throws ParseException
- Throws:
ParseException
-
Negation
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Negation() throws ParseException
- Throws:
ParseException
-
Assertion
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Assertion() throws ParseException
- Throws:
ParseException
-
Expression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken Expression() throws ParseException
- Throws:
ParseException
-
SubtractFrom
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken SubtractFrom() throws ParseException
- Throws:
ParseException
-
ValueExpression
public final ghidra.app.util.cparser.CPP.PreProcessor.PPToken ValueExpression() throws ParseException
- Throws:
ParseException
-
ReInit
public void ReInit(java.io.InputStream stream)
Reinitialise.
-
ReInit
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
Reinitialise.
-
ReInit
public void ReInit(java.io.Reader stream)
Reinitialise.
-
ReInit
public void ReInit(PreProcessorTokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-