KwScanner Class Reference

Inheritance diagram for KwScanner:

Inheritance graph
[legend]
Collaboration diagram for KwScanner:

Collaboration graph
[legend]

List of all members.


Detailed Description

Map keyword->token
Note:
DP decorator

Definition at line 102 of file scanner.cc.


Public Member Functions

 KwScanner (IScanner *scannerToUseAndDelete)
virtual ~KwScanner ()
virtual bool readNext (Token &token)
virtual bool hasError () const

Private Types

typedef ETokenTMap

Private Member Functions

void initMap ()
 if you are looking where to add a new keyword, this is the best place ;-)

Private Attributes

TMap map_
 map keyword->token
IScannerscan_
 superior IScanner object (design pattern decorator)

Member Typedef Documentation

typedef EToken* TMap [private]

Definition at line 117 of file scanner.cc.


Constructor & Destructor Documentation

KwScanner ( IScanner scannerToUseAndDelete  )  [inline]

Definition at line 104 of file scanner.cc.

References initMap().

Here is the call graph for this function:

virtual ~KwScanner (  )  [inline, virtual]

Definition at line 109 of file scanner.cc.

References scan_.


Member Function Documentation

bool readNext ( Token token  )  [virtual]

read next token

Parameters:
token Where to store token to.
Returns:
Return true if token is read, false on EOF.

Implements IScanner.

Definition at line 340 of file scanner.cc.

References ETOKEN_ID, IScanner::readNext(), Token::text, and Token::type.

Here is the call graph for this function:

virtual bool hasError (  )  const [inline, virtual]

Return true if any error was detected.

Implements IErrorSensitive.

Definition at line 113 of file scanner.cc.

References IErrorSensitive::hasError(), and scan_.

Here is the call graph for this function:

void initMap (  )  [private]

if you are looking where to add a new keyword, this is the best place ;-)

Definition at line 358 of file scanner.cc.

References 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, and ETOKEN_KW_WHILE.

Referenced by KwScanner().

Here is the caller graph for this function:


Member Data Documentation

TMap map_ [private]

map keyword->token

Definition at line 118 of file scanner.cc.

IScanner* scan_ [private]

superior IScanner object (design pattern decorator)

Definition at line 120 of file scanner.cc.

Referenced by hasError(), and ~KwScanner().


The documentation for this class was generated from the following file:
Generated on Sat Jul 4 18:33:16 2009 for vyp08 (compiler and interpreter of VYP08 language) by  doxygen 1.5.4