Public Member Functions

sp::tool::TokenParser Class Reference

#include <spUtilityTokenParser.hpp>

List of all members.

Public Member Functions

 TokenParser ()
 ~TokenParser ()
bool readTokens (const c8 *InputString, std::vector< SToken > &OutputTokens)
bool readFile (const io::stringc &InputFilename, std::vector< SToken > &OutputTokens)

Detailed Description

The token parser is used to - as the name implies - parse all tokens from a given source string. This is the first step in compiling and/or interpreting source code. The syntax are treated as in C++ i.e. '+=', '>>=', '--' etc. are treated as a single token. The same goes for comments.

Since:
Version 3.2

Constructor & Destructor Documentation

sp::tool::TokenParser::TokenParser (  ) 
sp::tool::TokenParser::~TokenParser (  ) 

Member Function Documentation

bool sp::tool::TokenParser::readFile ( const io::stringc InputFilename,
std::vector< SToken > &  OutputTokens 
)

Does the same as the "readTokens" procedure but gets the string directly from a file.

Parameters:
[in] Filename Specifies the input file which is to be read.
[out] OutputTokens Specifies the output token container.
Returns:
True if any tokens could read. Otherwise false.
bool sp::tool::TokenParser::readTokens ( const c8 InputString,
std::vector< SToken > &  OutputTokens 
)

Reads all tokens out of the given string. This is not programming language specific. It can be used for a custom language parser as well.

Parameters:
[in] InputString Specifies the input string. This is a null-terminated ANSI C string.
[out] OutputTokens Specifies the output token container.
Returns:
True if any tokens could read. Otherwise false.
Note:
Strings and comments will be treated as in C++.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines