Zen
A cross-platform functional programming language

ParseContext Class Reference

The Parser Context. More...

#include <ParseContext.hpp>

Inheritance diagram for ParseContext:
LexerContext

List of all members.

Classes

struct  ImportFrame
 Stack item for imports. More...
class  IndexableTypeCaster
 The Indexable type visitor. More...
class  IndexExprCreator
 The indexable type visitor for index expressions. More...
class  InitVariableDefCreator
 The indexable type visitor for init variable definitions. More...
struct  TypeDefSig
 Temporary holder for typedef signature. More...

Public Types

typedef z::dict< const
Ast::TypeSpec *, const
Ast::Expr * > 
TypeDefaultValueMap
 Type to default mapping type.

Public Member Functions

void enterImport (const Ast::UserDefinedTypeSpec::NativeType &ntype, const z::string &fname)
 Push an import frame on the stack.
void leaveImport ()
 Pop import frame from the stack.
bool inImport () const
 Check if parser is currently in an import file.
ImportFramegetImportFrame ()
 Get top-most import frame.
const ImportFramegetImportFrame () const
 Get top-most import frame.
const
Ast::UserDefinedTypeSpec::NativeType
getNativeType () const
 Get native type of top-most import frame.
Ast::ChildTypeSpecgetCurrentType () const
 Get type being currently defined.
Ast::ChildTypeSpecenterCurrentType (Ast::ChildTypeSpec &type)
 Enter a type definition.
Ast::ChildTypeSpecleaveCurrentType (Ast::ChildTypeSpec &type)
 Exit a type definition.
const z::stringgetFilename () const
 Get the name of the current file being compiled.
void setTokenPos (const int &line, const int &col)
 Set the current token position.
 ParseContext (zbl::Compiler &compiler, Ast::Unit &unit)
 Default constructor.
 ~ParseContext ()
 Destructor.
const zbl::TokenDatagetNullToken () const
 Return reference to null token.
z::string err () const
 Return an error string based on current token.
z::string err (const zbl::TokenData &token) const
 Return an error string based on specified token.
void importHeader (Ast::ImportStatement &stmt, const Ast::ImportStatement::Type &type)
 Imports a file.
Ast::ImportStatementcreateImportNamespace (const z::string &name)
 Enters an import level.
Ast::NamespaceenterUnitNamespace (const z::string &name)
 Enters a namespace in current unit.
Ast::NamespaceaddUnitNamespace (Ast::Namespace &ns, const z::string &name)
 Add a child namespace to current namespace.
void leaveUnitNamespace (Ast::Namespace &ns)
 Leave current namespace.
Ast::TypeSpechasRootType (const z::string &name)
 Search for type.
Ast::TypeSpechasChildType (const Ast::TypeSpec &parent, const z::string &name)
 Check if type has specified child.
Ast::TypeSpecgetChildType (const Ast::TypeSpec &parent, const zbl::TokenData &name)
 Get child of specified parent.
Ast::TypeSpecenterTypeSpecRef (const zbl::TokenData &token)
 Enter type reference.
Ast::TypeSpecleaveTypeSpecRef (Ast::TypeSpec &typeSpec)
 Leave type reference.
Ast::QualifiedTypecreateQualifiedType (const bool &isConst, const Ast::TypeSpec &type, const bool &isRef)
 Create qualified type.
void enterCoertionList (const Ast::TypeSpec &type)
 Enter coertion list.
void addCoertionItem (const Ast::TypeSpec &type)
 Add type to coertion list.
void leaveCoertionList ()
 Leave coertion list.
void addCoertionMap (const Ast::TypeSpec &lhs, const Ast::TypeSpec &rhs, const Ast::TypeSpec &dst)
 Add coertion mapping.
void addTypeDefaultValue (const Ast::TypeSpec &type, const Ast::Expr &expr)
 Add default value for type.
const Ast::ExprgetTypeDefaultValue (const Ast::TypeSpec &type)
 Get default value for type.
Ast::StructMemberVariableDefcreateStructVariableDefInit (const Ast::QualifiedType &type, const z::string &name, const Ast::Expr &expr)
 Create AST node for struct member with init value.
Ast::StructMemberVariableDefcreateStructVariableDef (const Ast::QualifiedType &type, const z::string &name)
 Create AST node for struct member without init value.
Ast::ParamVariableDefcreateParamVariableDefInit (const Ast::QualifiedType &type, const z::string &name, const Ast::Expr &expr)
 Create AST node for function in-parameter with init value.
Ast::ParamVariableDefcreateParamVariableDef (const Ast::QualifiedType &type, const z::string &name)
 Create AST node for struct member without init value.
Ast::InitVariableDefcreateInitVariableDefInit (const Ast::VariableDef::DefType &defType, const Ast::QualifiedType &type, const z::string &name, const Ast::Expr &expr)
 Create AST node for local variable declaration with type specified.
Ast::InitVariableDefcreateInitVariableDef (const Ast::VariableDef::DefType &defType, const z::string &name, const Ast::Expr &expr)
 Create AST node for local variable declaration without type specified.
Ast::InitVariableDefcreateForeachInitVariableDef (const Ast::VariableDef::DefType &defType, const z::string &name, const Ast::Expr &expr)
 Create AST node for for-loop variable declaration without type specified.
Ast::QualifiedTypecreateOutParam (const Ast::VariableDefMap &defList)
 Create AST node for out parameter.
Ast::SharedVariableDefcreateSharedTypeExprDef (const Ast::QualifiedType &qtype, const zbl::TokenData &name, const Ast::Expr &expr)
 Create AST node for shared variable definition.
Ast::SharedVariableDefcreateSharedExprDef (const zbl::TokenData &name, const Ast::Expr &expr)
 Create AST node for shared variable definition.
Ast::SharedVariableDefcreateSharedMemberDef (const Ast::VariableRef &vref)
 Create AST node for a member of a shared variable definition.
Ast::SharedDefcreateSharedDef (const Ast::VariableDefMap &defList)
 Create AST node for shared definition type.
Ast::FunctionDefgetFunctionDef () const
 Get AST node for function definition type.
const Ast::VariableDefgetIdentifier (const z::string &name, Ast::Storage::T &storage) const
 Get AST node for variable definition type in current and higher scopes.
Ast::VariableDefMapcreateVariableDefMap ()
 Create AST node for variable definition map.
Ast::StructDefListcreateStructDefList ()
 Create AST node for struct definition list.
Ast::StructDefenterStructDef (const Ast::TypeSpec::AccessType::T &accessType, const z::string &name)
 Enter struct definition.
Ast::StructDefleaveStructDef (Ast::StructDef &structDef)
 Leave struct definition.
Ast::StructDefleaveStructDefList (Ast::StructDef &structDef, const Ast::VariableDefMap &defList, const Ast::StructDefList &subTypeList)
 Leave struct definition with list of variable and subtype definitions.
Ast::EnumDefcreateEnumDef (const Ast::TypeSpec::AccessType::T &accessType, const z::string &name, Ast::EnumMemberDefList &defList)
 Create enum definition with list of variable definitions.
Ast::EnumMemberDefListcreateEnumMemberDefList ()
 Create enum member definition list.
Ast::EnumMemberDefcreateEnumMemberDefInit (const zbl::TokenData &name, const bool &hasInit, const Ast::Expr &initExpr)
 Create enum member definition with init value.
Ast::EnumMemberDefcreateEnumMemberDef (const zbl::TokenData &name)
 Create enum member definition with init value.
TypeDefSig createTypeDefSig (const Ast::TypeSpec::AccessType::T &accessType, const zbl::TokenData &name)
 Create typedef signature.
Ast::TypeDeclcreateTypeDecl (const TypeDefSig &sig)
 Create typedef declaration.
Ast::TypeDefcreateTypeDef (const TypeDefSig &sig, const Ast::QualifiedType &type)
 Create typedef definition.
Ast::GrammarTokencreateGrammarToken (const TokenData &name, const TokenData &txt, const bool &isRex, const bool &isNot)
 Create grammar token node.
Ast::GrammarTokenListcreateGrammarTokenList ()
 Create empty grammar token list.
Ast::GrammarMemberIdcreateGrammarMemberId (const TokenData &name)
 Create grammar member id node.
const Ast::VariableDefcreateGrammarMemberNameDef (const TokenData &name)
 Create grammar member name node.
Ast::GrammarMemberNameIdcreateGrammarMemberNameId (const TokenData &name, const TokenData &txt)
 Create grammar member node.
Ast::GrammarMemberListcreateGrammarMemberList ()
 Create empty grammar member list.
Ast::FunctionDefenterGrammarRuleOut (Ast::QualifiedType &out, const TokenData &name, Ast::Scope &in)
 Create grammar rule function definition with out parameter.
Ast::FunctionDefenterGrammarRule (const TokenData &name, Ast::Scope &in)
 Create grammar rule function definition without an out parameter, and enter grammar rule block.
Ast::GrammarRuleStatementleaveGrammarRuleBlock (Ast::FunctionDef &fdef, const Ast::GrammarMemberList &list, const Ast::StatementList &stmtList)
 Leave grammar rule block.
Ast::GrammarRuleStatementleaveGrammarRule (Ast::FunctionDef &fdef, const Ast::GrammarMemberList &list)
 Leave grammar rule block without statement list.
Ast::GrammarLexerenterLexerState (const TokenData &name)
 Enter lexer state.
Ast::GrammarLexerenterLexerState ()
 Enter default lexer state.
Ast::GrammarLexerleaveLexerState (Ast::GrammarLexer &lexer, Ast::LexerStatementList &list)
 Leave lexer state.
Ast::FunctionDefenterLexer (const TokenData &name, Ast::Scope &in)
 Enter lexer.
Ast::LexerStatementleaveLexer (Ast::FunctionDef &fdef, const Ast::GrammarTokenList &list, const Ast::StatementList &stmtList)
 Leave lexer.
Ast::LexerStatementleaveLexer (Ast::FunctionDef &fdef, const Ast::GrammarTokenList &list)
 Leave lexer without a statement list.
Ast::LexerStatementListcreateLexerStatementList ()
 Create empty lexer statement list.
Ast::GrammarLexerListcreateGrammarLexerList ()
 Create empty grammar lexer list.
Ast::GrammarStatementListcreateGrammarStatementList ()
 Create empty grammar statement list.
Ast::GrammarOptionValueListcreateGrammarOptionValueList (const TokenData &value)
 Create grammar option list.
Ast::GrammarOptionValueListaddGrammarOptionValue (Ast::GrammarOptionValueList &list, const TokenData &value)
 Add value to grammar option list.
Ast::GrammarOptioncreateGrammarOption (const TokenData &name, const Ast::GrammarOptionValueList &list)
 Create grammar option.
Ast::GrammarOptionListcreateGrammarOptionList ()
 Create empty grammar option list.
Ast::FunctionDefenterFunctionName (const Ast::TypeSpec::AccessType::T &accessType, const Ast::QualifiedType &out, const z::string &name, Ast::Scope &in, const Ast::FunctionDef::Modifier::T &modifier)
 Enter function definition.
Ast::FunctionDefenterFunction (const Ast::TypeSpec::AccessType::T &accessType, Ast::QualifiedType &out, const zbl::TokenData &name, Ast::Scope &in, const Ast::FunctionDef::Modifier::T &modifier)
 Enter function definition with token name.
Ast::FunctionDefleaveFunction (Ast::FunctionDef &fdef)
 Enter function definition.
Ast::FunctionImplItemleaveFunctionDef (Ast::FunctionDef &fdef, const Ast::FunctionBlock &block)
 Leave function implementation definition.
Ast::RoutineImplItemleaveRoutineDef (Ast::FunctionDef &fdef, const Ast::RoutineBlock &block)
 Leave routine implementation definition.
Ast::GrammarImplItemleaveGrammarDef (Ast::FunctionDef &fdef, const Ast::GrammarBlock &block)
 Leave grammar implementation definition.
Ast::WindowImplItemleaveWindowDef (Ast::FunctionDef &fdef, const Ast::WindowBlock &block)
 Leave window implementation definition.
Ast::FunctionDefenterFunctionImpl (Ast::TypeSpec &type)
 Enter function implementation definition.
Ast::FunctionImplItemleaveFunctionImpl (Ast::FunctionDef &fdef, Ast::FunctionBlock &block)
 Leave function implementation definition.
Ast::FunctionImplExprcreateFunctionImplExpr (Ast::FunctionImplItem &item)
 Create function implementation expression.
Ast::FunctionDefImplExprcreateFunctionDefImplExpr (Ast::ImplItem &item)
 Create function definition implementation expression.
Ast::RoutineBlockcreateRoutineBlock (Ast::StatementList &list)
 Create routine block.
Ast::FunctionBlockcreateFunctionBlock (const Ast::StatementList &list)
 Create function block.
Ast::GrammarBlockcreateGrammarBlock (const Ast::GrammarOptionList &optList, const Ast::GrammarStatementList &list, const Ast::GrammarLexerList &lexList)
 Create grammar block.
Ast::WindowBlockcreateWindowBlock (Ast::FunctionBlock &functionBlock)
 Create window block.
Ast::OwnerTemplatecreateOwnerTemplate (const Ast::QualifiedType &type)
 Create owner type.
Ast::ListTemplatecreateListTemplate (const Ast::QualifiedType &type)
 Create list type.
Ast::DictTemplatecreateDictTemplate (const Ast::QualifiedType &key, const Ast::QualifiedType &type)
 Create dictionary type.
Ast::ListItemcreateListItem (const Ast::Expr &expr)
 Create list item.
void addListItem (Ast::ListList &list, const Ast::ListItem &item)
 Add item to list.
Ast::ListListcreateListList ()
 Create empty list.
Ast::DictItemcreateDictItem (const Ast::Expr &key, const Ast::Expr &expr)
 Create dictionary item.
void addDictItem (Ast::DictList &list, const Ast::DictItem &item)
 Add item to dictionary.
Ast::DictListcreateDictList ()
 Create empty dictionary.
Ast::DictItemcreateTreeItem (const Ast::Expr &key, const Ast::Expr &expr)
 Create tree item.
void addTreeItem (Ast::DictList &list, const Ast::DictItem &item)
 Add item to tree.
Ast::DictListcreateTreeList ()
 Create empty tree.
Ast::RunClosurecreateRunClosure ()
 Create run closure.
Ast::ExitClosurecreateExitClosure ()
 Create exit closure.
Ast::CallClosurecreateNamedCallClosure (const zbl::TokenData &name, const Ast::Invoker &fcall)
 Create named call closure.
Ast::CallClosurecreateCallClosure (const Ast::Invoker &fcall)
 Create call closure.
Ast::FunctionCallClosurecreateFunctionCallClosure (const zbl::TokenData &name, const Ast::Invoker &fcall)
 Create function call closure.
Ast::FunctionCallClosurecreateFunctionCallClosure (const Ast::Invoker &fcall)
 Create function call closure.
Ast::LoopClosurecreateLoopClosure (const Ast::Expr &expr)
 Create loop closure.
Ast::SharedClosurecreateSharedClosure (const zbl::TokenData &name, const Ast::SharedDef &sharedList)
 Create shared closure.
Ast::ReturnClosurecreateReturnClosure (const Ast::Closure::Type &type, const Ast::ExprList &list)
 Create return closure.
Ast::ReturnClosurecreateDefaultReturnClosure (const Ast::Closure::Type &type, Ast::FunctionDef &fdef)
 Create default return closure.
Ast::ClosureListcreateClosureList (Ast::Closure &closure)
 Create closure list.
Ast::ClosureListaddClosureToList (Ast::ClosureList &list, const Ast::Closure::Type &type, Ast::Closure &closure)
 Add a closure to closure list.
Ast::ContinuationImplItemcreateContinuationImplItem (Ast::ClosureList &closureList, const Ast::ReturnClosure &retnClosure)
 Create a continuation implementation item.
Ast::ContinuationImplItemcreateContinuationImplItem (Ast::ClosureList &closureList)
 Create a continuation implementation item without a return closure.
Ast::ExprListcreateExprList ()
 Create expression list.
Ast::QueryExprcreateQueryExpr (const Ast::Expr &expr)
 Create query expression.
Ast::QueryPartExprcreateQueryPartExpr (const Ast::Expr &keyExpr, const Ast::Expr &valExpr)
 Create query pair expression.
Ast::QueryValExprcreateQueryValExpr ()
 Create query value expression.
Ast::TernaryOpExprcreateTernaryOpExpr (const Ast::Expr &lhs, const z::string &op1, const Ast::Expr &rhs1, const z::string &op2, const Ast::Expr &rhs2)
 Create ternary expression.
Ast::BinaryExprcreateBinaryOpExpr (const Ast::Expr &lhs, const z::string &op, const Ast::Expr &rhs)
 Create ternary expression.
Ast::OrderedExprcreateOrderedExpr (const Ast::Expr &rhs)
 Create ordered expression.
Ast::IndexExprcreateIndexExpr (const Ast::Expr &expr, const Ast::Expr &idx)
 Create index expression.
Ast::IndexExprcreateIndexKeyExpr (const Ast::Expr &expr, const TokenData &idx)
 Create index key expression.
Ast::PrefixOpExprcreatePrefixOpExpr (const z::string &op, const Ast::Expr &rhs)
 Create prefix operator expression.
Ast::PostfixOpExprcreatePostfixOpExpr (const Ast::Expr &lhs, const z::string &op)
 Create postfix operator expression.
Ast::StringFormatExprcreateStringFormatExpr (const Ast::Expr &format, const Ast::DictList &list)
 Create string format expression.
Ast::ListExprcreateListExpr (const Ast::ListList &list)
 Create list expression.
Ast::DictExprcreateDictExpr (const Ast::DictList &list)
 Create dictionary expression.
Ast::TreeExprcreateTreeExpr (const Ast::DictList &list)
 Create tree expression.
Ast::VariableRefcreateVariableRef (const Ast::Storage::T &storage, const Ast::VariableDef &vdef)
 Create variable reference node.
Ast::VariableRefcreateVariableRef (const zbl::TokenData &name)
 Create variable reference node.
Ast::VariableRefaddVariableDefToList (Ast::VariableRef &vref, const zbl::TokenData &name)
 Add child to variable reference list.
Ast::VariableRefExprcreateVariableRefExpr (const Ast::VariableRef &vref)
 Create variable reference expression.
Ast::ExprcreateEnumRefExpr (const Ast::TypeSpec &typeSpec, const zbl::TokenData &id)
 Create enum reference expression.
void enterStructInit (const Ast::TypeSpec &typeSpec)
 Enter struct initialization.
Ast::StructInitItemcreateStructInitItem (const zbl::TokenData &name, const Ast::Expr &expr)
 Create struct initializaton item.
Ast::StructInitListaddStructInitItemToList (Ast::StructInitList &list, const Ast::StructInitItem &item)
 Add struct initialization item to list.
Ast::StructInitListcreateStructInitList ()
 Create empty struct initialization item list.
Ast::StructInitExprcreateStructInitExpr (const Ast::StructInitList &initList)
 Create struct initialization expression.
Ast::StructInitExprcreateStructInitEmptyExpr ()
 Create empty struct initialization expression.
Ast::InstanceExprcreateInstanceExpr (const Ast::TypeSpec &typeSpec, const Ast::ExprList &exprList)
 Create instance creation expression.
const Ast::QualifiedTypegetInternalCallType (const TokenData &name, const Ast::ExprList &exprList)
 get return type of internal function call
Ast::InternalCallExprcreateInternalCallExpr (const TokenData &name, const Ast::ExprList &exprList)
 Create internal function call expression.
Ast::InvokerCallExprcreateInvokerCallExpr (const Ast::Invoker &invoker)
 Create invoker call expression.
Ast::FunctionCallExprcreateFunctionCallExpr (Ast::ContinuationImplItem &continuation)
 Create function call expression.
Ast::InvokercreateInvoker (const Ast::InvokerType &invokerType, const Ast::ExprList &exprList)
 Create invoker.
Ast::FunctionCallcreateFunctionCall (const Ast::TypeSpec &typeSpec)
 Create function call invoker.
Ast::FunctionDefCallcreateFunctionDefCall (const Ast::ImplItem &item)
 Create function def invoker.
Ast::FunctionImplCallcreateFunctionImplCall (const Ast::ImplItem &item)
 Create function implementation invoker.
Ast::FunctorCallcreateFunctorExprCall (const Ast::Expr &expr)
 Create functor invoker.
Ast::FunctorCallcreateFunctorObjectCall (const Ast::VariableRef &vref)
 Create functor invoker.
Ast::NumericConstantExprcreateNumericConstantExpr (const z::string &typestr, const z::string &val)
 Create numeric constant expression.
Ast::BooleanConstantExprcreateBooleanConstantExpr (const z::string &val)
 Create boolean constant expression.
Ast::CharConstantExprcreateCharConstantExpr (const z::string &val)
 Create char constant expression.
Ast::StringConstantExprcreateStringConstantExpr (const zbl::TokenData &token)
 Create string constant expression.
Ast::ExprStatementcreateExprStatement (const Ast::Expr &expr)
 Create expression statement.
Ast::StatementBlockcreateStatementBlock (const Ast::StatementList &list)
 Create statement block.
Ast::DefineVarStatementcreateDefineVarStatement (Ast::InitVariableDef &vdef)
 Create local variable definition statement.
Ast::IfThenStatementcreateIfThenStatement (const Ast::Expr &cond, const Ast::StatementList &tlist)
 Create if-then statement.
Ast::IfElseStatementcreateIfElseStatement (const Ast::Expr &cond, const Ast::StatementList &tlist, const Ast::StatementList &flist)
 Create if-then-else statement.
Ast::IfElseStatementcreateIfElseIfStatement (const Ast::Expr &cond, const Ast::StatementList &tlist, Ast::Statement &fstmt)
 Create if-else-if ladder statement.
Ast::SelectStatementcreateSelectStatement (const Ast::SwitchLabelList &list)
 Create select statement.
Ast::SwitchStatementcreateSwitchStatement (const Ast::Expr &expr, const Ast::SwitchLabelList &list)
 Create switch statement.
Ast::SwitchLabelListcreateSwitchLabelList ()
 Create empty switch label list.
Ast::CaseLabelcreateCaseLabel (const Ast::Expr &expr, const Ast::StatementList &list)
 Create switch case label.
Ast::DefaultLabelcreateDefaultLabel (const Ast::StatementList &list)
 Create switch default label.
Ast::ForStatementcreateForStatement (const Ast::InitVariableDef &init, const Ast::Expr &cond, const Ast::Expr &incx, const Ast::StatementList &list)
 Create for statement.
Ast::ForeachStatementcreateForeachStatement (const Ast::InitVariableDef &init, const Ast::StatementList &list)
 Create foreach statement.
Ast::WhileStatementcreateWhileStatement (const Ast::Expr &cond, const Ast::StatementList &list)
 Create while statement.
Ast::DoWhileStatementcreateDoWhileStatement (const Ast::Expr &cond, const Ast::StatementList &list)
 Create do-while statement.
Ast::LogStatementcreateLogStatement (const z::string &name, const Ast::ExprList &list)
 Create log statement.
Ast::BreakStatementcreateBreakStatement ()
 Create break statement.
Ast::ContinueStatementcreateContinueStatement ()
 Create continue statement.
Ast::EmptyStatementcreateEmptyStatement ()
 Create empty statement.
Ast::RoutineReturnStatementcreateRoutineReturnStatement (const Ast::Expr &expr)
 Create routine return statement.
Ast::FunctionReturnStatementcreateFunctionReturnStatement (const Ast::ExprList &list)
 Create function return statement.
Ast::TypeSpecStatementcreateTypeSpecStatement (const Ast::TypeSpec &typeSpec)
 Create type definition statement.
Ast::TypeSpecStatementcreateFunctionImplStatement (const Ast::ImplItem &item)
 Create function implementation statement.
Ast::ScopeenterInParamScope ()
 Enter in-param scope.
void leaveInParamScope ()
 Leave in-param scope.
Ast::ScopeenterBlockScope ()
 Enter block scope.
void leaveBlockScope ()
 Leave block scope.
Ast::ScopeenterContinuation ()
 Leave continuation scope.
Ast::ContinuationImplItemleaveContinuation (Ast::ContinuationImplItem &continuation)
 Leave continuation scope.
Ast::StatementListenterStatementList (Ast::Statement &stmt)
 Enter statement list scope.
Ast::StatementListleaveStatementList (Ast::StatementList &list)
 Leave statement list scope.
Ast::StatementListcreateEmptyStatementList ()
 Create empty statement list.
Ast::StatementListaddStatement (Ast::StatementList &list, Ast::Statement &stmt)
 Add statement to statement list.
void setProjectDef (const Ast::StructInitExpr &expr)
 When parsing a project file, set the root expression.

Public Attributes

TypeDefaultValueMap _typeDefaultValueMap
 Type to default mapping instance.

Private Types

typedef z::stack< ImportFrameImportStack
 Stack type for import frame.
typedef z::dict< z::string,
Ast::QualifiedType * > 
QualifiedTypeMap
 Type for mapping standard qualified types.
typedef z::list< const
Ast::TypeSpec * > 
CoertionList
 Type for maintaining coertion list.
typedef z::dict< const
Ast::TypeSpec *, const
Ast::TypeSpec * > 
CoertionSubMap
 Type for maintaining coertion sub map.
typedef z::dict< const
Ast::TypeSpec
*, CoertionSubMap
CoertionMap
 Type for maintaining coertion mapping.
typedef z::stack< const
Ast::StructDef * > 
StructInitStack
 Type of struct init stack.
typedef z::stack< Ast::Scope * > ScopeStack
 Type of scope stack.
typedef z::stack
< Ast::GrammarLexer * > 
GrammarLexerStack
 Type of grammar lexer stack.

Private Member Functions

z::string err (const int &line, const int &col) const
 Return an error string.
void importHeaderFile (const Ast::ImportStatement &stmt, const Ast::ImportStatement::Type &type)
 Compiles a import file.
Ast::NamespaceaddChildNamespace (Ast::ChildTypeSpec &type, const z::string &name)
 Add a child namespace to current namespace.
Ast::ChildTypeSpecgetParent (Ast::ChildTypeSpec *child)
 Get parent of specified type.
Ast::ChildTypeSpecgetParent (Ast::ChildTypeSpec &child)
 Get parent of specified type.
Ast::QualifiedTypegetQualifiedType (const z::string &name)
 Create or get standard qualified type.
int getTypeIndex (const Ast::QualifiedType &type) const
 Get int index of specified type in the coertion list.
const Ast::TypeSpecgetTarget (const Ast::QualifiedType &lhs, const Ast::QualifiedType &rhs)
 Get the target for a coertion.
const Ast::VariableDefhasUdtMember (const Ast::UserDefinedTypeSpec &udt, const z::string &name) const
 Check if given UDT has specified member variable.
const Ast::VariableDefhasMember (const Ast::VariableDef &vd, const zbl::TokenData &name) const
 Check if a variable has specified member variable.
Ast::ExprgetEnumRefExpr (const Ast::EnumDef &enumRef, const z::string &id)
 Create a expression node for reference to enum member.
bool isAny (const Ast::QualifiedType &rhs)
 Check if specified type is of 'any' type.
const Ast::QualifiedTypecoerce (const Ast::QualifiedType &lhs, const Ast::QualifiedType &rhs)
 Coerce two types to one type if possible.
Ast::SharedVariableDefcreateSharedVariableDef (const Ast::QualifiedType &qtype, const z::string &name, const Ast::Expr &expr)
 Create AST node for shared variable definition.
Ast::VariableDefaddVariableDef (const Ast::VariableDef::DefType &defType, const Ast::QualifiedType &type, const z::string &name)
 Add AST node for variable definition in current scope.
Ast::VariableDefaddVariableDef (Ast::VariableDef &vdef)
 Add AST node for variable definition in current scope.
template<typename T >
T & addChildLevel (T &t)
 Add child type to current type.
template<typename T >
T & enterTypeSpec (T &t)
 Enter type definition.
template<typename T >
T & leaveTypeSpec (T &t)
 Leave type definition.
Ast::GrammarLexerenterLexerState (const z::string &name)
 Enter lexer state.
void addOutParamChild (Ast::MethodTypeSpec &rv, const Ast::QualifiedType &out) const
 Add out-param as a child of function definition.
template<typename BlockT , typename ImplT >
ImplT & createImplItemT (Ast::FunctionDef &fdef, const BlockT &block)
 Create implementation item.
template<typename BlockT , typename ImplT >
ImplT & leaveFunctionT (Ast::FunctionDef &fdef, const BlockT &block)
 Create function implementation item.
const Ast::AnyExprcreateVarExpr (const Ast::Expr &expr)
 Create 'any' type expression.
const Ast::CastExprcreateCastExpr (const Ast::Expr &expr)
 Create typecast expression.
const Ast::VariableDefaddClosureVariableDef (const Ast::QualifiedType &type, const zbl::TokenData &name)
 Create closure variable definition.
const Ast::ExprconvertToQueryConstant (const Ast::Expr &expr)
 Convert an expression to a query constant.
bool isQueryType (const Ast::QualifiedType &type)
 Check if expression is a query type.
Ast::ScopeenterScope (const Ast::Scope::Type &type)
 Enter scope.
void leaveScope (const Ast::Scope::Type &type)
 Leave scope.
void resetCurrentVDef ()
 Reset current variable definition.

Private Attributes

ImportStack _importStack
 Import frame stack.
QualifiedTypeMap _qualifiedTypeMap
 Map of standard qualified types to name.
CoertionList _coertionList
 Coertion list.
CoertionMap _coertionMap
 Coertion mapping.
StructInitStack _structInitStack
 struct initialization stack
zbl::Compiler_compiler
 The compiler instance.
Ast::Unit_unit
 The unit to read into.
ScopeStack _scopeStack
 The scope stack.
GrammarLexerStack _grammarLexerStack
 The grammar lexer stack.
Ast::InitVariableDef_curr_vdef
 The current vdef.
Token _nullToken
 A null token.

Detailed Description

The Parser Context.


Constructor & Destructor Documentation

ParseContext ( zbl::Compiler compiler,
Ast::Unit unit 
) [inline]

Default constructor.

Parameters:
compilerThe invoking compiler instance
unitThe AST unit node into which to parse the unit

Member Function Documentation

T& addChildLevel ( T &  t) [inline, private]

Add child type to current type.

Parameters:
tThe child type
Returns:
The child type AST node
Ast::Namespace& addChildNamespace ( Ast::ChildTypeSpec type,
const z::string name 
) [inline, private]

Add a child namespace to current namespace.

Parameters:
typeChild namespace type
nameThe child namespace name
Returns:
The child namespace instance
Ast::ClosureList& addClosureToList ( Ast::ClosureList list,
const Ast::Closure::Type type,
Ast::Closure closure 
) [inline]

Add a closure to closure list.

Parameters:
listThe list to add to
typeThe join type
closureThe closure to add
Returns:
The AST node of the list
const Ast::VariableDef& addClosureVariableDef ( const Ast::QualifiedType type,
const zbl::TokenData name 
) [inline, private]

Create closure variable definition.

Parameters:
typeThe type of the variable
nameThe variable name
Returns:
The AST node
void addCoertionItem ( const Ast::TypeSpec type) [inline]

Add type to coertion list.

Parameters:
typeType to add to coertion list
void addCoertionMap ( const Ast::TypeSpec lhs,
const Ast::TypeSpec rhs,
const Ast::TypeSpec dst 
) [inline]

Add coertion mapping.

For example, short and int maps to int.

Parameters:
lhsType to map from
rhsType to map to
dstFinal mapping
void addDictItem ( Ast::DictList list,
const Ast::DictItem item 
) [inline]

Add item to dictionary.

Parameters:
listdictionary to add to
itemThe item to add
Returns:
The AST node
Ast::GrammarOptionValueList& addGrammarOptionValue ( Ast::GrammarOptionValueList list,
const TokenData value 
) [inline]

Add value to grammar option list.

Parameters:
listGrammar option value list
valueOption value to add
Returns:
The AST node
void addListItem ( Ast::ListList list,
const Ast::ListItem item 
) [inline]

Add item to list.

Parameters:
listList to add to
itemThe item to add
Returns:
The AST node
void addOutParamChild ( Ast::MethodTypeSpec rv,
const Ast::QualifiedType out 
) const [inline, private]

Add out-param as a child of function definition.

If out is a OutParam, add it as a child of functiondef.

Parameters:
rvThe function definition type
outThe out parameter
Returns:
The AST node
Ast::StatementList& addStatement ( Ast::StatementList list,
Ast::Statement stmt 
) [inline]

Add statement to statement list.

Parameters:
listStatement list
stmtFirst statement to add
Returns:
AST node of statement list
Ast::StructInitList& addStructInitItemToList ( Ast::StructInitList list,
const Ast::StructInitItem item 
) [inline]

Add struct initialization item to list.

Parameters:
listThe struct initialization list
itemThe initialization item
Returns:
The AST node
void addTreeItem ( Ast::DictList list,
const Ast::DictItem item 
) [inline]

Add item to tree.

Parameters:
listtree to add to
itemThe item to add
Returns:
The AST node
void addTypeDefaultValue ( const Ast::TypeSpec type,
const Ast::Expr expr 
) [inline]

Add default value for type.

Parameters:
typeThe type
exprThe default value
Ast::Namespace& addUnitNamespace ( Ast::Namespace ns,
const z::string name 
) [inline]

Add a child namespace to current namespace.

Parameters:
nsThe parent namespace
nameThe namespace name
Returns:
The child namespace type
Ast::VariableDef& addVariableDef ( const Ast::VariableDef::DefType defType,
const Ast::QualifiedType type,
const z::string name 
) [inline, private]

Add AST node for variable definition in current scope.

Parameters:
defTypeThe definition type
typeThe variable type
nameThe variable name
Returns:
The AST node
Ast::VariableDef& addVariableDef ( Ast::VariableDef vdef) [inline, private]

Add AST node for variable definition in current scope.

Parameters:
vdefThe variable definition
Returns:
The AST node
Ast::VariableRef& addVariableDefToList ( Ast::VariableRef vref,
const zbl::TokenData name 
) [inline]

Add child to variable reference list.

Parameters:
vrefThe variable reference
nameThe child reference
Returns:
The AST node
const Ast::QualifiedType& coerce ( const Ast::QualifiedType lhs,
const Ast::QualifiedType rhs 
) [inline, private]

Coerce two types to one type if possible.

Parameters:
lhsFirst type
rhsSecond type
Returns:
Coerced type
const Ast::Expr& convertToQueryConstant ( const Ast::Expr expr) [inline, private]

Convert an expression to a query constant.

Parameters:
exprExpression to convert
Returns:
The AST node of the converted expression
Ast::BinaryExpr& createBinaryOpExpr ( const Ast::Expr lhs,
const z::string op,
const Ast::Expr rhs 
) [inline]

Create ternary expression.

Parameters:
lhsThe LHS expression
opThe operator
rhsThe RHS expression
Returns:
The AST node
Ast::BooleanConstantExpr& createBooleanConstantExpr ( const z::string val) [inline]

Create boolean constant expression.

Parameters:
valThe value of the constant
Returns:
The AST node
Ast::BreakStatement& createBreakStatement ( ) [inline]

Create break statement.

Returns:
The AST node
Ast::CallClosure& createCallClosure ( const Ast::Invoker fcall) [inline]

Create call closure.

Parameters:
fcallThe invoker
Returns:
The AST node
Ast::CaseLabel& createCaseLabel ( const Ast::Expr expr,
const Ast::StatementList list 
) [inline]

Create switch case label.

Parameters:
exprThe case expression
listThe statement list
Returns:
The AST node
const Ast::CastExpr& createCastExpr ( const Ast::Expr expr) [inline, private]

Create typecast expression.

Parameters:
exprValue to be casted
Returns:
The AST node
Ast::CharConstantExpr& createCharConstantExpr ( const z::string val) [inline]

Create char constant expression.

Parameters:
valThe value of the constant
Returns:
The AST node
Ast::ClosureList& createClosureList ( Ast::Closure closure) [inline]

Create closure list.

Parameters:
closureClosure to add to list
Returns:
The AST node
Ast::ContinuationImplItem& createContinuationImplItem ( Ast::ClosureList closureList,
const Ast::ReturnClosure retnClosure 
) [inline]

Create a continuation implementation item.

Parameters:
closureListThe list of closures in the list
retnClosureThe return closure
Returns:
The AST node of the continuation implementation item
Ast::ContinuationImplItem& createContinuationImplItem ( Ast::ClosureList closureList) [inline]

Create a continuation implementation item without a return closure.

Create a default return closure

Parameters:
closureListThe list of closures in the list
Returns:
The AST node of the continuation implementation item
Ast::ContinueStatement& createContinueStatement ( ) [inline]

Create continue statement.

Returns:
The AST node
Ast::DefaultLabel& createDefaultLabel ( const Ast::StatementList list) [inline]

Create switch default label.

Parameters:
listThe statement list
Returns:
The AST node
Ast::ReturnClosure& createDefaultReturnClosure ( const Ast::Closure::Type type,
Ast::FunctionDef fdef 
) [inline]

Create default return closure.

For continuations that do not have a return closure, create one with default values

Parameters:
typeReturn type
fdefFunction definition to return from
Returns:
The AST node
Ast::DefineVarStatement& createDefineVarStatement ( Ast::InitVariableDef vdef) [inline]

Create local variable definition statement.

Parameters:
vdefThe variable definition
Returns:
The AST node
Ast::DictExpr& createDictExpr ( const Ast::DictList list) [inline]

Create dictionary expression.

Parameters:
listThe values list
Returns:
The AST node
Ast::DictItem& createDictItem ( const Ast::Expr key,
const Ast::Expr expr 
) [inline]

Create dictionary item.

Parameters:
keyKey of item
exprValue of item
Returns:
The AST node
Ast::DictList& createDictList ( ) [inline]

Create empty dictionary.

Returns:
The AST node
Ast::DictTemplate& createDictTemplate ( const Ast::QualifiedType key,
const Ast::QualifiedType type 
) [inline]

Create dictionary type.

Parameters:
keyThe type of the key
typeType of contained element
Returns:
The AST node
Ast::DoWhileStatement& createDoWhileStatement ( const Ast::Expr cond,
const Ast::StatementList list 
) [inline]

Create do-while statement.

Parameters:
condThe condition expression
listThe statement list
Returns:
The AST node
Ast::EmptyStatement& createEmptyStatement ( ) [inline]

Create empty statement.

Returns:
The AST node
Ast::StatementList& createEmptyStatementList ( ) [inline]

Create empty statement list.

Returns:
AST node of statement list
Ast::EnumDef& createEnumDef ( const Ast::TypeSpec::AccessType::T accessType,
const z::string name,
Ast::EnumMemberDefList defList 
) [inline]

Create enum definition with list of variable definitions.

Parameters:
accessTypeThe access type
nameThe enum name
defListThe member variable definition list
Returns:
The AST node
Ast::EnumMemberDef& createEnumMemberDef ( const zbl::TokenData name) [inline]

Create enum member definition with init value.

Parameters:
nameThe member variable name
Returns:
The AST node
Ast::EnumMemberDef& createEnumMemberDefInit ( const zbl::TokenData name,
const bool &  hasInit,
const Ast::Expr initExpr 
) [inline]

Create enum member definition with init value.

Parameters:
nameThe member variable name
hasInitTrue if it has an initial value
initExprInitial value expression
Returns:
The AST node
Ast::EnumMemberDefList& createEnumMemberDefList ( ) [inline]

Create enum member definition list.

Returns:
The AST node
Ast::Expr& createEnumRefExpr ( const Ast::TypeSpec typeSpec,
const zbl::TokenData id 
) [inline]

Create enum reference expression.

Parameters:
typeSpecThe enum reference
idThe member id.
Returns:
The AST node
Ast::ExitClosure& createExitClosure ( ) [inline]

Create exit closure.

Returns:
The AST node
Ast::ExprList& createExprList ( ) [inline]

Create expression list.

Returns:
The AST node
Ast::ExprStatement& createExprStatement ( const Ast::Expr expr) [inline]

Create expression statement.

Parameters:
exprThe expression
Returns:
The AST node
Ast::InitVariableDef& createForeachInitVariableDef ( const Ast::VariableDef::DefType defType,
const z::string name,
const Ast::Expr expr 
) [inline]

Create AST node for for-loop variable declaration without type specified.

Derives type of variable from the indexable type of the container. For example:

            foreach(x in mylist) {
            }

Here the type of x will be the type of the element contained in mylist.

Parameters:
defTypeThe definition type
nameName of member
exprThe list variable
Returns:
The AST node
Ast::ForeachStatement& createForeachStatement ( const Ast::InitVariableDef init,
const Ast::StatementList list 
) [inline]

Create foreach statement.

Parameters:
initThe initialization expression
listThe statement list
Returns:
The AST node
Ast::ForStatement& createForStatement ( const Ast::InitVariableDef init,
const Ast::Expr cond,
const Ast::Expr incx,
const Ast::StatementList list 
) [inline]

Create for statement.

Parameters:
initThe initialization expression
condThe condition expression
incxThe increment expression
listThe statement list
Returns:
The AST node
Ast::FunctionBlock& createFunctionBlock ( const Ast::StatementList list) [inline]

Create function block.

Parameters:
listList of statements in block
Returns:
The AST node
Ast::FunctionCall& createFunctionCall ( const Ast::TypeSpec typeSpec) [inline]

Create function call invoker.

Parameters:
typeSpecThe function def to invoke
Returns:
The AST node
Ast::FunctionCallClosure& createFunctionCallClosure ( const zbl::TokenData name,
const Ast::Invoker fcall 
) [inline]

Create function call closure.

Parameters:
nameThe variable name
fcallThe invoker
Returns:
The AST node
Ast::FunctionCallClosure& createFunctionCallClosure ( const Ast::Invoker fcall) [inline]

Create function call closure.

Parameters:
fcallThe invoker
Returns:
The AST node
Ast::FunctionCallExpr& createFunctionCallExpr ( Ast::ContinuationImplItem continuation) [inline]

Create function call expression.

Parameters:
continuationThe continuation representing the function call.
Returns:
The AST node
Ast::FunctionDefCall& createFunctionDefCall ( const Ast::ImplItem item) [inline]

Create function def invoker.

Parameters:
itemThe implementation item to invoke
Returns:
The AST node
Ast::FunctionDefImplExpr& createFunctionDefImplExpr ( Ast::ImplItem item) [inline]

Create function definition implementation expression.

Parameters:
itemThe function implementation
Returns:
The expression AST node
Ast::FunctionImplCall& createFunctionImplCall ( const Ast::ImplItem item) [inline]

Create function implementation invoker.

Parameters:
itemThe implementation item to invoke
Returns:
The AST node
Ast::FunctionImplExpr& createFunctionImplExpr ( Ast::FunctionImplItem item) [inline]

Create function implementation expression.

Parameters:
itemThe function implementation
Returns:
The expression AST node
Ast::TypeSpecStatement& createFunctionImplStatement ( const Ast::ImplItem item) [inline]

Create function implementation statement.

Parameters:
itemThe implementation item
Returns:
The AST node
Ast::FunctionReturnStatement& createFunctionReturnStatement ( const Ast::ExprList list) [inline]

Create function return statement.

Parameters:
listThe return expression list
Returns:
The AST node
Ast::FunctorCall& createFunctorExprCall ( const Ast::Expr expr) [inline]

Create functor invoker.

Parameters:
exprThe functor object to invoke
Returns:
The AST node
Ast::FunctorCall& createFunctorObjectCall ( const Ast::VariableRef vref) [inline]

Create functor invoker.

Parameters:
vrefThe variable reference to the functor
Returns:
The AST node
Ast::GrammarBlock& createGrammarBlock ( const Ast::GrammarOptionList optList,
const Ast::GrammarStatementList list,
const Ast::GrammarLexerList lexList 
) [inline]

Create grammar block.

Parameters:
optListList of options in grammar block
listList of rule statements in block
lexListList of lexer in grammar block
Returns:
The AST node
Ast::GrammarLexerList& createGrammarLexerList ( ) [inline]

Create empty grammar lexer list.

Returns:
The AST node
Ast::GrammarMemberId& createGrammarMemberId ( const TokenData name) [inline]

Create grammar member id node.

Parameters:
namemember name
Returns:
The AST node
Ast::GrammarMemberList& createGrammarMemberList ( ) [inline]

Create empty grammar member list.

Returns:
The AST node
const Ast::VariableDef& createGrammarMemberNameDef ( const TokenData name) [inline]

Create grammar member name node.

Parameters:
namemember name token
Returns:
The AST node
Ast::GrammarMemberNameId& createGrammarMemberNameId ( const TokenData name,
const TokenData txt 
) [inline]

Create grammar member node.

Parameters:
namemember name
txtThe member txt
Returns:
The AST node
Ast::GrammarOption& createGrammarOption ( const TokenData name,
const Ast::GrammarOptionValueList list 
) [inline]

Create grammar option.

Parameters:
nameOption name
listList of option values
Returns:
The AST node
Ast::GrammarOptionList& createGrammarOptionList ( ) [inline]

Create empty grammar option list.

Returns:
The AST node
Ast::GrammarOptionValueList& createGrammarOptionValueList ( const TokenData value) [inline]

Create grammar option list.

Parameters:
valueOption value to add
Returns:
The AST node
Ast::GrammarStatementList& createGrammarStatementList ( ) [inline]

Create empty grammar statement list.

Returns:
The AST node
Ast::GrammarToken& createGrammarToken ( const TokenData name,
const TokenData txt,
const bool &  isRex,
const bool &  isNot 
) [inline]

Create grammar token node.

Parameters:
nameToken name
txtToken text
isRexTrue if this is a regex token
isNotTrue if this is a not token
Returns:
The AST node
Ast::GrammarTokenList& createGrammarTokenList ( ) [inline]

Create empty grammar token list.

Returns:
The AST node
Ast::IfElseStatement& createIfElseIfStatement ( const Ast::Expr cond,
const Ast::StatementList tlist,
Ast::Statement fstmt 
) [inline]

Create if-else-if ladder statement.

Parameters:
condThe condition expression
tlistThe true statement list
fstmtThe else-if statement
Returns:
The AST node
Ast::IfElseStatement& createIfElseStatement ( const Ast::Expr cond,
const Ast::StatementList tlist,
const Ast::StatementList flist 
) [inline]

Create if-then-else statement.

Parameters:
condThe condition expression
tlistThe true statement list
flistThe false statement list
Returns:
The AST node
Ast::IfThenStatement& createIfThenStatement ( const Ast::Expr cond,
const Ast::StatementList tlist 
) [inline]

Create if-then statement.

Parameters:
condThe condition expression
tlistThe true statement list
Returns:
The AST node
ImplT& createImplItemT ( Ast::FunctionDef fdef,
const BlockT &  block 
) [inline, private]

Create implementation item.

Parameters:
fdefThe function definition
blockThe function block
Returns:
The AST node
Ast::ImportStatement& createImportNamespace ( const z::string name) [inline]

Enters an import level.

Parameters:
nameThe import file name
Returns:
The import statement
Ast::IndexExpr& createIndexExpr ( const Ast::Expr expr,
const Ast::Expr idx 
) [inline]

Create index expression.

Parameters:
exprThe container expression
idxThe index expression
Returns:
The AST node
Ast::IndexExpr& createIndexKeyExpr ( const Ast::Expr expr,
const TokenData idx 
) [inline]

Create index key expression.

Parameters:
exprThe container expression
idxThe index expression
Returns:
The AST node
Ast::InitVariableDef& createInitVariableDef ( const Ast::VariableDef::DefType defType,
const z::string name,
const Ast::Expr expr 
) [inline]

Create AST node for local variable declaration without type specified.

Parameters:
defTypeThe type
nameName of member
exprInit value
Returns:
The AST node
Ast::InitVariableDef& createInitVariableDefInit ( const Ast::VariableDef::DefType defType,
const Ast::QualifiedType type,
const z::string name,
const Ast::Expr expr 
) [inline]

Create AST node for local variable declaration with type specified.

Parameters:
defTypeThe definition type
typeThe type
nameName of member
exprInit value
Returns:
The AST node
Ast::InstanceExpr& createInstanceExpr ( const Ast::TypeSpec typeSpec,
const Ast::ExprList exprList 
) [inline]

Create instance creation expression.

Creates an instance of different types like struct, function, list, etc

Parameters:
typeSpecThe struct type
exprListThe initialization value list
Returns:
The AST node
Ast::InternalCallExpr& createInternalCallExpr ( const TokenData name,
const Ast::ExprList exprList 
) [inline]

Create internal function call expression.

Parameters:
nameName of function
exprListThe function call argument value list
Returns:
The AST node
Ast::Invoker& createInvoker ( const Ast::InvokerType invokerType,
const Ast::ExprList exprList 
) [inline]

Create invoker.

Parameters:
invokerTypeThe invocation type
exprListThe argument list
Returns:
The AST node
Ast::InvokerCallExpr& createInvokerCallExpr ( const Ast::Invoker invoker) [inline]

Create invoker call expression.

Parameters:
invokerThe invoker to call
Returns:
The AST node
Ast::LexerStatementList& createLexerStatementList ( ) [inline]

Create empty lexer statement list.

Returns:
The AST node
Ast::ListExpr& createListExpr ( const Ast::ListList list) [inline]

Create list expression.

Parameters:
listThe values list
Returns:
The AST node
Ast::ListItem& createListItem ( const Ast::Expr expr) [inline]

Create list item.

Parameters:
exprValue of item
Returns:
The AST node
Ast::ListList& createListList ( ) [inline]

Create empty list.

Returns:
The AST node
Ast::ListTemplate& createListTemplate ( const Ast::QualifiedType type) [inline]

Create list type.

Parameters:
typeType of contained element
Returns:
The AST node
Ast::LogStatement& createLogStatement ( const z::string name,
const Ast::ExprList list 
) [inline]

Create log statement.

Parameters:
nameName of log target
listThe list of expressions to log
Returns:
The AST node
Ast::LoopClosure& createLoopClosure ( const Ast::Expr expr) [inline]

Create loop closure.

Parameters:
exprLoop confition expression
Returns:
The AST node
Ast::CallClosure& createNamedCallClosure ( const zbl::TokenData name,
const Ast::Invoker fcall 
) [inline]

Create named call closure.

Parameters:
nameThe variable name
fcallThe invoker
Returns:
The AST node
Ast::NumericConstantExpr& createNumericConstantExpr ( const z::string typestr,
const z::string val 
) [inline]

Create numeric constant expression.

Parameters:
typestrThe type of the constant
valThe value of the constant
Returns:
The AST node
Ast::OrderedExpr& createOrderedExpr ( const Ast::Expr rhs) [inline]

Create ordered expression.

Parameters:
rhsThe inner expression
Returns:
The AST node
Ast::QualifiedType& createOutParam ( const Ast::VariableDefMap defList) [inline]

Create AST node for out parameter.

Parameters:
defListThe list of variable definitions in the out-parameter
Returns:
The AST node
Ast::OwnerTemplate& createOwnerTemplate ( const Ast::QualifiedType type) [inline]

Create owner type.

Parameters:
typeType of contained element
Returns:
The AST node
Ast::ParamVariableDef& createParamVariableDef ( const Ast::QualifiedType type,
const z::string name 
) [inline]

Create AST node for struct member without init value.

This function gets and uses default value for type

Parameters:
typeThe type
nameName of member
Returns:
The AST node
Ast::ParamVariableDef& createParamVariableDefInit ( const Ast::QualifiedType type,
const z::string name,
const Ast::Expr expr 
) [inline]

Create AST node for function in-parameter with init value.

Parameters:
typeThe type
nameName of member
exprInit value
Returns:
The AST node
Ast::PostfixOpExpr& createPostfixOpExpr ( const Ast::Expr lhs,
const z::string op 
) [inline]

Create postfix operator expression.

Parameters:
lhsThe operand
opThe prefix operator
Returns:
The AST node
Ast::PrefixOpExpr& createPrefixOpExpr ( const z::string op,
const Ast::Expr rhs 
) [inline]

Create prefix operator expression.

Parameters:
opThe prefix operator
rhsThe operand
Returns:
The AST node
Ast::QualifiedType& createQualifiedType ( const bool &  isConst,
const Ast::TypeSpec type,
const bool &  isRef 
) [inline]

Create qualified type.

Parameters:
isConstTrue if type is a const
typeThe typespec
isRefTrue if this should be a reference
Returns:
The qualified type
Ast::QueryExpr& createQueryExpr ( const Ast::Expr expr) [inline]

Create query expression.

Parameters:
exprThe query expression
Returns:
The AST node
Ast::QueryPartExpr& createQueryPartExpr ( const Ast::Expr keyExpr,
const Ast::Expr valExpr 
) [inline]

Create query pair expression.

Parameters:
keyExprThe key expression
valExprThe value expression
Returns:
The AST node
Ast::QueryValExpr& createQueryValExpr ( ) [inline]

Create query value expression.

Returns:
The AST node
Ast::ReturnClosure& createReturnClosure ( const Ast::Closure::Type type,
const Ast::ExprList list 
) [inline]

Create return closure.

Parameters:
typeReturn type
listList of values to return
Returns:
The AST node
Ast::RoutineBlock& createRoutineBlock ( Ast::StatementList list) [inline]

Create routine block.

Parameters:
listList of statements in block
Returns:
The AST node
Ast::RoutineReturnStatement& createRoutineReturnStatement ( const Ast::Expr expr) [inline]

Create routine return statement.

Parameters:
exprThe return expression
Returns:
The AST node
Ast::RunClosure& createRunClosure ( ) [inline]

Create run closure.

Returns:
The AST node
Ast::SelectStatement& createSelectStatement ( const Ast::SwitchLabelList list) [inline]

Create select statement.

Parameters:
listThe label list
Returns:
The AST node
Ast::SharedClosure& createSharedClosure ( const zbl::TokenData name,
const Ast::SharedDef sharedList 
) [inline]

Create shared closure.

Parameters:
nameThe variable name
sharedListThe list of shared definitions
Returns:
The AST node
Ast::SharedDef& createSharedDef ( const Ast::VariableDefMap defList) [inline]

Create AST node for shared definition type.

Parameters:
defListThe variable definition list
Returns:
The AST node
Ast::SharedVariableDef& createSharedExprDef ( const zbl::TokenData name,
const Ast::Expr expr 
) [inline]

Create AST node for shared variable definition.

Parameters:
nameName of member
exprInit value
Returns:
The AST node
Ast::SharedVariableDef& createSharedMemberDef ( const Ast::VariableRef vref) [inline]

Create AST node for a member of a shared variable definition.

Parameters:
vrefVariable reference
Returns:
The AST node
Ast::SharedVariableDef& createSharedTypeExprDef ( const Ast::QualifiedType qtype,
const zbl::TokenData name,
const Ast::Expr expr 
) [inline]

Create AST node for shared variable definition.

Parameters:
qtypeThe type
nameName of member
exprInit value
Returns:
The AST node
Ast::SharedVariableDef& createSharedVariableDef ( const Ast::QualifiedType qtype,
const z::string name,
const Ast::Expr expr 
) [inline, private]

Create AST node for shared variable definition.

Parameters:
qtypeThe type
nameName of member
exprInit value
Returns:
The AST node
Ast::StatementBlock& createStatementBlock ( const Ast::StatementList list) [inline]

Create statement block.

Parameters:
listThe statement list
Returns:
The AST node
Ast::StringConstantExpr& createStringConstantExpr ( const zbl::TokenData token) [inline]

Create string constant expression.

Parameters:
tokenThe string constant value
Returns:
The AST node
Ast::StringFormatExpr& createStringFormatExpr ( const Ast::Expr format,
const Ast::DictList list 
) [inline]

Create string format expression.

Parameters:
formatThe format expression
listThe values list
Returns:
The AST node
Ast::StructDefList& createStructDefList ( ) [inline]

Create AST node for struct definition list.

Returns:
The AST node
Ast::StructInitExpr& createStructInitEmptyExpr ( ) [inline]

Create empty struct initialization expression.

Returns:
The AST node
Ast::StructInitExpr& createStructInitExpr ( const Ast::StructInitList initList) [inline]

Create struct initialization expression.

Parameters:
initListThe initialization list
Returns:
The AST node
Ast::StructInitItem& createStructInitItem ( const zbl::TokenData name,
const Ast::Expr expr 
) [inline]

Create struct initializaton item.

Parameters:
nameName of member to initialize
exprThe value to initialize with
Returns:
The AST node
Ast::StructInitList& createStructInitList ( ) [inline]

Create empty struct initialization item list.

Returns:
The AST node
Ast::StructMemberVariableDef& createStructVariableDef ( const Ast::QualifiedType type,
const z::string name 
) [inline]

Create AST node for struct member without init value.

This function gets the default init value for the type and uses that.

Parameters:
typeThe type
nameName of member
Returns:
The AST node
Ast::StructMemberVariableDef& createStructVariableDefInit ( const Ast::QualifiedType type,
const z::string name,
const Ast::Expr expr 
) [inline]

Create AST node for struct member with init value.

Parameters:
typeThe type
nameName of member
exprInit value
Returns:
The AST node
Ast::SwitchLabelList& createSwitchLabelList ( ) [inline]

Create empty switch label list.

Returns:
The AST node
Ast::SwitchStatement& createSwitchStatement ( const Ast::Expr expr,
const Ast::SwitchLabelList list 
) [inline]

Create switch statement.

Parameters:
exprThe switch expression
listThe label list
Returns:
The AST node
Ast::TernaryOpExpr& createTernaryOpExpr ( const Ast::Expr lhs,
const z::string op1,
const Ast::Expr rhs1,
const z::string op2,
const Ast::Expr rhs2 
) [inline]

Create ternary expression.

Parameters:
lhsThe LHS expression
op1The first operator
rhs1The first RHS expression
op2The second operator
rhs2The second RHS expression
Returns:
The AST node
Ast::TreeExpr& createTreeExpr ( const Ast::DictList list) [inline]

Create tree expression.

Parameters:
listThe values list
Returns:
The AST node
Ast::DictItem& createTreeItem ( const Ast::Expr key,
const Ast::Expr expr 
) [inline]

Create tree item.

Parameters:
keyKey of item
exprValue of item
Returns:
The AST node
Ast::DictList& createTreeList ( ) [inline]

Create empty tree.

Returns:
The AST node
Ast::TypeDecl& createTypeDecl ( const TypeDefSig sig) [inline]

Create typedef declaration.

Parameters:
sigThe typedef signature
Returns:
The AST node
Ast::TypeDef& createTypeDef ( const TypeDefSig sig,
const Ast::QualifiedType type 
) [inline]

Create typedef definition.

Parameters:
sigThe typedef signature
typeThe target type
Returns:
The AST node
TypeDefSig createTypeDefSig ( const Ast::TypeSpec::AccessType::T accessType,
const zbl::TokenData name 
) [inline]

Create typedef signature.

Parameters:
accessTypeThe access type
nameThe typedef name
Returns:
The AST node
Ast::TypeSpecStatement& createTypeSpecStatement ( const Ast::TypeSpec typeSpec) [inline]

Create type definition statement.

Parameters:
typeSpecThe type definition
Returns:
The AST node
const Ast::AnyExpr& createVarExpr ( const Ast::Expr expr) [inline, private]

Create 'any' type expression.

Parameters:
exprValue of any instance
Returns:
The AST node
Ast::VariableDefMap& createVariableDefMap ( ) [inline]

Create AST node for variable definition map.

Returns:
The AST node
Ast::VariableRef& createVariableRef ( const Ast::Storage::T storage,
const Ast::VariableDef vdef 
) [inline]

Create variable reference node.

Parameters:
storageThe storage type of the definition
vdefThe variable definition to refer to
Returns:
The AST node
Ast::VariableRef& createVariableRef ( const zbl::TokenData name) [inline]

Create variable reference node.

Parameters:
nameThe token
Returns:
The AST node
Ast::VariableRefExpr& createVariableRefExpr ( const Ast::VariableRef vref) [inline]

Create variable reference expression.

Parameters:
vrefThe variable reference
Returns:
The AST node
Ast::WhileStatement& createWhileStatement ( const Ast::Expr cond,
const Ast::StatementList list 
) [inline]

Create while statement.

Parameters:
condThe condition expression
listThe statement list
Returns:
The AST node
Ast::WindowBlock& createWindowBlock ( Ast::FunctionBlock functionBlock) [inline]

Create window block.

Parameters:
functionBlockFunction block fr this window definition
Returns:
The AST node
Ast::Scope& enterBlockScope ( ) [inline]

Enter block scope.

Returns:
The AST node
void enterCoertionList ( const Ast::TypeSpec type) [inline]

Enter coertion list.

Parameters:
typeType to add to coertion list
Ast::Scope& enterContinuation ( ) [inline]

Leave continuation scope.

Returns:
The AST node
Ast::ChildTypeSpec& enterCurrentType ( Ast::ChildTypeSpec type) [inline]

Enter a type definition.

Pushes the type on the type stack in the current import frame

Parameters:
typeThe type being defined
Returns:
Reference to type being defined
Ast::FunctionDef& enterFunction ( const Ast::TypeSpec::AccessType::T accessType,
Ast::QualifiedType out,
const zbl::TokenData name,
Ast::Scope in,
const Ast::FunctionDef::Modifier::T modifier 
) [inline]

Enter function definition with token name.

Parameters:
accessTypeThe access type
outOut parameters
nameThe typedef name
inIn-parameters
modifierFunction modifier
Returns:
The AST node
Ast::FunctionDef& enterFunctionImpl ( Ast::TypeSpec type) [inline]

Enter function implementation definition.

Parameters:
typeThe function type being defined
Returns:
The function definiton AST node
Ast::FunctionDef& enterFunctionName ( const Ast::TypeSpec::AccessType::T accessType,
const Ast::QualifiedType out,
const z::string name,
Ast::Scope in,
const Ast::FunctionDef::Modifier::T modifier 
) [inline]

Enter function definition.

Parameters:
accessTypeThe access type
outOut parameters
nameThe typedef name
inIn-parameters
modifierFunction modifier
Returns:
The AST node
Ast::FunctionDef& enterGrammarRule ( const TokenData name,
Ast::Scope in 
) [inline]

Create grammar rule function definition without an out parameter, and enter grammar rule block.

Defaults to int as an out parameter

Parameters:
nameThe grammar rule name
inThe in parameter list
Returns:
The AST node
Ast::FunctionDef& enterGrammarRuleOut ( Ast::QualifiedType out,
const TokenData name,
Ast::Scope in 
) [inline]

Create grammar rule function definition with out parameter.

Parameters:
outThe out parameter
nameThe grammar rule name
inThe in parameter list
Returns:
The AST node
void enterImport ( const Ast::UserDefinedTypeSpec::NativeType ntype,
const z::string fname 
) [inline]

Push an import frame on the stack.

Parameters:
ntypeThe native type for the import
fnameThe import filename
Ast::Scope& enterInParamScope ( ) [inline]

Enter in-param scope.

Returns:
The AST node
Ast::FunctionDef& enterLexer ( const TokenData name,
Ast::Scope in 
) [inline]

Enter lexer.

Parameters:
nameThe lexer name
inThe in parameters
Returns:
The AST node
Ast::GrammarLexer& enterLexerState ( ) [inline]

Enter default lexer state.

Returns:
The AST node
Ast::GrammarLexer& enterLexerState ( const TokenData name) [inline]

Enter lexer state.

Parameters:
nameThe lexer name
Returns:
The AST node
Ast::GrammarLexer& enterLexerState ( const z::string name) [inline, private]

Enter lexer state.

Parameters:
nameThe lexer name
Returns:
The AST node
Ast::Scope& enterScope ( const Ast::Scope::Type type) [inline, private]

Enter scope.

Parameters:
typeScope type
Returns:
The AST node
Ast::StatementList& enterStatementList ( Ast::Statement stmt) [inline]

Enter statement list scope.

Parameters:
stmtFirst statement in list
Returns:
AST node of statement list
Ast::StructDef& enterStructDef ( const Ast::TypeSpec::AccessType::T accessType,
const z::string name 
) [inline]

Enter struct definition.

Parameters:
accessTypeThe access type
nameThe struct name
Returns:
The AST node
void enterStructInit ( const Ast::TypeSpec typeSpec) [inline]

Enter struct initialization.

Parameters:
typeSpecType of struct being initialized
T& enterTypeSpec ( T &  t) [inline, private]

Enter type definition.

Parameters:
tThe type
Returns:
The type AST node
Ast::TypeSpec& enterTypeSpecRef ( const zbl::TokenData token) [inline]

Enter type reference.

Parameters:
tokenThe token representing the type reference to enter
Returns:
The entered type
Ast::Namespace& enterUnitNamespace ( const z::string name) [inline]

Enters a namespace in current unit.

Parameters:
nameThe namespace name
Returns:
The child namespace type
z::string err ( ) const [inline]

Return an error string based on current token.

Returns:
The error string
z::string err ( const zbl::TokenData token) const [inline]

Return an error string based on specified token.

Parameters:
tokenToken where error was detected
Returns:
The error string
z::string err ( const int &  line,
const int &  col 
) const [inline, private]

Return an error string.

Parameters:
lineLine number in unit
colColumn number in unit
Returns:
The error string
Ast::TypeSpec& getChildType ( const Ast::TypeSpec parent,
const zbl::TokenData name 
) [inline]

Get child of specified parent.

Parameters:
parentThe parent type
nameChild name to search for
Returns:
The type if found, else 0
Ast::ChildTypeSpec& getCurrentType ( ) const [inline]

Get type being currently defined.

Returns:
Current type
Ast::Expr& getEnumRefExpr ( const Ast::EnumDef enumRef,
const z::string id 
) [inline, private]

Create a expression node for reference to enum member.

Parameters:
enumRefThe enum reference
idThe enum member
Returns:
The expression node
const z::string& getFilename ( ) const [inline]

Get the name of the current file being compiled.

Returns:
Current file name
Ast::FunctionDef& getFunctionDef ( ) const [inline]

Get AST node for function definition type.

Returns:
The AST node
const Ast::VariableDef* getIdentifier ( const z::string name,
Ast::Storage::T storage 
) const [inline]

Get AST node for variable definition type in current and higher scopes.

Parameters:
nameThe variable name
storageReturn value reference for storage type where variable was found
Returns:
Pointer to the AST node if found, else 0
ImportFrame& getImportFrame ( ) [inline]

Get top-most import frame.

Returns:
Top most import frame
const ImportFrame& getImportFrame ( ) const [inline]

Get top-most import frame.

Returns:
Top most import frame
const Ast::QualifiedType& getInternalCallType ( const TokenData name,
const Ast::ExprList exprList 
) [inline]

get return type of internal function call

For create(), it is the type of the contained item for every thing else it is void

Parameters:
nameName of function
exprListThe function call argument value list
Returns:
The AST node
const Ast::UserDefinedTypeSpec::NativeType& getNativeType ( ) const [inline]

Get native type of top-most import frame.

Returns:
Native type of top most import frame
const zbl::TokenData& getNullToken ( ) const [inline]

Return reference to null token.

Used by parser.

Returns:
Reference to null token
Ast::ChildTypeSpec& getParent ( Ast::ChildTypeSpec child) [inline, private]

Get parent of specified type.

Parameters:
childThe type whose parent to get
Returns:
The parent type
Ast::ChildTypeSpec* getParent ( Ast::ChildTypeSpec child) [inline, private]

Get parent of specified type.

Parameters:
childThe type whose parent to get
Returns:
The parent type
Ast::QualifiedType& getQualifiedType ( const z::string name) [inline, private]

Create or get standard qualified type.

This function checks if the specified type exists in the map, and if not creates it and returns a reference to it.

Parameters:
nameName of qualified type
Returns:
The qualified type
const Ast::TypeSpec* getTarget ( const Ast::QualifiedType lhs,
const Ast::QualifiedType rhs 
) [inline, private]

Get the target for a coertion.

Parameters:
lhsType to map from
rhsType to map to
Returns:
Final mapping
const Ast::Expr& getTypeDefaultValue ( const Ast::TypeSpec type) [inline]

Get default value for type.

Parameters:
typeThe type
Returns:
The default value node
int getTypeIndex ( const Ast::QualifiedType type) const [inline, private]

Get int index of specified type in the coertion list.

Parameters:
typeThe type
Returns:
The index
Ast::TypeSpec* hasChildType ( const Ast::TypeSpec parent,
const z::string name 
) [inline]

Check if type has specified child.

Parameters:
parentThe parent type
nameChild name to search for
Returns:
The type if found, else 0
const Ast::VariableDef* hasMember ( const Ast::VariableDef vd,
const zbl::TokenData name 
) const [inline, private]

Check if a variable has specified member variable.

Parameters:
vdThe variable definition to check
nameThe member to check
Returns:
The variable definition if found, else 0
Ast::TypeSpec* hasRootType ( const z::string name) [inline]

Search for type.

Given a type, this function searches for it in current type, then parent type and so on until it reaches the root type. Then search the imported types.

Parameters:
nameType name to search for
Returns:
The type if found, else 0
const Ast::VariableDef* hasUdtMember ( const Ast::UserDefinedTypeSpec udt,
const z::string name 
) const [inline, private]

Check if given UDT has specified member variable.

Parameters:
udtThe UDT to check
nameThe member to check
Returns:
The variable definition if found, else 0
void importHeader ( Ast::ImportStatement stmt,
const Ast::ImportStatement::Type type 
) [inline]

Imports a file.

Parameters:
stmtThe import statement
typeThe import type
void importHeaderFile ( const Ast::ImportStatement stmt,
const Ast::ImportStatement::Type type 
) [private]

Compiles a import file.

This function is implemented in Compiler.cpp because the import should be done through the compiler instance

Parameters:
stmtThe import statement
typeThe import type
bool inImport ( ) const [inline]

Check if parser is currently in an import file.

Returns:
True if parser is currently in an import file, else false
bool isAny ( const Ast::QualifiedType rhs) [inline, private]

Check if specified type is of 'any' type.

Parameters:
rhsThe type to check
Returns:
True if it is of any type, else false
bool isQueryType ( const Ast::QualifiedType type) [inline, private]

Check if expression is a query type.

Parameters:
typeThe query type
Returns:
True if type is of query type, else false
Ast::ContinuationImplItem& leaveContinuation ( Ast::ContinuationImplItem continuation) [inline]

Leave continuation scope.

Parameters:
continuationThe continuation implementation item
Returns:
The continuation implementation item
Ast::ChildTypeSpec& leaveCurrentType ( Ast::ChildTypeSpec type) [inline]

Exit a type definition.

Pops the type from the type stack

Parameters:
typeThe type being defined
Returns:
Reference to type being defined
Ast::FunctionDef& leaveFunction ( Ast::FunctionDef fdef) [inline]

Enter function definition.

Parameters:
fdefFunction modifier
Returns:
The AST node
Ast::FunctionImplItem& leaveFunctionDef ( Ast::FunctionDef fdef,
const Ast::FunctionBlock block 
) [inline]

Leave function implementation definition.

Parameters:
fdefThe function definition
blockThe function block
Returns:
The AST node
Ast::FunctionImplItem& leaveFunctionImpl ( Ast::FunctionDef fdef,
Ast::FunctionBlock block 
) [inline]

Leave function implementation definition.

Parameters:
fdefThe function definition
blockThe function block
Returns:
The AST node
ImplT& leaveFunctionT ( Ast::FunctionDef fdef,
const BlockT &  block 
) [inline, private]

Create function implementation item.

Parameters:
fdefThe function definition
blockThe function block
Returns:
The AST node
Ast::GrammarImplItem& leaveGrammarDef ( Ast::FunctionDef fdef,
const Ast::GrammarBlock block 
) [inline]

Leave grammar implementation definition.

Parameters:
fdefThe grammar definition
blockThe grammar block
Returns:
The AST node
Ast::GrammarRuleStatement& leaveGrammarRule ( Ast::FunctionDef fdef,
const Ast::GrammarMemberList list 
) [inline]

Leave grammar rule block without statement list.

Statement block defaults to a single "return true;" statement.

Parameters:
fdefThe function def for the grammar rule block
listThe grammar member list
Returns:
The AST node
Ast::GrammarRuleStatement& leaveGrammarRuleBlock ( Ast::FunctionDef fdef,
const Ast::GrammarMemberList list,
const Ast::StatementList stmtList 
) [inline]

Leave grammar rule block.

Parameters:
fdefThe function def for the grammar rule block
listThe grammar member list
stmtListThe list of statements in the block
Returns:
The AST node
Ast::LexerStatement& leaveLexer ( Ast::FunctionDef fdef,
const Ast::GrammarTokenList list 
) [inline]

Leave lexer without a statement list.

Parameters:
fdefThe function def for the lexer block
listThe token list
Returns:
The AST node
Ast::LexerStatement& leaveLexer ( Ast::FunctionDef fdef,
const Ast::GrammarTokenList list,
const Ast::StatementList stmtList 
) [inline]

Leave lexer.

Parameters:
fdefThe function def for the lexer block
listThe token list
stmtListThe statement list
Returns:
The AST node
Ast::GrammarLexer& leaveLexerState ( Ast::GrammarLexer lexer,
Ast::LexerStatementList list 
) [inline]

Leave lexer state.

Parameters:
lexerThe elxer to exit
listThe list of statements in the lexer action
Returns:
The AST node
Ast::RoutineImplItem& leaveRoutineDef ( Ast::FunctionDef fdef,
const Ast::RoutineBlock block 
) [inline]

Leave routine implementation definition.

Parameters:
fdefThe routine definition
blockThe routine block
Returns:
The AST node
void leaveScope ( const Ast::Scope::Type type) [inline, private]

Leave scope.

Parameters:
typeScope type
Ast::StatementList& leaveStatementList ( Ast::StatementList list) [inline]

Leave statement list scope.

Parameters:
listStatement list
Returns:
AST node of statement list
Ast::StructDef& leaveStructDef ( Ast::StructDef structDef) [inline]

Leave struct definition.

Parameters:
structDefThe struct definition
Returns:
The AST node
Ast::StructDef& leaveStructDefList ( Ast::StructDef structDef,
const Ast::VariableDefMap defList,
const Ast::StructDefList subTypeList 
) [inline]

Leave struct definition with list of variable and subtype definitions.

Parameters:
structDefThe struct definition
defListThe member variable definition list
subTypeListThe sub-type definition list
Returns:
The AST node
T& leaveTypeSpec ( T &  t) [inline, private]

Leave type definition.

Parameters:
tThe type
Returns:
The type AST node
Ast::TypeSpec& leaveTypeSpecRef ( Ast::TypeSpec typeSpec) [inline]

Leave type reference.

Parameters:
typeSpecThe type reference to leave
Returns:
The type
void leaveUnitNamespace ( Ast::Namespace ns) [inline]

Leave current namespace.

Parameters:
nsThe namespace type to exit
Ast::WindowImplItem& leaveWindowDef ( Ast::FunctionDef fdef,
const Ast::WindowBlock block 
) [inline]

Leave window implementation definition.

Parameters:
fdefThe window definition
blockThe window block
Returns:
The AST node
void setProjectDef ( const Ast::StructInitExpr expr) [inline]

When parsing a project file, set the root expression.

Parameters:
exprProject initialization expression
void setTokenPos ( const int &  line,
const int &  col 
) [inline]

Set the current token position.

Parameters:
lineThe line number
colThe column number

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