zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pp::Token Struct Reference

#include <Token.h>

Public Types

enum  Flags { AT_START_OF_LINE = 1 << 0, HAS_LEADING_SPACE = 1 << 1, EXPANSION_DISABLED = 1 << 2 }
 
enum  Type {
  LAST = 0, IDENTIFIER = 258, CONST_INT, CONST_FLOAT,
  OP_INC, OP_DEC, OP_LEFT, OP_RIGHT,
  OP_LE, OP_GE, OP_EQ, OP_NE,
  OP_AND, OP_XOR, OP_OR, OP_ADD_ASSIGN,
  OP_SUB_ASSIGN, OP_MUL_ASSIGN, OP_DIV_ASSIGN, OP_MOD_ASSIGN,
  OP_LEFT_ASSIGN, OP_RIGHT_ASSIGN, OP_AND_ASSIGN, OP_XOR_ASSIGN,
  OP_OR_ASSIGN, PP_HASH, PP_NUMBER, PP_OTHER
}
 

Public Member Functions

 Token ()
 
bool atStartOfLine () const
 
bool equals (const Token &other) const
 
bool expansionDisabled () const
 
bool fValue (float *value) const
 
bool hasLeadingSpace () const
 
bool iValue (int *value) const
 
void reset ()
 
void setAtStartOfLine (bool start)
 
void setExpansionDisabled (bool disable)
 
void setHasLeadingSpace (bool space)
 
bool uValue (unsigned int *value) const
 

Public Attributes

unsigned int flags
 
SourceLocation location
 
std::string text
 
int type
 

Detailed Description

Definition at line 18 of file Token.h.

Member Enumeration Documentation

Enumerator
AT_START_OF_LINE 
HAS_LEADING_SPACE 
EXPANSION_DISABLED 

Definition at line 58 of file Token.h.

Enumerator
LAST 
IDENTIFIER 
CONST_INT 
CONST_FLOAT 
OP_INC 
OP_DEC 
OP_LEFT 
OP_RIGHT 
OP_LE 
OP_GE 
OP_EQ 
OP_NE 
OP_AND 
OP_XOR 
OP_OR 
OP_ADD_ASSIGN 
OP_SUB_ASSIGN 
OP_MUL_ASSIGN 
OP_DIV_ASSIGN 
OP_MOD_ASSIGN 
OP_LEFT_ASSIGN 
OP_RIGHT_ASSIGN 
OP_AND_ASSIGN 
OP_XOR_ASSIGN 
OP_OR_ASSIGN 
PP_HASH 
PP_NUMBER 
PP_OTHER 

Definition at line 20 of file Token.h.

Constructor & Destructor Documentation

pp::Token::Token ( )
inline

Definition at line 65 of file Token.h.

Member Function Documentation

bool pp::Token::atStartOfLine ( ) const
inline

Definition at line 72 of file Token.h.

References AT_START_OF_LINE.

bool pp::Token::equals ( const Token other) const

Definition at line 24 of file Token.cpp.

References flags, location, text, and type.

Referenced by pp::operator!=(), and pp::operator==().

bool pp::Token::expansionDisabled ( ) const
inline

Definition at line 78 of file Token.h.

References EXPANSION_DISABLED.

Referenced by pp::MacroExpander::lex().

bool pp::Token::fValue ( float *  value) const

Definition at line 68 of file Token.cpp.

References assert, CONST_FLOAT, pp::numeric_lex_float(), and text.

Referenced by pp::Preprocessor::lex().

bool pp::Token::hasLeadingSpace ( ) const
inline

Definition at line 75 of file Token.h.

References HAS_LEADING_SPACE.

Referenced by pp::operator<<().

bool pp::Token::iValue ( int value) const

Definition at line 56 of file Token.cpp.

References assert, CONST_INT, pp::numeric_lex_int(), and text.

Referenced by pp::Preprocessor::lex().

void pp::Token::reset ( )

Definition at line 16 of file Token.cpp.

References text.

Referenced by content.ContentProcessor::__init__(), and sources.SourceProcessor::parse_file().

void pp::Token::setAtStartOfLine ( bool  start)

Definition at line 32 of file Token.cpp.

References AT_START_OF_LINE.

Referenced by pp::Tokenizer::lex().

void pp::Token::setExpansionDisabled ( bool  disable)

Definition at line 48 of file Token.cpp.

References EXPANSION_DISABLED.

Referenced by pp::MacroExpander::lex().

void pp::Token::setHasLeadingSpace ( bool  space)

Definition at line 40 of file Token.cpp.

References HAS_LEADING_SPACE.

Referenced by pp::Tokenizer::lex().

bool pp::Token::uValue ( unsigned int value) const

Definition at line 62 of file Token.cpp.

References assert, CONST_INT, pp::numeric_lex_int(), and text.

Referenced by yylex().

Member Data Documentation

unsigned int pp::Token::flags

Definition at line 88 of file Token.h.

Referenced by equals(), and pp::Tokenizer::lex().


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