SNAP Library 2.1, User Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TILx Class Reference

#include <lx.h>

List of all members.

Public Member Functions

 TILx (const PSIn &_SIn, const TFSet &OptSet=TFSet(), const TLxChDefTy &ChDefTy=lcdtUsAscii)
TILxoperator= (const TILx &)
void SetOpt (const int &Opt, const bool &Val)
TLxSym AddRw (const TStr &Str)
TLxSym GetRw (const TStr &Str)
PSIn GetSIn (const char &SepCh)
int GetLnN () const
bool IsBof () const
bool IsEof () const
TLxSym GetSym (const TFSet &Expect)
TLxSym GetSym ()
TLxSym GetSym (const TLxSym &Sym)
TLxSym GetSym (const TLxSym &Sym1, const TLxSym &Sym2)
TLxSym GetSym (const TLxSym &Sym1, const TLxSym &Sym2, const TLxSym &Sym3)
TLxSym GetSym (const TLxSym &Sym1, const TLxSym &Sym2, const TLxSym &Sym3, const TLxSym &Sym4)
bool GetBool ()
int GetInt ()
double GetFlt ()
TStr GetStr (const TStr &_Str=TStr())
TStr GetIdStr (const TStr &IdStr=TStr())
TStr GetQStr (const TStr &QStr=TStr())
void GetEoln ()
TStr GetStrToCh (const char &ToCh)
TStr GetStrToEolnOrCh (const char &ToCh)
TStr GetStrToEoln (const bool &DoTrunc=false)
TStr GetStrToEolnAndCh (const char &ToCh)
void SkipToEoln ()
void SkipToSym (const TLxSym &SkipToSym)
void PutSym (const TILxSymSt &SymSt)
void PutSym ()
TLxSym PeekSym ()
TLxSym PeekSym (const int &Syms)
TStr GetSymStr () const
TStr GetFPosStr () const
bool IsVar (const TStr &VarNm)
void GetVar (const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
void GetVarEnd (const bool &RBracket=false, const bool &NewLn=false)
bool PeekVarEnd (const bool &RBracket=false, const bool &NewLn=false)
bool GetVarBool (const TStr &VarNm, const bool &NewLn=true)
int GetVarInt (const TStr &VarNm, const bool &NewLn=true)
double GetVarFlt (const TStr &VarNm, const bool &NewLn=true)
TStr GetVarStr (const TStr &VarNm, const bool &NewLn=true)
TSecTm GetVarSecTm (const TStr &VarNm, const bool &NewLn=true)
void GetVarBoolV (const TStr &VarNm, TBoolV &BoolV, const bool &NewLn=true)
void GetVarIntV (const TStr &VarNm, TIntV &IntV, const bool &NewLn=true)
void GetVarFltV (const TStr &VarNm, TFltV &FltV, const bool &NewLn=true)
void GetVarStrV (const TStr &VarNm, TStrV &StrV, const bool &NewLn=true)
void GetVarStrPrV (const TStr &VarNm, TStrPrV &StrPrV, const bool &NewLn=true)
void GetVarStrVV (const TStr &VarNm, TVec< TStrV > &StrVV, const bool &NewLn=true)

Static Public Member Functions

static TStr GetQStr (const TStr &Str, const bool &QuoteP, const char &QuoteCh)
static void GetLnV (const TStr &FNm, TStrV &LnV)

Public Attributes

TLxSym Sym
TChA Str
TChA UcStr
TChA CmtStr
bool Bool
int Int
double Flt
int SymLnN
int SymLnChN
int SymChN
bool QuoteP
char QuoteCh

Private Member Functions

char GetCh ()
char GetChX ()

Private Attributes

PLxChDef ChDef
PSIn SIn
TSInRSIn
char PrevCh
char Ch
int LnN
int LnChN
int ChN
TSStack< TILxSymStPrevSymStStack
TStrIntH RwStrH
bool IsCmtAlw
bool IsRetEoln
bool IsSigNum
bool IsUniStr
bool IsCsSens
bool IsExcept
bool IsTabSep
bool IsList

Detailed Description

Definition at line 129 of file lx.h.


Constructor & Destructor Documentation

TILx::TILx ( const PSIn _SIn,
const TFSet OptSet = TFSet(),
const TLxChDefTy ChDefTy = lcdtUsAscii 
)

Definition at line 270 of file lx.cpp.

                                                                          :
  ChDef(TLxChDef::GetChDef(ChDefTy)),
  SIn(_SIn), RSIn(*SIn),
  PrevCh(' '), Ch(' '), LnN(0), LnChN(0-1), ChN(0-1),
  PrevSymStStack(), RwStrH(50),
  IsCmtAlw(false), IsRetEoln(false), IsSigNum(false),
  IsUniStr(false), IsCsSens(false), IsExcept(false),
  IsTabSep(false), IsList(false),
  Sym(syUndef),
  Str(), UcStr(), CmtStr(),
  Bool(false), Int(0), Flt(0),
  SymLnN(-1), SymLnChN(-1), SymChN(-1){
  for (int Opt=0; Opt<iloMx; Opt++){
    if (OptSet.In(Opt)){SetOpt(Opt, true);}}
}

Member Function Documentation

TLxSym TILx::AddRw ( const TStr Str)

Definition at line 300 of file lx.cpp.

                                 {
  IAssert(RwStrH.Len()<syMxRw-syMnRw+1);
  TStr UcStr=ChDef->GetUcStr(Str);
  IAssert(!RwStrH.IsKey(UcStr));
  TLxSym RwSym=TLxSym(syMnRw+RwStrH.Len());
  RwStrH.AddDat(Str, TInt(int(RwSym)));
  return RwSym;
}
bool TILx::GetBool ( ) [inline]

Definition at line 180 of file lx.h.

{GetSym(TFSet()|syBool); return Bool;}
char TILx::GetCh ( ) [inline, private]

Definition at line 140 of file lx.h.

              {
    Assert(Ch!=TCh::EofCh);
    PrevCh=Ch; LnChN++; ChN++;
    Ch=((RSIn.Eof()) ? TCh::EofCh : RSIn.GetCh());
    if (IsList){putchar(Ch);}
    return Ch;
  }
char TILx::GetChX ( ) [inline, private]

Definition at line 147 of file lx.h.

{char Ch=GetChX(); printf("%c", Ch); return Ch;}
void TILx::GetEoln ( ) [inline]

Definition at line 189 of file lx.h.

double TILx::GetFlt ( ) [inline]

Definition at line 182 of file lx.h.

{GetSym(TFSet()|syFlt); return Flt;}

Definition at line 607 of file lx.cpp.

                            {
  TChA ChA;
  ChA+="File:"; ChA+=SIn->GetSNm();
  ChA+=" Line:"; ChA+=TInt::GetStr(LnN+1);
  ChA+=" Char:"; ChA+=TInt::GetStr(LnChN);
  return ChA;
}
TStr TILx::GetIdStr ( const TStr IdStr = TStr()) [inline]

Definition at line 185 of file lx.h.

                                         {
    GetSym(TFSet()|syIdStr); IAssert(IdStr.Empty()||(IdStr==Str)); return Str;}
int TILx::GetInt ( ) [inline]

Definition at line 181 of file lx.h.

{GetSym(TFSet()|syInt); return Int;}
int TILx::GetLnN ( ) const [inline]

Definition at line 166 of file lx.h.

{return LnN;}
void TILx::GetLnV ( const TStr FNm,
TStrV LnV 
) [static]

Definition at line 687 of file lx.cpp.

                                            {
  TFIn SIn(FNm); LnV.Clr(); TChA Ln;
  if (!SIn.Eof()){
    char Ch=SIn.GetCh();
    while (!SIn.Eof()){
      if ((Ch==TCh::CrCh)||(Ch==TCh::LfCh)){
        if (!SIn.Eof()){
          char PrevCh=Ch; Ch=SIn.GetCh();
          if (!SIn.Eof()){
            if (PrevCh==TCh::CrCh){if (Ch==TCh::LfCh){Ch=SIn.GetCh();}} else
            if (PrevCh==TCh::LfCh){if (Ch==TCh::CrCh){Ch=SIn.GetCh();}}
          }
        }
        LnV.Add(Ln); Ln.Clr();
      } else {
        Ln+=Ch; Ch=SIn.GetCh();
      }
    }
    if (!Ln.Empty()){
      LnV.Add(Ln);}
  }
}
TStr TILx::GetQStr ( const TStr QStr = TStr()) [inline]

Definition at line 187 of file lx.h.

                                       {
    GetSym(TFSet()|syQStr); IAssert(QStr.Empty()||(Str==QStr)); return Str;}
TStr TILx::GetQStr ( const TStr Str,
const bool &  QuoteP,
const char &  QuoteCh 
) [static]

Definition at line 615 of file lx.cpp.

                                                                          {
  if (QuoteP){
    TChA ChA;
    ChA+=QuoteCh;
    int StrLen=Str.Len();
    for (int ChN=0; ChN<StrLen; ChN++){
      char Ch=Str.CStr()[ChN];
      if (Ch==QuoteCh){ChA+=QuoteCh; ChA+=QuoteCh;}
      else {ChA+=Ch;}
    }
    ChA+=QuoteCh;
    return ChA;
  } else {
    return Str;
  }
}
TLxSym TILx::GetRw ( const TStr Str) [inline]

Definition at line 163 of file lx.h.

                               {
    return TLxSym(int(RwStrH.GetDat(Str)));}
PSIn TILx::GetSIn ( const char &  SepCh)

Definition at line 309 of file lx.cpp.

                                  {
  IAssert(PrevSymStStack.Empty());
  while ((Ch!=TCh::EofCh)&&(Ch!=SepCh)){GetCh();}
  return SIn;
}
TStr TILx::GetStr ( const TStr _Str = TStr()) [inline]

Definition at line 183 of file lx.h.

                                      {
    GetSym(TFSet()|syStr); IAssert(_Str.Empty()||(_Str==Str)); return Str;}
TStr TILx::GetStrToCh ( const char &  ToCh)

Definition at line 539 of file lx.cpp.

                                     {
  Sym=syStr; Str.Clr(); UcStr.Clr();
  while ((Ch!=ToCh)&&(Ch!=TCh::EofCh)){
    Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
  return Str;
}
TStr TILx::GetStrToEoln ( const bool &  DoTrunc = false)

Definition at line 553 of file lx.cpp.

                                          {
  Sym=syStr; Str.Clr(); UcStr.Clr();
  while ((Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)&&(Ch!=TCh::EofCh)){
    Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
  if (DoTrunc){Str.ToTrunc(); UcStr.ToTrunc();}
  return Str;
}
TStr TILx::GetStrToEolnAndCh ( const char &  ToCh)

Definition at line 561 of file lx.cpp.

                                            {
  Sym=syStr; Str.Clr(); UcStr.Clr();
  if (IsBof()){GetCh();}
  forever {
    if (Ch==TCh::EofCh){break;}
    if (((ChN==0)||(PrevCh==TCh::CrCh)||(PrevCh==TCh::LfCh))&&(Ch==ToCh)){
      GetCh(); break;}
    else {Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
  }
  return Str;
}
TStr TILx::GetStrToEolnOrCh ( const char &  ToCh)

Definition at line 546 of file lx.cpp.

                                           {
  Sym=syStr; Str.Clr(); UcStr.Clr();
  while ((Ch!=ToCh)&&(Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)&&(Ch!=TCh::EofCh)){
    Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
  return Str;
}
TLxSym TILx::GetSym ( const TFSet Expect)

Definition at line 315 of file lx.cpp.

                                      {
  CmtStr.Clr();
  if (!PrevSymStStack.Empty()){
    // symbols already on the stack
    PrevSymStStack.Top().Restore(*this); PrevSymStStack.Pop();
  } else
  if (Expect.In(syLn)){
    // symbol is the whole line string
    if (Ch==TCh::EofCh){
      Sym=syEof;
    } else {
      Str.Clr();
      if (IsBof()){GetCh();}
      while (!ChDef->IsTerm(Ch)){Str.AddCh(Ch); GetCh();}
      bool _IsRetEoln=IsRetEoln; IsRetEoln=true;
      GetSym(TFSet()|syEoln|syEof); Sym=syLn;
      IsRetEoln=_IsRetEoln;
    }
  } else
  if (IsTabSep){
    // symbol is between tab characters
    if (IsBof()){GetCh();}
    if (Ch==TCh::TabCh){ // tab character
      Sym=syTab; GetCh();
    } else
    if (ChDef->IsTerm(Ch)){ // eoln & eof characters
      bool _IsRetEoln=IsRetEoln; IsRetEoln=true; IsTabSep=false;
      GetSym(TFSet()|syEoln|syEof);
      IsRetEoln=_IsRetEoln; IsTabSep=true;
    } else {
      Str.Clr();
      while ((!ChDef->IsTerm(Ch))&&(Ch!=TCh::TabCh)){
        Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
      Sym=syStr; QuoteP=false;
    }
  } else {
    // usual symbol
    while (ChDef->IsSpace(Ch)){GetCh();}
    SymLnN=LnN; SymLnChN=LnChN; SymChN=ChN;

    if (ChDef->IsAlpha(Ch)){
      if (IsUniStr){Sym=syStr;} else {Sym=syIdStr;}
      Str.Clr(); UcStr.Clr(); QuoteP=false;
      do {Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch));}
      while (ChDef->IsAlNum(GetCh()));
      if (!RwStrH.Empty()){
        TStr RwStr=Str; if (!IsCsSens){RwStr=UcStr;}
        int SymKeyId=RwStrH.GetKeyId(RwStr);
        if (SymKeyId!=-1){Sym=TLxSym(int(RwStrH[SymKeyId]));}
      }
      if (Expect.In(syBool)){
        Sym=syBool; IAssert(TBool::IsValStr(Str));
        Bool=TBool::GetValFromStr(Str);
      }
    } else
    if ((Ch=='"')||(Ch=='\'')){
      if (IsUniStr){Sym=syStr;} else {Sym=syQStr;}
      Str.Clr(); UcStr.Clr(); QuoteP=true; QuoteCh=Ch;
      GetCh();
      forever{
        while ((Ch!=QuoteCh)&&(Ch!='\\')&&(Ch!=TCh::EofCh)){
          Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
        if (Ch==TCh::EofCh){
          Sym=syUndef; break;
        } else if (Ch==QuoteCh){
          GetCh(); break;
        } else {
          GetCh();
          switch (Ch){
            case '"': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case '\\': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case '\'': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case '/': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case 'b': Str.AddCh('\b'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case 'f': Str.AddCh('\f'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case 'n': Str.AddCh('\n'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case 'r': Str.AddCh('\r'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case 't': Str.AddCh('\t'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
            case 'u': {
              // unicode character, represented using 4 hexadecimal digits
              GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
              int UChCd = TCh::GetHex(Ch);
              GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
              UChCd = 16 * UChCd + TCh::GetHex(Ch);
              GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
              UChCd = 16 * UChCd + TCh::GetHex(Ch);
              GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
              UChCd = 16 * UChCd + TCh::GetHex(Ch);
              // get as UTF8 encoded characters
              TUnicode::EncodeUtf8(UChCd, Str);
                          TUnicode::EncodeUtf8(UChCd, UcStr); }
              GetCh(); break; 
            default: Sym=syUndef; break;
          }
          if (Sym==syUndef){
            throw PExcept(new TExcept("Invalid Escape Sequence in Quoted String"));}
        }
      }
    } else
    if ((ChDef->IsNum(Ch))||(IsSigNum&&((Ch=='+')||(Ch=='-')))){
      Str.Clr(); bool IntP=true;
      do {Str.AddCh(Ch);} while (ChDef->IsNum(GetCh()));
      if (Expect.In(syFlt)){
        if (Ch=='.'){
          Str.AddCh(Ch); IntP=false;
          while (ChDef->IsNum(GetCh())){Str.AddCh(Ch);}
        }
        if ((Ch=='e')||(Ch=='E')){
          Str.AddCh(Ch); GetCh(); IntP=false;
          if ((Ch=='+')||(Ch=='-')){Str.AddCh(Ch); GetCh();}
          while (ChDef->IsNum(Ch)){Str.AddCh(Ch); GetCh();}
        }
      }
      UcStr=Str;
      if (IntP&&(Expect.In(syInt))){
        Sym=syInt; Int=atoi(Str.CStr());
      } else {
        Sym=syFlt; Flt=atof(Str.CStr());
      }
    } else
    if ((Ch==TCh::CrCh)||(Ch==TCh::LfCh)){
      Sym=syEoln;
      if (Ch==TCh::CrCh){if (GetCh()==TCh::LfCh){GetCh();}} else
      if (Ch==TCh::LfCh){if (GetCh()==TCh::CrCh){GetCh();}}
      LnN++; LnChN=0; if (!IsRetEoln){GetSym(Expect);}
    } else
    if (Ch=='/'){
      GetCh();
      if ((IsCmtAlw)&&(Ch=='/')){
        TChA _CmtStr;
        do {_CmtStr+=GetCh();} while (!ChDef->IsTerm(Ch));
        _CmtStr.Pop(); _CmtStr.Trunc();
        if (Ch==TCh::CrCh){
          if (GetCh()==TCh::LfCh){GetCh();}
        } else
        if (Ch==TCh::LfCh){
          if (GetCh()==TCh::CrCh){GetCh();}
        }
        if (IsRetEoln){Sym=syEoln;} else {GetSym(Expect);}
        CmtStr=_CmtStr;
      } else
      if (Ch=='*'){
        TChA _CmtStr;
        do {
          while (GetCh()!='*'){_CmtStr+=Ch;}
          _CmtStr+=GetCh();
        } while (Ch!='/');
        _CmtStr.Pop(); _CmtStr.Pop(); _CmtStr.Trunc();
        GetCh(); GetSym(Expect);
        CmtStr=_CmtStr;
      } else {
        Sym=sySlash;
      }
    } else
    if (Ch==TCh::EofCh){
      Sym=syEof;
    } else {
      switch (Ch){
        case '.':
          if (GetCh()=='.'){Sym=syDPeriod; GetCh();}
          else {Sym=syPeriod;} break;
        case ',': Sym=syComma; GetCh(); break;
        case ':':
          if (GetCh()==':'){Sym=syDColon; GetCh();}
          else {Sym=syColon;} break;
        case ';': Sym=sySemicolon; GetCh(); break;
        case '+': Sym=syPlus; GetCh(); break;
        case '-': Sym=syMinus; GetCh(); break;
        case '*': Sym=syAsterisk; GetCh(); break;
        case '/': Sym=sySlash; GetCh(); break;
        case '%': Sym=syPercent; GetCh(); break;
        case '!': Sym=syExclamation; GetCh(); break;
        case '|': Sym=syVBar; GetCh(); break;
        case '&': Sym=syAmpersand; GetCh(); break;
        case '=': Sym=syEq; GetCh(); break;
        case '<':
          GetCh();
          if (Ch=='='){Sym=syLEq; GetCh();}
          else if (Ch=='>'){Sym=syNEq; GetCh();}
          else {Sym=syLss;} break;
        case '>':
          if (GetCh()=='='){Sym=syGEq; GetCh();}
          else {Sym=syGtr;} break;
        case '?': Sym=syQuestion; GetCh(); break;
        case '#':
          if (IsCmtAlw){
            TChA _CmtStr;
            do {_CmtStr+=GetCh();} while (!ChDef->IsTerm(Ch));
            _CmtStr.Pop(); _CmtStr.Trunc();
            if (Ch==TCh::CrCh){
              if (GetCh()==TCh::LfCh){GetCh();}
            } else
            if (Ch==TCh::LfCh){
              if (GetCh()==TCh::CrCh){GetCh();}
            }
            if (IsRetEoln){Sym=syEoln;} else {GetSym(Expect);}
            CmtStr=_CmtStr;
          } else {
            Sym=syHash; GetCh();
          }
          break;
        case '(': Sym=syLParen; GetCh(); break;
        case ')': Sym=syRParen; GetCh(); break;
        case '[': Sym=syLBracket; GetCh(); break;
        case ']': Sym=syRBracket; GetCh(); break;
        case '{': Sym=syLBrace; GetCh(); break;
        case '}': Sym=syRBrace; GetCh(); break;
        default: Sym=syUndef; GetCh(); break;
      }
    }
  }

  if ((!Expect.In(Sym))&&(!Expect.Empty())){
    if (IsExcept){
     TStr MsgStr=
      TStr("Unexpected symbol (")+GetSymStr()+") ["+GetFPosStr()+"]";
     throw PExcept(new TExcept(MsgStr));
    } else {
      Fail;
    }
  }
  return Sym;
}
TLxSym TILx::GetSym ( ) [inline]

Definition at line 171 of file lx.h.

{return GetSym(TFSet());}
TLxSym TILx::GetSym ( const TLxSym Sym) [inline]

Definition at line 172 of file lx.h.

{return GetSym(TFSet()|Sym);}
TLxSym TILx::GetSym ( const TLxSym Sym1,
const TLxSym Sym2 
) [inline]

Definition at line 173 of file lx.h.

                                                       {
    return GetSym(TFSet()|Sym1|Sym2);}
TLxSym TILx::GetSym ( const TLxSym Sym1,
const TLxSym Sym2,
const TLxSym Sym3 
) [inline]

Definition at line 175 of file lx.h.

                                                                           {
    return GetSym(TFSet()|Sym1|Sym2|Sym3);}
TLxSym TILx::GetSym ( const TLxSym Sym1,
const TLxSym Sym2,
const TLxSym Sym3,
const TLxSym Sym4 
) [inline]

Definition at line 177 of file lx.h.

                      {
    return GetSym(TFSet()|Sym1|Sym2|Sym3|Sym4);}
TStr TILx::GetSymStr ( ) const

Definition at line 594 of file lx.cpp.

                           {
  switch (Sym){
    case syInt: return Str;
    case syFlt: return Str;
    case syStr: return Str;
    case syIdStr: return Str;
    case syQStr: return Str;
    default:
      if ((syMnRw<=Sym)&&(Sym<=syMxRw)){return Str;}
      else {return TLxSymStr::GetSymStr(Sym);}
  }
}
void TILx::GetVar ( const TStr VarNm,
const bool &  LBracket = false,
const bool &  NewLn = false 
) [inline]

Definition at line 209 of file lx.h.

                                                       {
    GetIdStr(VarNm); GetSym(syColon);
    if (LBracket){GetSym(syLBracket);} if (NewLn){GetEoln();}}
bool TILx::GetVarBool ( const TStr VarNm,
const bool &  NewLn = true 
) [inline]

Definition at line 219 of file lx.h.

                                                            {
    GetIdStr(VarNm); GetSym(syColon); bool Bool=GetBool();
    if (NewLn){GetEoln();} return Bool;}
void TILx::GetVarBoolV ( const TStr VarNm,
TBoolV BoolV,
const bool &  NewLn = true 
)

Definition at line 632 of file lx.cpp.

                                                                         {
  BoolV.Clr();
  GetVar(VarNm, true, NewLn);
  while (GetSym(syRBracket, syBool)==syQStr){
    BoolV.Add(Bool); if (NewLn){GetEoln();}}
  if (NewLn){GetEoln();}
}
void TILx::GetVarEnd ( const bool &  RBracket = false,
const bool &  NewLn = false 
) [inline]

Definition at line 213 of file lx.h.

                                                                     {
    if (RBracket){GetSym(syRBracket);}
    if (NewLn){GetEoln();}}
double TILx::GetVarFlt ( const TStr VarNm,
const bool &  NewLn = true 
) [inline]

Definition at line 225 of file lx.h.

                                                             {
    GetIdStr(VarNm); GetSym(syColon); double Flt=GetFlt();
    if (NewLn){GetEoln();} return Flt;}
void TILx::GetVarFltV ( const TStr VarNm,
TFltV FltV,
const bool &  NewLn = true 
)

Definition at line 648 of file lx.cpp.

                                                                      {
  FltV.Clr();
  GetVar(VarNm, true, NewLn);
  while (GetSym(syRBracket, syFlt)==syFlt){
    FltV.Add(Flt); if (NewLn){GetEoln();}}
  if (NewLn){GetEoln();}
}
int TILx::GetVarInt ( const TStr VarNm,
const bool &  NewLn = true 
) [inline]

Definition at line 222 of file lx.h.

                                                          {
    GetIdStr(VarNm); GetSym(syColon); int Int=GetInt();
    if (NewLn){GetEoln();} return Int;}
void TILx::GetVarIntV ( const TStr VarNm,
TIntV IntV,
const bool &  NewLn = true 
)

Definition at line 640 of file lx.cpp.

                                                                      {
  IntV.Clr();
  GetVar(VarNm, true, NewLn);
  while (GetSym(syRBracket, syInt)==syInt){
    IntV.Add(Int); if (NewLn){GetEoln();}}
  if (NewLn){GetEoln();}
}
TSecTm TILx::GetVarSecTm ( const TStr VarNm,
const bool &  NewLn = true 
) [inline]

Definition at line 231 of file lx.h.

                                                               {
    GetIdStr(VarNm); GetSym(syColon); TSecTm SecTm=TSecTm::LoadTxt(*this);
    if (NewLn){GetEoln();} return SecTm;}
TStr TILx::GetVarStr ( const TStr VarNm,
const bool &  NewLn = true 
) [inline]

Definition at line 228 of file lx.h.

                                                           {
    GetIdStr(VarNm); GetSym(syColon); TStr Str=GetQStr();
    if (NewLn){GetEoln();} return Str;}
void TILx::GetVarStrPrV ( const TStr VarNm,
TStrPrV StrPrV,
const bool &  NewLn = true 
)

Definition at line 664 of file lx.cpp.

                                                                            {
  StrPrV.Clr();
  GetVar(VarNm, true, NewLn);
  while (GetSym(syRBracket, syLBracket)==syLBracket){
    TStr Str1=GetQStr(); TStr Str2=GetQStr();
    GetSym(syRBracket);
    StrPrV.Add(TStrPr(Str1, Str2)); if (NewLn){GetEoln();}
  }
  if (NewLn){GetEoln();}
}
void TILx::GetVarStrV ( const TStr VarNm,
TStrV StrV,
const bool &  NewLn = true 
)

Definition at line 656 of file lx.cpp.

                                                                      {
  StrV.Clr();
  GetVar(VarNm, true, NewLn);
  while (GetSym(syRBracket, syQStr)==syQStr){
    StrV.Add(Str); if (NewLn){GetEoln();}}
  if (NewLn){GetEoln();}
}
void TILx::GetVarStrVV ( const TStr VarNm,
TVec< TStrV > &  StrVV,
const bool &  NewLn = true 
)

Definition at line 675 of file lx.cpp.

                                                                              {
  StrVV.Clr();
  GetVar(VarNm, true, NewLn);
  while (GetSym(syRBracket, syLBracket)==syLBracket){
    StrVV.Add();
    while (GetSym(syQStr, syRBracket)==syQStr){
      StrVV.Last().Add(Str);}
    if (NewLn){GetEoln();}
  }
  if (NewLn){GetEoln();}
}
bool TILx::IsBof ( ) const [inline]

Definition at line 167 of file lx.h.

{return ChN==-1;}
bool TILx::IsEof ( ) const [inline]

Definition at line 168 of file lx.h.

{return Ch==TCh::EofCh;}
bool TILx::IsVar ( const TStr VarNm) [inline]

Definition at line 207 of file lx.h.

                               {
    GetSym(); bool Var=((Sym==syIdStr)&&(Str==VarNm)); PutSym(); return Var;}
TILx& TILx::operator= ( const TILx ) [inline]

Definition at line 159 of file lx.h.

{Fail; return *this;}
TLxSym TILx::PeekSym ( ) [inline]

Definition at line 200 of file lx.h.

{TLxSym NextSym=GetSym(); PutSym(); return NextSym;}
TLxSym TILx::PeekSym ( const int &  Syms)

Definition at line 580 of file lx.cpp.

                                   {
  TILxSymSt CurSymSt(*this);
  TSStack<TILxSymSt> SymStStack;
  for (int SymN=0; SymN<Syms; SymN++){
    GetSym(); SymStStack.Push(TILxSymSt(*this));}
  TLxSym PeekedSym=Sym;
  while (!SymStStack.Empty()){
    SymStStack.Top().Restore(*this); SymStStack.Pop();
    PutSym();
  }
  CurSymSt.Restore(*this);
  return PeekedSym;
}
bool TILx::PeekVarEnd ( const bool &  RBracket = false,
const bool &  NewLn = false 
) [inline]

Definition at line 216 of file lx.h.

                                                                      {
    if (RBracket){return PeekSym()==syRBracket;}
    if (NewLn){return PeekSym()==syEoln;} Fail; return false;}
void TILx::PutSym ( const TILxSymSt SymSt) [inline]

Definition at line 198 of file lx.h.

void TILx::PutSym ( ) [inline]

Definition at line 199 of file lx.h.

void TILx::SetOpt ( const int &  Opt,
const bool &  Val 
)

Definition at line 286 of file lx.cpp.

                                                {
  switch (Opt){
    case iloCmtAlw: IsCmtAlw=Val; break;
    case iloRetEoln: IsRetEoln=Val; break;
    case iloSigNum: IsSigNum=Val; break;
    case iloUniStr: IsUniStr=Val; break;
    case iloCsSens: IsCsSens=Val; break;
    case iloExcept: IsExcept=Val; break;
    case iloTabSep: IsTabSep=Val; break;
    case iloList: IsList=Val; break;
    default: Fail;
  }
}
void TILx::SkipToEoln ( )

Definition at line 573 of file lx.cpp.

                     {
  while ((Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)&&(Ch!=TCh::EofCh)){
    GetCh();}
  if (Ch==TCh::CrCh){if (GetCh()==TCh::LfCh){GetCh();}} else
  if (Ch==TCh::LfCh){if (GetCh()==TCh::CrCh){GetCh();}}
}
void TILx::SkipToSym ( const TLxSym SkipToSym) [inline]

Definition at line 195 of file lx.h.

                                         {
    while (Sym!=SkipToSym){GetSym();}}

Member Data Documentation

bool TILx::Bool

Definition at line 151 of file lx.h.

char TILx::Ch [private]

Definition at line 134 of file lx.h.

PLxChDef TILx::ChDef [private]

Definition at line 131 of file lx.h.

int TILx::ChN [private]

Definition at line 135 of file lx.h.

Definition at line 150 of file lx.h.

double TILx::Flt

Definition at line 151 of file lx.h.

int TILx::Int

Definition at line 151 of file lx.h.

bool TILx::IsCmtAlw [private]

Definition at line 138 of file lx.h.

bool TILx::IsCsSens [private]

Definition at line 138 of file lx.h.

bool TILx::IsExcept [private]

Definition at line 139 of file lx.h.

bool TILx::IsList [private]

Definition at line 139 of file lx.h.

bool TILx::IsRetEoln [private]

Definition at line 138 of file lx.h.

bool TILx::IsSigNum [private]

Definition at line 138 of file lx.h.

bool TILx::IsTabSep [private]

Definition at line 139 of file lx.h.

bool TILx::IsUniStr [private]

Definition at line 138 of file lx.h.

int TILx::LnChN [private]

Definition at line 135 of file lx.h.

int TILx::LnN [private]

Definition at line 135 of file lx.h.

char TILx::PrevCh [private]

Definition at line 134 of file lx.h.

Definition at line 136 of file lx.h.

Definition at line 154 of file lx.h.

Definition at line 153 of file lx.h.

TSIn& TILx::RSIn [private]

Definition at line 133 of file lx.h.

Definition at line 137 of file lx.h.

PSIn TILx::SIn [private]

Definition at line 132 of file lx.h.

Definition at line 150 of file lx.h.

Definition at line 149 of file lx.h.

Definition at line 152 of file lx.h.

Definition at line 152 of file lx.h.

Definition at line 152 of file lx.h.

Definition at line 150 of file lx.h.


The documentation for this class was generated from the following files: