namespace Synopsis
class Lexer

a Lexer reads tokens from a stream.

Public Typedefs Summary:
std::vector<Token> Comments
references
source code
Public Structs Summary:
references
source code
Public Enums Summary:
TokenSet C, CXX, GCC, MSVC
references
source code

Define sets of token that are to be recognized as special keywords (as opposed to identifiers).

Public Member functions Summary:
 constructor Lexer(Buffer*, int tokenset = CXX | GCC)
references
source code

Construct a Lexer on the given Buffer using the given token set.

references
source code
references
source code
references
source code
 const char* save()
references
source code
 void restore(const char*)
references
source code
references
source code
 unsigned long origin(const char*, std::string&) const
source code

Return the origin of the given pointer (filename and line number)

Private Classes Summary:
class Queue
references
source code

a Queue is used to read in tokens from a stream without consuming them

Private Typedefs Summary:
std::map<std::string, Token::Type> Dictionary
references
source code
Private Member functions Summary:
 void rewind(const char*)
references
source code
 Token::Type read_token(const char*&, size_t&)
references
source code
 bool fill(size_t o)
references
source code

try to fill the token cache to contain at least o tokens.

 void skip_paren()
references
source code

skip till end of paren

 void skip_line()
references
source code

skip till end of line

 void skip_attribute()
references
source code

skip __attribute__(...), ___asm__(...), ...

 Token::Type skip_extension(const char*&, size_t&)
references
source code

skip __extension__(...).

 void skip_asm()
references
source code

skip __asm ...

 void skip_declspec()
references
source code

skip __declspec(...).

 void skip_pragma()
references
source code

skip __pragma(...);.

references
source code
references
source code
 bool read_char_const(unsigned long top)
references
source code
 bool read_str_const(unsigned long top)
references
source code
 Token::Type read_number(char c, unsigned long top)
references
source code
 Token::Type read_float(unsigned long top)
references
source code
 Token::Type read_identifier(unsigned long top)
references
source code
 Token::Type screen(const char* identifier, size_t len)
references
source code
 Token::Type read_separator(char c, unsigned long top)
references
source code
 Token::Type single_char_op(unsigned char c)
references
source code
 Token::Type read_comment(char c, unsigned long top)
references
source code
Private Data members Summary:
references
source code
references
source code
references
source code
references
source code
references
source code
Enumerators Summary:
Public Enums Details:
enum TokenSet
C = 0x0
CXX = 0x01
GCC = 0x02
MSVC = 0x04

Define sets of token that are to be recognized as special keywords (as opposed to identifiers). They can be or'ed. If CXX is not specified, the Lexer will operate in 'C mode'.

Public Member functions Details:
 constructor Lexer(Buffer*, int tokenset = CXX | GCC)
references
source code

Construct a Lexer on the given Buffer using the given token set. The default token set is CXX with GCC extensions.

 unsigned long origin(const char*, std::string&) const
source code

Return the origin of the given pointer (filename and line number)

Private Classes Details:
class Queue
references
source code

a Queue is used to read in tokens from a stream without consuming them

Private Member functions Details:
 bool fill(size_t o)
references
source code

try to fill the token cache to contain at least o tokens. Returns false if there are not enough tokens.

 void skip_paren()
references
source code

skip till end of paren

 void skip_line()
references
source code

skip till end of line

 void skip_attribute()
references
source code

skip __attribute__(...), ___asm__(...), ...

 Token::Type skip_extension(const char*&, size_t&)
references
source code

skip __extension__(...).

 void skip_asm()
references
source code

skip __asm ...

 void skip_declspec()
references
source code

skip __declspec(...).

 void skip_pragma()
references
source code

skip __pragma(...);.