Zen
A cross-platform functional programming language

LexerContext Class Reference

The Lexer Context. More...

#include <ParseContext.hpp>

Inheritance diagram for LexerContext:
ParseContext

List of all members.

Public Types

enum  IdentifierState {
  iInit, iImportDef, iNamespaceDef, iChildTypeRef,
  iChildTypeScope, iChildVarRef, iChildVarScope
}
 

The lexer state when reading different ID tokens.

More...

Public Member Functions

 LexerContext ()
 Default constructor.
void resetLexerState ()
 Reset lexer state to initial state.
void enterImportState ()
 Change lexer state to import state.
void enterNamespaceState ()
 Change lexer state to namespace state.
void enterTypeRefState (const Ast::TypeSpec *typeSpec)
 Change lexer state to type reference state.
void enterTypeScopeState ()
 Change lexer state to child type scope state.
void enterVarRefState ()
 Change lexer state to variable reference state.
void enterVarScopeState ()
 Change lexer state to child variable scope state.
const IdentifierStategetIdentifierState () const
 Get current lexer state.
const Ast::TypeSpecgetCurrentTypeSpec () const
 Get current type spec.

Private Attributes

IdentifierState _identifierState
 Current lexer state.
const Ast::TypeSpec_currentTypeSpec
 Current typespec.

Detailed Description

The Lexer Context.


Member Enumeration Documentation

The lexer state when reading different ID tokens.

Enumerator:
iImportDef 

An ID should be a reference to an existing root type or root variable.

iNamespaceDef 

The next ID should be a component of a import definition e.g. import A::B;.

iChildTypeRef 

The next ID should be a component of a namespace definition e.g. namespace A::B;.

iChildTypeScope 

An ID should be a child type.

iChildVarRef 

An ID should be a child type, scope received.

iChildVarScope 

An ID should be a member variable.


Member Function Documentation

const Ast::TypeSpec& getCurrentTypeSpec ( ) const [inline]

Get current type spec.

Returns:
Current typespec
const IdentifierState& getIdentifierState ( ) const [inline]

Get current lexer state.

Returns:
Current lexer state

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