Zen
A cross-platform functional programming language

Lexer Class Reference

The Lexer class. More...

#include <Lexer.hpp>

List of all members.

Public Member Functions

 Lexer (zbl::ParseContext &pctx)
 Default constructor.
int parse (zbl::Scanner &scanner)
 Read tokens from scanner and push into queue.
bool hasToken () const
 Check if token is available.
Token deque ()
 Read token from queue.

Private Member Functions

void enque (const Token &token)
 Add token to queue.

Private Attributes

zbl::ParseContext_pctx
 The parser context.
z::queue< Token_tokenQ
 The token queue.

Detailed Description

The Lexer class.


Constructor & Destructor Documentation

Lexer ( zbl::ParseContext pctx) [inline]

Default constructor.

Parameters:
pctxThe parser context

Member Function Documentation

Token deque ( ) [inline]

Read token from queue.

Returns:
The next token
void enque ( const Token token) [inline, private]

Add token to queue.

Parameters:
tokenThe token
bool hasToken ( ) const [inline]

Check if token is available.

Returns:
True if token is present
int parse ( zbl::Scanner scanner)

Read tokens from scanner and push into queue.

Parameters:
scannerThe scanner
Returns:
0 on success, else error code

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