Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Parser.C File Reference

#include "Parser.H"
#include "Files.H"
#include "Lex.H"
#include "ModelState.H"
#include "Err.H"
#include "Expr.H"
#include "Val.H"
#include "Prim.H"
#include <iostream>

Go to the source code of this file.

Functions

void PError (const Text &msg)
void NextToken ()
void TokenLookAhead ()
bool AtToken (TokenClass tc)
bool AtDelimiter ()
bool AtArc ()
bool EatPragma ()
bool EatToken (TokenClass tc)
bool EatName (Name &name)
bool EatArc (Name &arc)
bool EatDelimiter ()
void Expect (TokenClass tk, char *msg)
Name GetName ()
Text ModelPath (const Text &from, const Text &path)
Expr ConvertToBindElem (Expr lhs, Expr rhs)
void InitState (istream *lexIn, const Text &modelName, ShortId sid, VestaSource *modelRoot)
Expr Model ()
ExprList Files ()
Expr FileItem (bool couldBeList)
Expr FileList ()
ExprList Imports ()
Expr IncItem (const Text &from, bool hasForm, bool couldBeList)
Expr IncList (const Text &from, bool hasForm)
Text DelimPath (Name &arc, bool arcSeen)
Expr Block ()
Expr Stmt ()
Expr Func (const Text &name, bool noCache)
ArgList Formals ()
Expr Assign (Name name)
Expr Iterate ()
Expr Control ()
Expr Expression ()
Expr Expr1 ()
Expr Expr2 ()
Expr Expr3 ()
Expr Expr4 ()
Expr Expr5 ()
Expr Expr6 ()
Expr Expr7 ()
Expr Expr8 ()
Expr Primary ()
Expr BindingCons (Expr e)
Expr BindElem ()
Expr ListCons (Expr e)
Expr GenArc ()
ArgList Actuals ()
Expr TypeDef ()
Expr Type ()
Expr Parse (istream *lexIn, const Text &name, ShortId sid, VestaSource *modelRoot)


Function Documentation

ArgList Actuals  ) 
 

Definition at line 881 of file Parser.C.

References ArgListEC::AddExpr(), AtToken(), EatToken(), Expect(), Expression(), Token::loc, NEW_CONSTR, TkComma, and TkRParen.

Referenced by Primary().

Expr Assign Name  name  ) 
 

Definition at line 567 of file Parser.C.

References Token::AsText(), AtToken(), EatToken(), Text::Empty(), Expect(), Expression(), ExprC::loc, NEW_CONSTR, NextToken(), TkColon, TkEqual, TkMinus, TkPlus, TkPlusPlus, TkStar, and Type().

Referenced by Stmt().

bool AtArc  ) 
 

Definition at line 92 of file Parser.C.

References Token::Bytes(), NextToken(), Token::tclass, TkId, TkNumber, TkPragma, and TkString.

Referenced by EatArc(), FileList(), Files(), Imports(), and IncList().

bool AtDelimiter  ) 
 

Definition at line 82 of file Parser.C.

References Token::Bytes(), NextToken(), Token::tclass, TkBackSlash, TkPragma, and TkSlash.

Referenced by DelimPath(), EatDelimiter(), FileItem(), FileList(), Files(), and IncItem().

bool AtToken TokenClass  tc  ) 
 

Definition at line 73 of file Parser.C.

References Token::Bytes(), NextToken(), Token::tclass, and TkPragma.

Referenced by Actuals(), Assign(), BindingCons(), EatName(), EatToken(), Expr4(), Expr5(), Expr6(), Formals(), Imports(), Iterate(), ListCons(), Stmt(), and Type().

Expr BindElem  ) 
 

Definition at line 850 of file Parser.C.

References BindingEC::AddExpr(), EatDelimiter(), EatToken(), Expression(), GenArc(), ExprC::kind, Token::loc, ExprC::loc, NameEK, NEW_CONSTR, PError(), Token::tclass, TkEqual, and TkId.

Referenced by BindingCons(), and Primary().

Expr BindingCons Expr  e  ) 
 

Definition at line 840 of file Parser.C.

References BindingEC::AddExpr(), AtToken(), BindElem(), EatToken(), Expect(), ExprC::loc, NEW_CONSTR, TkComma, and TkRBracket.

Referenced by Primary().

Expr Block  ) 
 

Definition at line 455 of file Parser.C.

References StmtListEC::AddExpr(), EatToken(), Expect(), Expression(), Token::loc, NEW_CONSTR, PError(), Stmt(), Token::tclass, TkLBrace, TkRBrace, TkReturn, TkSemicolon, and TkValue.

Referenced by Func(), Model(), and Primary().

Expr Control  ) 
 

Definition at line 608 of file Parser.C.

References EatToken(), Expect(), GetName(), Token::loc, NEW_CONSTR, TkColon, TkEqual, TkLBracket, TkRBracket, and Type().

Referenced by Iterate().

Expr ConvertToBindElem Expr  lhs,
Expr  rhs
 

Definition at line 182 of file Parser.C.

References BindingEC::AddExpr(), SelectEC::binding, NameEC::ClearFreeVars(), ConstantEK, Error(), ErrorDetail(), ErrorExpr(), ErrorVal(), SelectEC::field, IntegerVK, Token::loc, ExprC::loc, NameEK, NEW_CONSTR, PrintForm(), SelectEK, TextVK, and ValC::vKind.

Text DelimPath Name arc,
bool  arcSeen
 

Definition at line 419 of file Parser.C.

References Token::AsText(), AtDelimiter(), EatArc(), NameEC::id, NextToken(), and PError().

Referenced by FileItem(), Imports(), and IncItem().

bool EatArc Name arc  )  [inline]
 

Definition at line 131 of file Parser.C.

References Token::AsText(), AtArc(), Token::loc, NEW_CONSTR, NextToken(), and Token::TokenAssign().

Referenced by DelimPath(), FileItem(), GenArc(), and IncItem().

bool EatDelimiter  )  [inline]
 

Definition at line 141 of file Parser.C.

References AtDelimiter(), NextToken(), and Token::TokenAssign().

Referenced by BindElem().

bool EatName Name name  )  [inline]
 

Definition at line 121 of file Parser.C.

References AtToken(), Token::expr, NextToken(), TkId, and Token::TokenAssign().

Referenced by Formals(), Stmt(), Type(), and TypeDef().

bool EatPragma  )  [inline]
 

Definition at line 103 of file Parser.C.

References NextToken(), Token::tclass, TkPragma, and Token::TokenAssign().

Referenced by Formals(), and Stmt().

bool EatToken TokenClass  tc  )  [inline]
 

Definition at line 112 of file Parser.C.

References AtToken(), NextToken(), and Token::TokenAssign().

Referenced by Actuals(), Assign(), BindElem(), BindingCons(), Block(), Control(), Expect(), Expr1(), Expr2(), Expr3(), Expr4(), Expr7(), Expr8(), Expression(), FileItem(), FileList(), Files(), Formals(), Func(), GenArc(), Imports(), IncItem(), IncList(), Iterate(), ListCons(), Primary(), Stmt(), and Type().

void Expect TokenClass  tk,
char *  msg
 

Definition at line 150 of file Parser.C.

References Token::AsText(), EatToken(), PError(), Token::tclass, and TokenNames.

Referenced by Actuals(), Assign(), BindingCons(), Block(), Control(), Expression(), FileList(), Formals(), GenArc(), GetName(), Imports(), IncList(), Iterate(), ListCons(), Primary(), Type(), and TypeDef().

Expr Expr1  ) 
 

Definition at line 640 of file Parser.C.

References EatToken(), Expr2(), Token::loc, NEW_CONSTR, and TkImplies.

Referenced by Expression().

Expr Expr2  ) 
 

Definition at line 649 of file Parser.C.

References EatToken(), Expr3(), Token::loc, NEW_CONSTR, and TkOr.

Referenced by Expr1().

Expr Expr3  ) 
 

Definition at line 658 of file Parser.C.

References EatToken(), Expr4(), Token::loc, NEW_CONSTR, and TkAnd.

Referenced by Expr2().

Expr Expr4  ) 
 

Definition at line 667 of file Parser.C.

References Token::AsText(), AtToken(), EatToken(), Expr5(), Token::loc, NEW_CONSTR, Token::tclass, TkBang, TkEqEq, TkErr, TkFalse, TkGreater, TkGreaterEq, TkId, TkLBrace, TkLBracket, TkLess, TkLessEq, TkLParen, TkMinus, TkNotEq, TkNumber, TkString, TkTrue, and TokenLookAhead().

Referenced by Expr3().

Expr Expr5  ) 
 

Definition at line 703 of file Parser.C.

References Token::AsText(), AtToken(), Expr6(), Token::loc, NEW_CONSTR, NextToken(), TkMinus, TkPlus, and TkPlusPlus.

Referenced by Expr4().

Expr Expr6  ) 
 

Definition at line 717 of file Parser.C.

References AtToken(), Expr7(), Token::loc, NEW_CONSTR, NextToken(), and TkStar.

Referenced by Expr5().

Expr Expr7  ) 
 

Definition at line 728 of file Parser.C.

References EatToken(), Expr8(), Token::loc, NEW_CONSTR, Primary(), TkBang, and TkMinus.

Referenced by Expr6().

Expr Expr8  ) 
 

Definition at line 738 of file Parser.C.

References EatToken(), Token::loc, Primary(), TkColon, and Type().

Referenced by Expr7().

Expr Expression  ) 
 

Definition at line 627 of file Parser.C.

References EatToken(), Expect(), Expr1(), Token::loc, NEW_CONSTR, TkElse, TkIf, and TkThen.

Referenced by Actuals(), Assign(), BindElem(), Block(), Formals(), GenArc(), Iterate(), ListCons(), and Primary().

Expr FileItem bool  couldBeList  ) 
 

Definition at line 290 of file Parser.C.

References AtDelimiter(), DelimPath(), EatArc(), EatToken(), FileList(), NameEC::id, Token::loc, mRoot, NEW_CONSTR, PError(), TkEqual, and TkLBracket.

Referenced by FileList(), and Files().

Expr FileList  ) 
 

Definition at line 323 of file Parser.C.

References BindingEC::AddExpr(), AtArc(), AtDelimiter(), EatToken(), Expect(), FileItem(), Token::loc, NEW_CONSTR, TkComma, and TkRBracket.

Referenced by FileItem().

ExprList Files  ) 
 

Definition at line 276 of file Parser.C.

References ExprListEC::AddExpr(), AtArc(), AtDelimiter(), EatToken(), FileItem(), Token::loc, NEW_CONSTR, TkFiles, and TkSemicolon.

Referenced by Model().

ArgList Formals  ) 
 

Definition at line 519 of file Parser.C.

References ArgListEC::AddExpr(), AtToken(), Token::Bytes(), EatName(), EatPragma(), EatToken(), ArgListEC::elems, Expect(), Expression(), Sequence< Elem, elem_ptrfree >::get(), ArgListEC::Length(), Token::loc, nameDot, NEW_CONSTR, PError(), TkColon, TkComma, TkEqual, TkId, TkRParen, and Type().

Referenced by Func().

Expr Func const Text name,
bool  noCache
 

Definition at line 504 of file Parser.C.

References Block(), EatToken(), Formals(), Token::loc, NEW_CONSTR, TkColon, TkLParen, and Type().

Referenced by Stmt().

Expr GenArc  ) 
 

Definition at line 815 of file Parser.C.

References NameEC::ClearFreeVars(), EatArc(), EatToken(), Expect(), Expression(), GetName(), NEW_CONSTR, TkDollar, TkErr, TkLParen, TkPercent, and TkRParen.

Referenced by BindElem(), and Primary().

Name GetName  )  [inline]
 

Definition at line 156 of file Parser.C.

References Expect(), Token::expr, and TkId.

Referenced by Control(), GenArc(), and PrimInit().

ExprList Imports  ) 
 

Definition at line 335 of file Parser.C.

References ExprListEC::AddExpr(), AtArc(), AtToken(), DelimPath(), EatToken(), Expect(), SrcLoc::file, IncItem(), Token::loc, mRoot, NEW_CONSTR, FS::SplitPath(), TkFrom, TkImport, and TkSemicolon.

Referenced by Model().

Expr IncItem const Text from,
bool  hasForm,
bool  couldBeList
 

Definition at line 365 of file Parser.C.

References AtDelimiter(), DelimPath(), EatArc(), EatToken(), NameEC::id, IncList(), Token::loc, ModelPath(), mRoot, NEW_CONSTR, PError(), TkEqual, and TkLBracket.

Referenced by Imports(), and IncList().

Expr IncList const Text from,
bool  hasForm
 

Definition at line 407 of file Parser.C.

References BindingEC::AddExpr(), AtArc(), EatToken(), Expect(), IncItem(), Token::loc, NEW_CONSTR, TkComma, and TkRBracket.

Referenced by IncItem().

void InitState istream *  lexIn,
const Text modelName,
ShortId  sid,
VestaSource modelRoot
 

Definition at line 222 of file Parser.C.

References Token::Init(), ModelStateInit(), and NextToken().

Referenced by Parse().

Expr Iterate  ) 
 

Definition at line 585 of file Parser.C.

References StmtListEC::AddExpr(), AtToken(), Control(), EatToken(), Expect(), Expression(), Token::loc, NEW_CONSTR, Stmt(), TkDo, TkForeach, TkIn, TkLBrace, TkRBrace, and TkSemicolon.

Referenced by Stmt().

Expr ListCons Expr  e  ) 
 

Definition at line 871 of file Parser.C.

References ListEC::AddExpr(), AtToken(), EatToken(), Expect(), Expression(), ExprC::loc, NEW_CONSTR, TkComma, and TkGreater.

Referenced by Primary().

Expr Model  ) 
 

Definition at line 269 of file Parser.C.

References Block(), Files(), Imports(), ExprC::loc, mRoot, and NEW_CONSTR.

Referenced by Parse().

Text ModelPath const Text from,
const Text path
 

Definition at line 163 of file Parser.C.

References Text::Empty(), IsDelimiter(), Text::Length(), PathnameSep, and Text::Sub().

Referenced by IncItem().

void NextToken  )  [inline]
 

Definition at line 55 of file Parser.C.

References Token::Next(), and Token::TokenAssign().

Referenced by Assign(), AtArc(), AtDelimiter(), AtToken(), DelimPath(), EatArc(), EatDelimiter(), EatName(), EatPragma(), EatToken(), Expr5(), Expr6(), InitState(), and Primary().

Expr Parse istream *  lexIn,
const Text name,
ShortId  sid,
VestaSource modelRoot
 

Definition at line 977 of file Parser.C.

References InitState(), Token::LexFlush(), and Model().

Referenced by ModelVC::Force(), and Interpret().

void PError const Text msg  ) 
 

Definition at line 48 of file Parser.C.

References Error(), Token::loc, Basics::mutex::lock(), outputMu, and Basics::mutex::unlock().

Referenced by BindElem(), Block(), DelimPath(), Expect(), FileItem(), Formals(), IncItem(), Primary(), Stmt(), and TypeDef().

Expr Primary  ) 
 

Definition at line 748 of file Parser.C.

References Actuals(), Token::AsText(), BindElem(), BindingCons(), Block(), EatToken(), Expect(), Token::expr, Expression(), GenArc(), NameEC::id, ListCons(), ExprC::loc, Token::loc, LookupPrim(), NEW_CONSTR, NextToken(), PError(), Token::tclass, TkBackSlash, TkBang, TkErr, TkFalse, TkGreater, TkId, TkLBrace, TkLBracket, TkLess, TkLParen, TkNumber, TkRBracket, TkRParen, TkSlash, TkString, TkTrue, valFalse, and valTrue.

Referenced by Expr7(), and Expr8().

Expr Stmt  ) 
 

Definition at line 477 of file Parser.C.

References Assign(), AtToken(), Token::Bytes(), EatName(), EatPragma(), EatToken(), Func(), NameEC::id, Iterate(), ExprC::loc, NEW_CONSTR, PError(), TkForeach, TkLParen, TkType, and TypeDef().

Referenced by Block(), and Iterate().

void TokenLookAhead  )  [inline]
 

Definition at line 65 of file Parser.C.

Referenced by Expr4().

Expr Type  ) 
 

Definition at line 906 of file Parser.C.

References AtToken(), EatName(), EatToken(), Expect(), Token::loc, NEW_CONSTR, TkBinding, TkBool, TkColon, TkComma, TkFunction, TkId, TkInt, TkLBracket, TkList, TkLParen, TkRBracket, TkRParen, and TkText.

Referenced by Assign(), Control(), Expr8(), Formals(), Func(), and TypeDef().

Expr TypeDef  ) 
 

Definition at line 894 of file Parser.C.

References EatName(), Expect(), ExprC::loc, NEW_CONSTR, PError(), TkEqual, and Type().

Referenced by Stmt().


Generated on Mon May 8 00:49:02 2006 for Vesta by  doxygen 1.4.2