cprover
cpp_token_buffert Class Reference

#include <cpp_token_buffer.h>

Collaboration diagram for cpp_token_buffert:
[legend]

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_tokentcurrent_token ()
 

Protected Types

typedef std::list< cpp_tokenttokenst
 

Protected Member Functions

void read_token ()
 

Protected Attributes

tokenst tokens
 
std::vector< tokenst::iterator > token_vector
 
post current_pos
 

Detailed Description

Definition at line 21 of file cpp_token_buffer.h.

Member Typedef Documentation

◆ post

typedef unsigned int cpp_token_buffert::post

Definition at line 28 of file cpp_token_buffer.h.

◆ tokenst

typedef std::list<cpp_tokent> cpp_token_buffert::tokenst
protected

Definition at line 55 of file cpp_token_buffer.h.

Constructor & Destructor Documentation

◆ cpp_token_buffert()

cpp_token_buffert::cpp_token_buffert ( )
inline

Definition at line 24 of file cpp_token_buffer.h.

Member Function Documentation

◆ clear()

void cpp_token_buffert::clear ( void  )
inline

Definition at line 40 of file cpp_token_buffer.h.

References current_pos, token_vector, and tokens.

Referenced by cpp_parsert::clear().

◆ current_token()

cpp_tokent& cpp_token_buffert::current_token ( )
inline

◆ get_token() [1/2]

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().

◆ get_token() [2/2]

int cpp_token_buffert::get_token ( )

Definition at line 45 of file cpp_token_buffer.cpp.

References current_pos, read_token(), and token_vector.

◆ Insert()

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().

◆ LookAhead() [1/2]

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().

◆ LookAhead() [2/2]

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.

◆ read_token()

void cpp_token_buffert::read_token ( )
protected

◆ 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().

◆ Restore()

◆ Save()

Member Data Documentation

◆ current_pos

post cpp_token_buffert::current_pos
protected

Definition at line 60 of file cpp_token_buffer.h.

Referenced by clear(), get_token(), Insert(), LookAhead(), Replace(), Restore(), and Save().

◆ token_vector

std::vector<tokenst::iterator> cpp_token_buffert::token_vector
protected

Definition at line 58 of file cpp_token_buffer.h.

Referenced by clear(), get_token(), Insert(), LookAhead(), read_token(), and Replace().

◆ tokens

tokenst cpp_token_buffert::tokens
protected

Definition at line 56 of file cpp_token_buffer.h.

Referenced by clear(), current_token(), Insert(), and read_token().


The documentation for this class was generated from the following files: