cprover
|
#include <cpp_token_buffer.h>
Public Types | |
typedef unsigned int | post |
Public Member Functions | |
cpp_token_buffert () | |
int | LookAhead (unsigned offset) |
int | get_token (cpp_tokent &token) |
int | get_token () |
int | LookAhead (unsigned offset, cpp_tokent &token) |
post | Save () |
void | Restore (post pos) |
void | Replace (const cpp_tokent &token) |
void | Insert (const cpp_tokent &token) |
void | clear () |
cpp_tokent & | current_token () |
Protected Types | |
typedef std::list< cpp_tokent > | tokenst |
Protected Member Functions | |
void | read_token () |
Protected Attributes | |
tokenst | tokens |
std::vector< tokenst::iterator > | token_vector |
post | current_pos |
Definition at line 21 of file cpp_token_buffer.h.
typedef unsigned int cpp_token_buffert::post |
Definition at line 28 of file cpp_token_buffer.h.
|
protected |
Definition at line 55 of file cpp_token_buffer.h.
|
inline |
Definition at line 24 of file cpp_token_buffer.h.
|
inline |
Definition at line 40 of file cpp_token_buffer.h.
References current_pos, token_vector, and tokens.
Referenced by cpp_parsert::clear().
|
inline |
Definition at line 48 of file cpp_token_buffer.h.
References PRECONDITION, and tokens.
Referenced by cpp_parsert::add_location(), cpp_parsert::current_token(), and Parser::rPrimaryExpr().
int cpp_token_buffert::get_token | ( | cpp_tokent & | token | ) |
Definition at line 31 of file cpp_token_buffer.cpp.
References current_pos, cpp_tokent::kind, read_token(), and token_vector.
Referenced by Parser::optAlignas(), Parser::optAttribute(), Parser::optCvQualify(), Parser::optIntegralTypeOrClassSpec(), Parser::optMemberSpec(), Parser::optPtrOperator(), Parser::optStorageSpec(), Parser::optThrowDecl(), Parser::rAccessDecl(), Parser::rAdditiveExpr(), Parser::rAlignofExpr(), Parser::rAllocateExpr(), Parser::rAllocateInitializer(), Parser::rAllocateType(), Parser::rAndExpr(), Parser::rArgDeclaration(), Parser::rArgDeclList(), Parser::rAttribute(), Parser::rBaseSpecifiers(), Parser::rCastExpr(), Parser::rClassBody(), Parser::rClassMember(), Parser::rClassSpec(), Parser::rCommaExpression(), Parser::rCompoundStatement(), Parser::rConditionalExpr(), Parser::rConstDeclaration(), Parser::rConstructorDecl(), Parser::rDeclarator(), Parser::rDeclaratorQualifier(), Parser::rDeclarators(), Parser::rDeclaratorWithInit(), Parser::rDoStatement(), Parser::rEnumBody(), Parser::rEnumSpec(), Parser::rEqualityExpr(), Parser::rExclusiveOrExpr(), Parser::rExpression(), Parser::rExprStatement(), Parser::rExternTemplateDecl(), Parser::rForStatement(), Parser::rFunctionArguments(), Parser::rFunctionBody(), Parser::rGCCAsmStatement(), Parser::rIfStatement(), Parser::rInclusiveOrExpr(), Parser::rInitializeExpr(), Parser::rIntegralDeclaration(), Parser::rIntegralDeclStatement(), Parser::rLinkageBody(), Parser::rLinkageSpec(), Parser::rLogicalAndExpr(), Parser::rLogicalOrExpr(), Parser::rMemberInit(), Parser::rMemberInitializers(), Parser::rMSC_if_existsExpr(), Parser::rMSC_if_existsStatement(), Parser::rMSC_leaveStatement(), Parser::rMSC_tryStatement(), Parser::rMSCAsmStatement(), Parser::rMSCuuidof(), Parser::rMultiplyExpr(), Parser::rName(), Parser::rNamespaceSpec(), Parser::rNewDeclarator(), Parser::rNoexceptExpr(), Parser::rNullDeclaration(), Parser::rOperatorName(), Parser::rOtherDeclaration(), Parser::rOtherDeclStatement(), Parser::rPmExpr(), Parser::rPostfixExpr(), Parser::rPrimaryExpr(), Parser::rProgram(), Parser::rPtrToMember(), Parser::rRelationalExpr(), Parser::rShiftExpr(), Parser::rSimpleDeclaration(), Parser::rSizeofExpr(), Parser::rStatement(), Parser::rStaticAssert(), Parser::rString(), Parser::rSwitchStatement(), Parser::rTempArgDeclaration(), Parser::rTempArgList(), Parser::rTemplateArgs(), Parser::rTemplateDecl2(), Parser::rThrowExpr(), Parser::rTryStatement(), Parser::rTypedef(), Parser::rTypedefUsing(), Parser::rTypeidExpr(), Parser::rTypeNameOrFunctionType(), Parser::rTypePredicate(), Parser::rUnaryExpr(), Parser::rUsing(), Parser::rVarNameCore(), Parser::rWhileStatement(), and Parser::SkipTo().
int cpp_token_buffert::get_token | ( | ) |
Definition at line 45 of file cpp_token_buffer.cpp.
References current_pos, read_token(), and token_vector.
void cpp_token_buffert::Insert | ( | const cpp_tokent & | token | ) |
Definition at line 121 of file cpp_token_buffer.cpp.
References current_pos, token_vector, and tokens.
Referenced by Parser::rTemplateArgs().
int cpp_token_buffert::LookAhead | ( | unsigned | offset | ) |
Definition at line 19 of file cpp_token_buffer.cpp.
References current_pos, read_token(), and token_vector.
Referenced by Parser::isAllocateExpr(), Parser::isConstructorDecl(), Parser::isPtrToMember(), Parser::isTypeSpecifier(), Parser::maybeTemplateArgs(), Parser::moreVarName(), Parser::optAlignas(), Parser::optAttribute(), Parser::optCvQualify(), Parser::optIntegralTypeOrClassSpec(), Parser::optMemberSpec(), Parser::optPtrOperator(), Parser::optStorageSpec(), Parser::optThrowDecl(), Parser::rAdditiveExpr(), Parser::rAllocateExpr(), Parser::rAllocateInitializer(), Parser::rAllocateType(), Parser::rAndExpr(), Parser::rArgDeclaration(), Parser::rArgDeclList(), Parser::rArgDeclListOrInit(), Parser::rAttribute(), Parser::rBaseSpecifiers(), Parser::rCastExpr(), Parser::rClassBody(), Parser::rClassMember(), Parser::rClassSpec(), Parser::rCommaExpression(), Parser::rCompoundStatement(), Parser::rConditionalExpr(), Parser::rConstDeclaration(), Parser::rConstructorDecl(), Parser::rDeclaration(), Parser::rDeclarationStatement(), Parser::rDeclarator(), Parser::rDeclaratorQualifier(), Parser::rDeclarators(), Parser::rDeclaratorWithInit(), Parser::rDefinition(), Parser::rEnumBody(), Parser::rEnumSpec(), Parser::rEqualityExpr(), Parser::rExclusiveOrExpr(), Parser::rExpression(), Parser::rExprStatement(), Parser::rForStatement(), Parser::rFunctionArguments(), Parser::rFunctionBody(), Parser::rGCCAsmStatement(), Parser::rIfStatement(), Parser::rInclusiveOrExpr(), Parser::rInitializeExpr(), Parser::rIntegralDeclaration(), Parser::rIntegralDeclStatement(), Parser::rLinkageBody(), Parser::rLinkageSpec(), Parser::rLogicalAndExpr(), Parser::rLogicalOrExpr(), Parser::rMemberInit(), Parser::rMemberInitializers(), Parser::rMSC_if_existsStatement(), Parser::rMSC_tryStatement(), Parser::rMSCAsmStatement(), Parser::rMultiplyExpr(), Parser::rName(), Parser::rNamespaceSpec(), Parser::rNewDeclarator(), Parser::rNoexceptExpr(), Parser::rOperatorName(), Parser::rOtherDeclaration(), Parser::rPmExpr(), Parser::rPostfixExpr(), Parser::rPrimaryExpr(), Parser::rProgram(), Parser::rPtrToMember(), Parser::rRelationalExpr(), Parser::rShiftExpr(), Parser::rSimpleDeclaration(), Parser::rSizeofExpr(), Parser::rStatement(), Parser::rTempArgDeclaration(), Parser::rTempArgList(), Parser::rTemplateArgs(), Parser::rTemplateDecl(), Parser::rTemplateDecl2(), Parser::rThrowExpr(), Parser::rTryStatement(), Parser::rTypeidExpr(), Parser::rTypeNameOrFunctionType(), Parser::rTypeSpecifier(), Parser::rUnaryExpr(), Parser::rUsing(), Parser::rVarNameCore(), Parser::SkipTo(), and Parser::SyntaxError().
int cpp_token_buffert::LookAhead | ( | unsigned | offset, |
cpp_tokent & | token | ||
) |
Definition at line 59 of file cpp_token_buffer.cpp.
References current_pos, cpp_tokent::kind, read_token(), and token_vector.
|
protected |
Definition at line 76 of file cpp_token_buffer.cpp.
References ansi_c_parser, parsert::get_file(), parsert::get_line_no(), parsert::stack, token_vector, tokens, yyansi_clex(), and yyansi_ctext.
Referenced by get_token(), LookAhead(), and Replace().
void cpp_token_buffert::Replace | ( | const cpp_tokent & | token | ) |
Definition at line 111 of file cpp_token_buffer.cpp.
References current_pos, read_token(), and token_vector.
Referenced by Parser::rTemplateArgs().
void cpp_token_buffert::Restore | ( | post | pos | ) |
Definition at line 106 of file cpp_token_buffer.cpp.
References current_pos, and pos().
Referenced by Parser::optAlignas(), Parser::optIntegralTypeOrClassSpec(), Parser::rAllocateType(), Parser::rArgDeclListOrInit(), Parser::rCastExpr(), Parser::rClassMember(), Parser::rCondition(), Parser::rExprStatement(), Parser::rMSCuuidof(), Parser::rSizeofExpr(), Parser::rTempArgDeclaration(), Parser::rTemplateArgs(), Parser::rTypeidExpr(), Parser::rTypeNameOrFunctionType(), and Parser::rVarNameCore().
cpp_token_buffert::post cpp_token_buffert::Save | ( | ) |
Definition at line 101 of file cpp_token_buffer.cpp.
References current_pos.
Referenced by Parser::optAlignas(), Parser::optIntegralTypeOrClassSpec(), Parser::rAllocateType(), Parser::rArgDeclListOrInit(), Parser::rCastExpr(), Parser::rClassMember(), Parser::rCondition(), Parser::rExprStatement(), Parser::rMSCuuidof(), Parser::rSizeofExpr(), Parser::rTempArgDeclaration(), Parser::rTemplateArgs(), Parser::rTypeidExpr(), Parser::rTypeNameOrFunctionType(), and Parser::rVarNameCore().
|
protected |
Definition at line 60 of file cpp_token_buffer.h.
Referenced by clear(), get_token(), Insert(), LookAhead(), Replace(), Restore(), and Save().
|
protected |
Definition at line 58 of file cpp_token_buffer.h.
Referenced by clear(), get_token(), Insert(), LookAhead(), read_token(), and Replace().
|
protected |
Definition at line 56 of file cpp_token_buffer.h.
Referenced by clear(), current_token(), Insert(), and read_token().