scanner.cc File Reference

#include "config.h"
#include "scanner.h"
#include "vypIO.h"

Include dependency graph for scanner.cc:

Go to the source code of this file.

Classes

class  PrivateFlexLexer
class  FlexScanner
class  KwScanner

Functions

template<typename T>
bool readNumber (const string &s, T &number)
bool readString (const string &in, string &out)
std::ostream & operator<< (std::ostream &str, EToken type)
 send token type to stream in human-readable form
std::ostream & operator<< (std::ostream &str, const Token &token)
 send token to stream in human-readable form


Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const Token token 
)

send token to stream in human-readable form

Definition at line 272 of file scanner.cc.

References StreamDecorator::C_LIGHT_GREEN, StreamDecorator::C_LIGHT_RED, StreamDecorator::C_NO_COLOR, ETOKEN_ID, ETOKEN_NUMBER_DOUBLE, ETOKEN_NUMBER_INT, ETOKEN_STRING, Token::lineno, Token::numberDouble, Token::numberInt, Token::text, and Token::type.

std::ostream& operator<< ( std::ostream &  str,
EToken  type 
)

send token type to stream in human-readable form

Definition at line 182 of file scanner.cc.

References StreamDecorator::C_LIGHT_BLUE, StreamDecorator::C_NO_COLOR, StreamDecorator::C_YELLOW, ETOKEN_ID, ETOKEN_KW_AND, ETOKEN_KW_DIV, ETOKEN_KW_DOUBLE, ETOKEN_KW_ELSE, ETOKEN_KW_EQ, ETOKEN_KW_IF, ETOKEN_KW_INT, ETOKEN_KW_NEQ, ETOKEN_KW_NOT, ETOKEN_KW_OR, ETOKEN_KW_STRING, ETOKEN_KW_VAR, ETOKEN_KW_VOID, ETOKEN_KW_WHILE, ETOKEN_NULL, ETOKEN_NUMBER_DOUBLE, ETOKEN_NUMBER_INT, ETOKEN_OP_ASSIGN, ETOKEN_OP_COMMA, ETOKEN_OP_GREATER, ETOKEN_OP_GREATER_EQ, ETOKEN_OP_LCBR, ETOKEN_OP_LESS, ETOKEN_OP_LESS_EQ, ETOKEN_OP_LPAR, ETOKEN_OP_MINUS, ETOKEN_OP_PLUS, ETOKEN_OP_RCBR, ETOKEN_OP_RPAR, ETOKEN_OP_SEMICOLON, ETOKEN_OP_SLASH, ETOKEN_OP_STAR, and ETOKEN_STRING.

bool readNumber ( const string &  s,
T &  number 
) [inline]

Parse number from string.

Parameters:
s String to parse from.
number Target to store output number.
Returns:
Return true on success.

Definition at line 133 of file scanner.cc.

Referenced by FlexScanner::readNext().

Here is the caller graph for this function:

bool readString ( const string &  in,
string &  out 
)

Parse VYP08 string from raw string.

Note:
On error partially string is read.
Parameters:
in Raw string to parse from.
out Target to store output string.
Returns:
Return true on success.

Definition at line 146 of file scanner.cc.

Referenced by FlexScanner::readNext().

Here is the caller graph for this function:


Generated on Sat Jul 4 18:33:01 2009 for vyp08 (compiler and interpreter of VYP08 language) by  doxygen 1.5.4