ScriptTokeniser Class Reference

#include <scripttokeniser.h>

Inheritance diagram for ScriptTokeniser:
Inheritance graph
[legend]
Collaboration diagram for ScriptTokeniser:
Collaboration graph
[legend]

Public Member Functions

 ScriptTokeniser (TextInputStream &istream, bool special)
const std::string getToken ()
void ungetToken ()
std::size_t getLine () const
std::size_t getColumn () const

Private Types

enum  CharType {
  eWhitespace, eCharToken, eNewline, eCharQuote,
  eCharSolidus, eCharStar, eCharSpecial
}
typedef bool(ScriptTokeniser::* Tokenise )(char c)

Private Member Functions

CharType charType (const char c)
Tokenise state ()
void push (Tokenise state)
void pop ()
void add (const char c)
void remove ()
bool tokeniseDefault (char c)
bool tokeniseToken (char c)
bool tokeniseQuotedToken (char c)
bool tokeniseSolidus (char c)
bool tokeniseComment (char c)
bool tokeniseBlockComment (char c)
bool tokeniseEndBlockComment (char c)
bool tokeniseEndQuote (char c)
bool tokeniseSpecial (char c)
bool tokenise ()
 Returns true if a token was successfully parsed.
const char * fillToken ()
bool eof ()

Private Attributes

Tokenise m_stack [3]
Tokenisem_state
SingleCharacterInputStream
< TextInputStream
m_istream
std::size_t m_scriptline
std::size_t m_scriptcolumn
char m_token [MAXTOKEN]
char * m_write
char m_current
bool m_eof
bool m_unget
bool m_emit
bool m_special

Detailed Description

Definition at line 27 of file scripttokeniser.h.


Member Typedef Documentation

typedef bool(ScriptTokeniser::* ScriptTokeniser::Tokenise)(char c) [private]

Definition at line 34 of file scripttokeniser.h.


Member Enumeration Documentation

enum ScriptTokeniser::CharType [private]
Enumerator:
eWhitespace 
eCharToken 
eNewline 
eCharQuote 
eCharSolidus 
eCharStar 
eCharSpecial 

Definition at line 29 of file scripttokeniser.h.


Constructor & Destructor Documentation

ScriptTokeniser::ScriptTokeniser ( TextInputStream istream,
bool  special 
) [inline]

Member Function Documentation

void ScriptTokeniser::add ( const char  c  )  [inline, private]
CharType ScriptTokeniser::charType ( const char  c  )  [inline, private]
bool ScriptTokeniser::eof (  )  [inline, private]

Definition at line 291 of file scripttokeniser.h.

References m_eof.

Referenced by tokenise().

const char* ScriptTokeniser::fillToken (  )  [inline, private]

Definition at line 281 of file scripttokeniser.h.

References add(), m_token, and tokenise().

Referenced by getToken().

std::size_t ScriptTokeniser::getColumn (  )  const [inline, virtual]

Implements Tokeniser.

Definition at line 329 of file scripttokeniser.h.

References m_scriptcolumn.

std::size_t ScriptTokeniser::getLine (  )  const [inline, virtual]

Implements Tokeniser.

Definition at line 325 of file scripttokeniser.h.

References m_scriptline.

const std::string ScriptTokeniser::getToken (  )  [inline, virtual]

Implements Tokeniser.

Definition at line 306 of file scripttokeniser.h.

References fillToken(), m_token, m_unget, and string.

void ScriptTokeniser::pop (  )  [inline, private]
void ScriptTokeniser::push ( Tokenise  state  )  [inline, private]
void ScriptTokeniser::remove (  )  [inline, private]

Definition at line 100 of file scripttokeniser.h.

References m_token, and m_write.

Tokenise ScriptTokeniser::state (  )  [inline, private]

Definition at line 80 of file scripttokeniser.h.

References m_state.

Referenced by tokenise(), tokeniseComment(), and tokeniseEndBlockComment().

bool ScriptTokeniser::tokenise (  )  [inline, private]

Returns true if a token was successfully parsed.

Definition at line 253 of file scripttokeniser.h.

References eof(), m_current, m_emit, m_eof, m_istream, m_scriptcolumn, m_scriptline, m_token, m_write, SingleCharacterInputStream< TextInputStreamType, SIZE >::readChar(), and state().

Referenced by fillToken().

bool ScriptTokeniser::tokeniseBlockComment ( char  c  )  [inline, private]

Definition at line 212 of file scripttokeniser.h.

References pop(), push(), and tokeniseEndBlockComment().

Referenced by tokeniseEndBlockComment(), and tokeniseSolidus().

bool ScriptTokeniser::tokeniseComment ( char  c  )  [inline, private]

Definition at line 201 of file scripttokeniser.h.

References m_emit, pop(), state(), and tokeniseToken().

Referenced by tokeniseSolidus().

bool ScriptTokeniser::tokeniseDefault ( char  c  )  [inline, private]
bool ScriptTokeniser::tokeniseEndBlockComment ( char  c  )  [inline, private]

Definition at line 220 of file scripttokeniser.h.

References m_emit, pop(), push(), state(), tokeniseBlockComment(), and tokeniseToken().

Referenced by tokeniseBlockComment().

bool ScriptTokeniser::tokeniseEndQuote ( char  c  )  [inline, private]

Definition at line 239 of file scripttokeniser.h.

References m_emit, and pop().

Referenced by tokeniseQuotedToken().

bool ScriptTokeniser::tokeniseQuotedToken ( char  c  )  [inline, private]
bool ScriptTokeniser::tokeniseSolidus ( char  c  )  [inline, private]
bool ScriptTokeniser::tokeniseSpecial ( char  c  )  [inline, private]

Definition at line 245 of file scripttokeniser.h.

References m_emit, and pop().

Referenced by tokeniseDefault().

bool ScriptTokeniser::tokeniseToken ( char  c  )  [inline, private]
void ScriptTokeniser::ungetToken (  )  [inline, virtual]

Implements Tokeniser.

Definition at line 320 of file scripttokeniser.h.

References m_unget.


Field Documentation

Definition at line 45 of file scripttokeniser.h.

Referenced by ScriptTokeniser(), and tokenise().

bool ScriptTokeniser::m_emit [private]
bool ScriptTokeniser::m_eof [private]

Definition at line 46 of file scripttokeniser.h.

Referenced by eof(), ScriptTokeniser(), and tokenise().

Definition at line 38 of file scripttokeniser.h.

Referenced by ScriptTokeniser(), and tokenise().

std::size_t ScriptTokeniser::m_scriptcolumn [private]

Definition at line 40 of file scripttokeniser.h.

Referenced by getColumn(), and tokenise().

std::size_t ScriptTokeniser::m_scriptline [private]

Definition at line 39 of file scripttokeniser.h.

Referenced by getLine(), and tokenise().

Definition at line 50 of file scripttokeniser.h.

Referenced by charType().

Definition at line 36 of file scripttokeniser.h.

Referenced by pop(), push(), and ScriptTokeniser().

Definition at line 37 of file scripttokeniser.h.

Referenced by pop(), push(), and state().

char ScriptTokeniser::m_token[MAXTOKEN] [private]

Definition at line 42 of file scripttokeniser.h.

Referenced by add(), fillToken(), getToken(), remove(), ScriptTokeniser(), and tokenise().

bool ScriptTokeniser::m_unget [private]

Definition at line 47 of file scripttokeniser.h.

Referenced by getToken(), and ungetToken().

char* ScriptTokeniser::m_write [private]

Definition at line 43 of file scripttokeniser.h.

Referenced by add(), remove(), and tokenise().


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

Generated by  doxygen 1.6.2