SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TILx Class Reference

#include <lx.h>

Collaboration diagram for TILx:

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.

References iloMx, TFSet::In(), and SetOpt().

270  :
271  ChDef(TLxChDef::GetChDef(ChDefTy)),
272  SIn(_SIn), RSIn(*SIn),
273  PrevCh(' '), Ch(' '), LnN(0), LnChN(0-1), ChN(0-1),
274  PrevSymStStack(), RwStrH(50),
275  IsCmtAlw(false), IsRetEoln(false), IsSigNum(false),
276  IsUniStr(false), IsCsSens(false), IsExcept(false),
277  IsTabSep(false), IsList(false),
278  Sym(syUndef),
279  Str(), UcStr(), CmtStr(),
280  Bool(false), Int(0), Flt(0),
281  SymLnN(-1), SymLnChN(-1), SymChN(-1){
282  for (int Opt=0; Opt<iloMx; Opt++){
283  if (OptSet.In(Opt)){SetOpt(Opt, true);}}
284 }
char Ch
Definition: lx.h:134
bool IsCsSens
Definition: lx.h:138
int SymLnN
Definition: lx.h:152
TStrIntH RwStrH
Definition: lx.h:137
bool IsTabSep
Definition: lx.h:139
bool IsList
Definition: lx.h:139
int ChN
Definition: lx.h:135
bool IsRetEoln
Definition: lx.h:138
void SetOpt(const int &Opt, const bool &Val)
Definition: lx.cpp:286
TLxSym Sym
Definition: lx.h:149
TSIn & RSIn
Definition: lx.h:133
TChA UcStr
Definition: lx.h:150
int LnN
Definition: lx.h:135
bool IsSigNum
Definition: lx.h:138
Definition: lx.h:45
PSIn SIn
Definition: lx.h:132
char PrevCh
Definition: lx.h:134
bool IsUniStr
Definition: lx.h:138
bool IsExcept
Definition: lx.h:139
bool IsCmtAlw
Definition: lx.h:138
TChA Str
Definition: lx.h:150
TSStack< TILxSymSt > PrevSymStStack
Definition: lx.h:136
bool Bool
Definition: lx.h:151
int SymLnChN
Definition: lx.h:152
int LnChN
Definition: lx.h:135
PLxChDef ChDef
Definition: lx.h:131
int Int
Definition: lx.h:151
int SymChN
Definition: lx.h:152
static PLxChDef GetChDef(const TLxChDefTy &ChDefTy=lcdtUsAscii)
Definition: lx.cpp:79
TChA CmtStr
Definition: lx.h:150
double Flt
Definition: lx.h:151
Definition: lx.h:127
bool In(const int &FlagN) const
Definition: bits.h:156

Here is the call graph for this function:

Member Function Documentation

TLxSym TILx::AddRw ( const TStr Str)

Definition at line 300 of file lx.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), ChDef, TLxChDef::GetUcStr(), IAssert, THash< TKey, TDat, THashFunc >::IsKey(), THash< TKey, TDat, THashFunc >::Len(), RwStrH, syMnRw, syMxRw, and UcStr.

300  {
302  TStr UcStr=ChDef->GetUcStr(Str);
303  IAssert(!RwStrH.IsKey(UcStr));
304  TLxSym RwSym=TLxSym(syMnRw+RwStrH.Len());
305  RwStrH.AddDat(Str, TInt(int(RwSym)));
306  return RwSym;
307 }
#define IAssert(Cond)
Definition: bd.h:262
Definition: lx.h:53
TStrIntH RwStrH
Definition: lx.h:137
TLxSym
Definition: lx.h:44
Definition: lx.h:52
TChA UcStr
Definition: lx.h:150
Definition: dt.h:1137
Definition: dt.h:412
PLxChDef ChDef
Definition: lx.h:131
TStr GetUcStr(const TStr &Str) const
Definition: lx.cpp:71
bool IsKey(const TKey &Key) const
Definition: hash.h:258
int Len() const
Definition: hash.h:228
TDat & AddDat(const TKey &Key)
Definition: hash.h:238

Here is the call graph for this function:

bool TILx::GetBool ( )
inline

Definition at line 180 of file lx.h.

References Bool, GetSym(), and syBool.

Referenced by GetVarBool().

180 {GetSym(TFSet()|syBool); return Bool;}
Definition: lx.h:45
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171
bool Bool
Definition: lx.h:151

Here is the call graph for this function:

Here is the caller graph for this function:

char TILx::GetCh ( )
inlineprivate

Definition at line 140 of file lx.h.

References Assert, Ch, TSIn::Eof(), TCh::EofCh, and TSIn::GetCh().

Referenced by GetSIn(), GetStrToCh(), GetStrToEoln(), GetStrToEolnAndCh(), GetStrToEolnOrCh(), GetSym(), and SkipToEoln().

140  {
141  Assert(Ch!=TCh::EofCh);
142  PrevCh=Ch; LnChN++; ChN++;
143  Ch=((RSIn.Eof()) ? TCh::EofCh : RSIn.GetCh());
144  if (IsList){putchar(Ch);}
145  return Ch;
146  }
char Ch
Definition: lx.h:134
bool IsList
Definition: lx.h:139
int ChN
Definition: lx.h:135
static const char EofCh
Definition: dt.h:1040
TSIn & RSIn
Definition: lx.h:133
virtual bool Eof()=0
char PrevCh
Definition: lx.h:134
#define Assert(Cond)
Definition: bd.h:251
int LnChN
Definition: lx.h:135
virtual char GetCh()=0

Here is the call graph for this function:

Here is the caller graph for this function:

char TILx::GetChX ( )
inlineprivate

Definition at line 147 of file lx.h.

References Ch, and GetChX().

Referenced by GetChX().

147 {char Ch=GetChX(); printf("%c", Ch); return Ch;}
char Ch
Definition: lx.h:134
char GetChX()
Definition: lx.h:147

Here is the call graph for this function:

Here is the caller graph for this function:

void TILx::GetEoln ( )
inline

Definition at line 189 of file lx.h.

References GetSym(), and syEoln.

Referenced by GetVar(), GetVarBool(), GetVarBoolV(), GetVarEnd(), GetVarFlt(), GetVarFltV(), GetVarInt(), GetVarIntV(), GetVarSecTm(), GetVarStr(), GetVarStrPrV(), GetVarStrV(), and GetVarStrVV().

189 {GetSym(TFSet()|syEoln);}
Definition: bits.h:119
Definition: lx.h:51
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

double TILx::GetFlt ( )
inline

Definition at line 182 of file lx.h.

References Flt, GetSym(), and syFlt.

Referenced by GetVarFlt().

182 {GetSym(TFSet()|syFlt); return Flt;}
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171
Definition: lx.h:45
double Flt
Definition: lx.h:151

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TILx::GetFPosStr ( ) const

Definition at line 607 of file lx.cpp.

References TSBase::GetSNm(), TInt::GetStr(), LnChN, LnN, and SIn.

Referenced by GetSym().

607  {
608  TChA ChA;
609  ChA+="File:"; ChA+=SIn->GetSNm();
610  ChA+=" Line:"; ChA+=TInt::GetStr(LnN+1);
611  ChA+=" Char:"; ChA+=TInt::GetStr(LnChN);
612  return ChA;
613 }
TStr GetStr() const
Definition: dt.h:1200
int LnN
Definition: lx.h:135
PSIn SIn
Definition: lx.h:132
Definition: dt.h:201
int LnChN
Definition: lx.h:135
virtual TStr GetSNm() const
Definition: fl.cpp:20

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TILx::GetIdStr ( const TStr IdStr = TStr())
inline

Definition at line 185 of file lx.h.

References GetSym(), IAssert, Str, and syIdStr.

Referenced by GetVar(), GetVarBool(), GetVarFlt(), GetVarInt(), GetVarSecTm(), and GetVarStr().

185  {
186  GetSym(TFSet()|syIdStr); IAssert(IdStr.Empty()||(IdStr==Str)); return Str;}
#define IAssert(Cond)
Definition: bd.h:262
Definition: bits.h:119
Definition: lx.h:45
TLxSym GetSym()
Definition: lx.h:171
TChA Str
Definition: lx.h:150
bool Empty() const
Definition: dt.h:491

Here is the call graph for this function:

Here is the caller graph for this function:

int TILx::GetInt ( )
inline

Definition at line 181 of file lx.h.

References GetSym(), Int, and syInt.

Referenced by GetVarInt(), TRnd::LoadTxt(), and TSecTm::LoadTxt().

181 {GetSym(TFSet()|syInt); return Int;}
Definition: lx.h:45
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171
int Int
Definition: lx.h:151

Here is the call graph for this function:

Here is the caller graph for this function:

int TILx::GetLnN ( ) const
inline

Definition at line 166 of file lx.h.

References LnN.

166 {return LnN;}
int LnN
Definition: lx.h:135
void TILx::GetLnV ( const TStr FNm,
TStrV LnV 
)
static

Definition at line 687 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), Ch, TChA::Clr(), TVec< TVal, TSizeTy >::Clr(), TCh::CrCh, TChA::Empty(), TFIn::Eof(), TFIn::GetCh(), TCh::LfCh, PrevCh, and SIn.

687  {
688  TFIn SIn(FNm); LnV.Clr(); TChA Ln;
689  if (!SIn.Eof()){
690  char Ch=SIn.GetCh();
691  while (!SIn.Eof()){
692  if ((Ch==TCh::CrCh)||(Ch==TCh::LfCh)){
693  if (!SIn.Eof()){
694  char PrevCh=Ch; Ch=SIn.GetCh();
695  if (!SIn.Eof()){
696  if (PrevCh==TCh::CrCh){if (Ch==TCh::LfCh){Ch=SIn.GetCh();}} else
697  if (PrevCh==TCh::LfCh){if (Ch==TCh::CrCh){Ch=SIn.GetCh();}}
698  }
699  }
700  LnV.Add(Ln); Ln.Clr();
701  } else {
702  Ln+=Ch; Ch=SIn.GetCh();
703  }
704  }
705  if (!Ln.Empty()){
706  LnV.Add(Ln);}
707  }
708 }
char Ch
Definition: lx.h:134
bool Empty() const
Definition: dt.h:260
void Clr()
Definition: dt.h:258
Definition: fl.h:275
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
PSIn SIn
Definition: lx.h:132
char PrevCh
Definition: lx.h:134
static const char LfCh
Definition: dt.h:1038
Definition: dt.h:201
static const char CrCh
Definition: dt.h:1039
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

TStr TILx::GetQStr ( const TStr QStr = TStr())
inline

Definition at line 187 of file lx.h.

References GetSym(), IAssert, Str, and syQStr.

Referenced by GetVarStr(), and GetVarStrPrV().

187  {
188  GetSym(TFSet()|syQStr); IAssert(QStr.Empty()||(Str==QStr)); return Str;}
#define IAssert(Cond)
Definition: bd.h:262
Definition: bits.h:119
Definition: lx.h:45
TLxSym GetSym()
Definition: lx.h:171
TChA Str
Definition: lx.h:150
bool Empty() const
Definition: dt.h:491

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TILx::GetQStr ( const TStr Str,
const bool &  QuoteP,
const char &  QuoteCh 
)
static

Definition at line 615 of file lx.cpp.

References Ch, ChN, TStr::CStr(), TStr::Len(), QuoteCh, and Str.

615  {
616  if (QuoteP){
617  TChA ChA;
618  ChA+=QuoteCh;
619  int StrLen=Str.Len();
620  for (int ChN=0; ChN<StrLen; ChN++){
621  char Ch=Str.CStr()[ChN];
622  if (Ch==QuoteCh){ChA+=QuoteCh; ChA+=QuoteCh;}
623  else {ChA+=Ch;}
624  }
625  ChA+=QuoteCh;
626  return ChA;
627  } else {
628  return Str;
629  }
630 }
char Ch
Definition: lx.h:134
int Len() const
Definition: dt.h:490
int ChN
Definition: lx.h:135
bool QuoteP
Definition: lx.h:153
char QuoteCh
Definition: lx.h:154
TChA Str
Definition: lx.h:150
Definition: dt.h:201
char * CStr()
Definition: dt.h:479

Here is the call graph for this function:

TLxSym TILx::GetRw ( const TStr Str)
inline

Definition at line 163 of file lx.h.

References THash< TKey, TDat, THashFunc >::GetDat().

163  {
164  return TLxSym(int(RwStrH.GetDat(Str)));}
TStrIntH RwStrH
Definition: lx.h:137
TLxSym
Definition: lx.h:44
const TDat & GetDat(const TKey &Key) const
Definition: hash.h:262

Here is the call graph for this function:

PSIn TILx::GetSIn ( const char &  SepCh)

Definition at line 309 of file lx.cpp.

References Ch, TSStack< TVal >::Empty(), TCh::EofCh, GetCh(), IAssert, PrevSymStStack, and SIn.

309  {
311  while ((Ch!=TCh::EofCh)&&(Ch!=SepCh)){GetCh();}
312  return SIn;
313 }
#define IAssert(Cond)
Definition: bd.h:262
char Ch
Definition: lx.h:134
bool Empty()
Definition: ds.h:2591
static const char EofCh
Definition: dt.h:1040
PSIn SIn
Definition: lx.h:132
TSStack< TILxSymSt > PrevSymStStack
Definition: lx.h:136
char GetCh()
Definition: lx.h:140

Here is the call graph for this function:

TStr TILx::GetStr ( const TStr _Str = TStr())
inline

Definition at line 183 of file lx.h.

References GetSym(), IAssert, Str, and syStr.

183  {
184  GetSym(TFSet()|syStr); IAssert(_Str.Empty()||(_Str==Str)); return Str;}
#define IAssert(Cond)
Definition: bd.h:262
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171
TChA Str
Definition: lx.h:150
bool Empty() const
Definition: dt.h:491
Definition: lx.h:45

Here is the call graph for this function:

TStr TILx::GetStrToCh ( const char &  ToCh)

Definition at line 539 of file lx.cpp.

References TChA::AddCh(), Ch, ChDef, TChA::Clr(), TCh::EofCh, GetCh(), TLxChDef::GetUc(), Str, Sym, syStr, and UcStr.

539  {
540  Sym=syStr; Str.Clr(); UcStr.Clr();
541  while ((Ch!=ToCh)&&(Ch!=TCh::EofCh)){
542  Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
543  return Str;
544 }
char Ch
Definition: lx.h:134
void Clr()
Definition: dt.h:258
void AddCh(const char &Ch, const int &MxLen=-1)
Definition: dt.h:271
char GetUc(const char &Ch) const
Definition: lx.h:32
TLxSym Sym
Definition: lx.h:149
static const char EofCh
Definition: dt.h:1040
TChA UcStr
Definition: lx.h:150
TChA Str
Definition: lx.h:150
char GetCh()
Definition: lx.h:140
PLxChDef ChDef
Definition: lx.h:131
Definition: lx.h:45

Here is the call graph for this function:

TStr TILx::GetStrToEoln ( const bool &  DoTrunc = false)

Definition at line 553 of file lx.cpp.

References TChA::AddCh(), Ch, ChDef, TChA::Clr(), TCh::CrCh, TCh::EofCh, GetCh(), TLxChDef::GetUc(), TCh::LfCh, Str, Sym, syStr, TChA::ToTrunc(), and UcStr.

553  {
554  Sym=syStr; Str.Clr(); UcStr.Clr();
555  while ((Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)&&(Ch!=TCh::EofCh)){
556  Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
557  if (DoTrunc){Str.ToTrunc(); UcStr.ToTrunc();}
558  return Str;
559 }
char Ch
Definition: lx.h:134
void Clr()
Definition: dt.h:258
void AddCh(const char &Ch, const int &MxLen=-1)
Definition: dt.h:271
char GetUc(const char &Ch) const
Definition: lx.h:32
TLxSym Sym
Definition: lx.h:149
static const char EofCh
Definition: dt.h:1040
TChA UcStr
Definition: lx.h:150
TChA Str
Definition: lx.h:150
static const char LfCh
Definition: dt.h:1038
char GetCh()
Definition: lx.h:140
static const char CrCh
Definition: dt.h:1039
PLxChDef ChDef
Definition: lx.h:131
TChA & ToTrunc()
Definition: dt.cpp:568
Definition: lx.h:45

Here is the call graph for this function:

TStr TILx::GetStrToEolnAndCh ( const char &  ToCh)

Definition at line 561 of file lx.cpp.

References TChA::AddCh(), Ch, ChDef, ChN, TChA::Clr(), TCh::CrCh, TCh::EofCh, forever, GetCh(), TLxChDef::GetUc(), IsBof(), TCh::LfCh, PrevCh, Str, Sym, syStr, and UcStr.

561  {
562  Sym=syStr; Str.Clr(); UcStr.Clr();
563  if (IsBof()){GetCh();}
564  forever {
565  if (Ch==TCh::EofCh){break;}
566  if (((ChN==0)||(PrevCh==TCh::CrCh)||(PrevCh==TCh::LfCh))&&(Ch==ToCh)){
567  GetCh(); break;}
568  else {Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
569  }
570  return Str;
571 }
char Ch
Definition: lx.h:134
#define forever
Definition: bd.h:6
void Clr()
Definition: dt.h:258
void AddCh(const char &Ch, const int &MxLen=-1)
Definition: dt.h:271
int ChN
Definition: lx.h:135
char GetUc(const char &Ch) const
Definition: lx.h:32
TLxSym Sym
Definition: lx.h:149
static const char EofCh
Definition: dt.h:1040
TChA UcStr
Definition: lx.h:150
char PrevCh
Definition: lx.h:134
TChA Str
Definition: lx.h:150
static const char LfCh
Definition: dt.h:1038
bool IsBof() const
Definition: lx.h:167
char GetCh()
Definition: lx.h:140
static const char CrCh
Definition: dt.h:1039
PLxChDef ChDef
Definition: lx.h:131
Definition: lx.h:45

Here is the call graph for this function:

TStr TILx::GetStrToEolnOrCh ( const char &  ToCh)

Definition at line 546 of file lx.cpp.

References TChA::AddCh(), Ch, ChDef, TChA::Clr(), TCh::CrCh, TCh::EofCh, GetCh(), TLxChDef::GetUc(), TCh::LfCh, Str, Sym, syStr, and UcStr.

546  {
547  Sym=syStr; Str.Clr(); UcStr.Clr();
548  while ((Ch!=ToCh)&&(Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)&&(Ch!=TCh::EofCh)){
549  Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
550  return Str;
551 }
char Ch
Definition: lx.h:134
void Clr()
Definition: dt.h:258
void AddCh(const char &Ch, const int &MxLen=-1)
Definition: dt.h:271
char GetUc(const char &Ch) const
Definition: lx.h:32
TLxSym Sym
Definition: lx.h:149
static const char EofCh
Definition: dt.h:1040
TChA UcStr
Definition: lx.h:150
TChA Str
Definition: lx.h:150
static const char LfCh
Definition: dt.h:1038
char GetCh()
Definition: lx.h:140
static const char CrCh
Definition: dt.h:1039
PLxChDef ChDef
Definition: lx.h:131
Definition: lx.h:45

Here is the call graph for this function:

TLxSym TILx::GetSym ( const TFSet Expect)

Definition at line 315 of file lx.cpp.

References TChA::AddCh(), Bool, Ch, ChDef, ChN, TChA::Clr(), CmtStr, TCh::CrCh, TChA::CStr(), EAssertR, TFSet::Empty(), THash< TKey, TDat, THashFunc >::Empty(), TSStack< TVal >::Empty(), TUnicode::EncodeUtf8(), TCh::EofCh, Fail, Flt, forever, GetCh(), GetFPosStr(), TCh::GetHex(), THash< TKey, TDat, THashFunc >::GetKeyId(), GetSym(), GetSymStr(), TLxChDef::GetUc(), TBool::GetValFromStr(), IAssert, TFSet::In(), Int, TLxChDef::IsAlNum(), TLxChDef::IsAlpha(), IsBof(), IsCmtAlw, IsCsSens, IsExcept, TCh::IsHex(), TLxChDef::IsNum(), IsRetEoln, IsSigNum, TLxChDef::IsSpace(), IsTabSep, TLxChDef::IsTerm(), IsUniStr, TBool::IsValStr(), TCh::LfCh, LnChN, LnN, TChA::Pop(), TSStack< TVal >::Pop(), PrevSymStStack, QuoteCh, QuoteP, TILxSymSt::Restore(), RwStrH, Str, syAmpersand, syAsterisk, syBool, syColon, syComma, syDColon, syDPeriod, syEof, syEoln, syEq, syExclamation, syFlt, syGEq, syGtr, syHash, syIdStr, syInt, syLBrace, syLBracket, syLEq, syLn, syLParen, syLss, Sym, SymChN, syMinus, SymLnChN, SymLnN, syNEq, syPercent, syPeriod, syPlus, syQStr, syQuestion, syRBrace, syRBracket, syRParen, sySemicolon, sySlash, syStr, syTab, syUndef, syVBar, TCh::TabCh, TSStack< TVal >::Top(), TChA::Trunc(), and UcStr.

Referenced by TJsonVal::GetValFromLx(), TJsonVal::GetValFromSIn(), and TLAMisc::LoadMatlabTFltVV().

315  {
316  CmtStr.Clr();
317  if (!PrevSymStStack.Empty()){
318  // symbols already on the stack
320  } else
321  if (Expect.In(syLn)){
322  // symbol is the whole line string
323  if (Ch==TCh::EofCh){
324  Sym=syEof;
325  } else {
326  Str.Clr();
327  if (IsBof()){GetCh();}
328  while (!ChDef->IsTerm(Ch)){Str.AddCh(Ch); GetCh();}
329  bool _IsRetEoln=IsRetEoln; IsRetEoln=true;
331  IsRetEoln=_IsRetEoln;
332  }
333  } else
334  if (IsTabSep){
335  // symbol is between tab characters
336  if (IsBof()){GetCh();}
337  if (Ch==TCh::TabCh){ // tab character
338  Sym=syTab; GetCh();
339  } else
340  if (ChDef->IsTerm(Ch)){ // eoln & eof characters
341  bool _IsRetEoln=IsRetEoln; IsRetEoln=true; IsTabSep=false;
343  IsRetEoln=_IsRetEoln; IsTabSep=true;
344  } else {
345  Str.Clr();
346  while ((!ChDef->IsTerm(Ch))&&(Ch!=TCh::TabCh)){
347  Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
348  Sym=syStr; QuoteP=false;
349  }
350  } else {
351  // usual symbol
352  while (ChDef->IsSpace(Ch)){GetCh();}
354 
355  if (ChDef->IsAlpha(Ch)){
356  if (IsUniStr){Sym=syStr;} else {Sym=syIdStr;}
357  Str.Clr(); UcStr.Clr(); QuoteP=false;
358  do {Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch));}
359  while (ChDef->IsAlNum(GetCh()));
360  if (!RwStrH.Empty()){
361  TStr RwStr=Str; if (!IsCsSens){RwStr=UcStr;}
362  int SymKeyId=RwStrH.GetKeyId(RwStr);
363  if (SymKeyId!=-1){Sym=TLxSym(int(RwStrH[SymKeyId]));}
364  }
365  if (Expect.In(syBool)){
368  }
369  } else
370  if ((Ch=='"')||(Ch=='\'')){
371  if (IsUniStr){Sym=syStr;} else {Sym=syQStr;}
372  Str.Clr(); UcStr.Clr(); QuoteP=true; QuoteCh=Ch;
373  GetCh();
374  forever{
375  while ((Ch!=QuoteCh)&&(Ch!='\\')&&(Ch!=TCh::EofCh)){
376  Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh();}
377  if (Ch==TCh::EofCh){
378  Sym=syUndef; break;
379  } else if (Ch==QuoteCh){
380  GetCh(); break;
381  } else {
382  GetCh();
383  switch (Ch){
384  case '"': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
385  case '\\': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
386  case '\'': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
387  case '/': Str.AddCh(Ch); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
388  case 'b': Str.AddCh('\b'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
389  case 'f': Str.AddCh('\f'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
390  case 'n': Str.AddCh('\n'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
391  case 'r': Str.AddCh('\r'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
392  case 't': Str.AddCh('\t'); UcStr.AddCh(ChDef->GetUc(Ch)); GetCh(); break;
393  case 'u': {
394  // unicode character, represented using 4 hexadecimal digits
395  GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
396  int UChCd = TCh::GetHex(Ch);
397  GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
398  UChCd = 16 * UChCd + TCh::GetHex(Ch);
399  GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
400  UChCd = 16 * UChCd + TCh::GetHex(Ch);
401  GetCh(); EAssertR(TCh::IsHex(Ch), "Invalid hexadecimal digit in unicode escape");
402  UChCd = 16 * UChCd + TCh::GetHex(Ch);
403  // get as UTF8 encoded characters
404  TUnicode::EncodeUtf8(UChCd, Str);
405  TUnicode::EncodeUtf8(UChCd, UcStr); }
406  GetCh(); break;
407  default: Sym=syUndef; break;
408  }
409  if (Sym==syUndef){
410  throw PExcept(new TExcept("Invalid Escape Sequence in Quoted String"));}
411  }
412  }
413  } else
414  if ((ChDef->IsNum(Ch))||(IsSigNum&&((Ch=='+')||(Ch=='-')))){
415  Str.Clr(); bool IntP=true;
416  do {Str.AddCh(Ch);} while (ChDef->IsNum(GetCh()));
417  if (Expect.In(syFlt)){
418  if (Ch=='.'){
419  Str.AddCh(Ch); IntP=false;
420  while (ChDef->IsNum(GetCh())){Str.AddCh(Ch);}
421  }
422  if ((Ch=='e')||(Ch=='E')){
423  Str.AddCh(Ch); GetCh(); IntP=false;
424  if ((Ch=='+')||(Ch=='-')){Str.AddCh(Ch); GetCh();}
425  while (ChDef->IsNum(Ch)){Str.AddCh(Ch); GetCh();}
426  }
427  }
428  UcStr=Str;
429  if (IntP&&(Expect.In(syInt))){
430  Sym=syInt; Int=atoi(Str.CStr());
431  } else {
432  Sym=syFlt; Flt=atof(Str.CStr());
433  }
434  } else
435  if ((Ch==TCh::CrCh)||(Ch==TCh::LfCh)){
436  Sym=syEoln;
437  if (Ch==TCh::CrCh){if (GetCh()==TCh::LfCh){GetCh();}} else
438  if (Ch==TCh::LfCh){if (GetCh()==TCh::CrCh){GetCh();}}
439  LnN++; LnChN=0; if (!IsRetEoln){GetSym(Expect);}
440  } else
441  if (Ch=='/'){
442  GetCh();
443  if ((IsCmtAlw)&&(Ch=='/')){
444  TChA _CmtStr;
445  do {_CmtStr+=GetCh();} while (!ChDef->IsTerm(Ch));
446  _CmtStr.Pop(); _CmtStr.Trunc();
447  if (Ch==TCh::CrCh){
448  if (GetCh()==TCh::LfCh){GetCh();}
449  } else
450  if (Ch==TCh::LfCh){
451  if (GetCh()==TCh::CrCh){GetCh();}
452  }
453  if (IsRetEoln){Sym=syEoln;} else {GetSym(Expect);}
454  CmtStr=_CmtStr;
455  } else
456  if (Ch=='*'){
457  TChA _CmtStr;
458  do {
459  while (GetCh()!='*'){_CmtStr+=Ch;}
460  _CmtStr+=GetCh();
461  } while (Ch!='/');
462  _CmtStr.Pop(); _CmtStr.Pop(); _CmtStr.Trunc();
463  GetCh(); GetSym(Expect);
464  CmtStr=_CmtStr;
465  } else {
466  Sym=sySlash;
467  }
468  } else
469  if (Ch==TCh::EofCh){
470  Sym=syEof;
471  } else {
472  switch (Ch){
473  case '.':
474  if (GetCh()=='.'){Sym=syDPeriod; GetCh();}
475  else {Sym=syPeriod;} break;
476  case ',': Sym=syComma; GetCh(); break;
477  case ':':
478  if (GetCh()==':'){Sym=syDColon; GetCh();}
479  else {Sym=syColon;} break;
480  case ';': Sym=sySemicolon; GetCh(); break;
481  case '+': Sym=syPlus; GetCh(); break;
482  case '-': Sym=syMinus; GetCh(); break;
483  case '*': Sym=syAsterisk; GetCh(); break;
484  case '/': Sym=sySlash; GetCh(); break;
485  case '%': Sym=syPercent; GetCh(); break;
486  case '!': Sym=syExclamation; GetCh(); break;
487  case '|': Sym=syVBar; GetCh(); break;
488  case '&': Sym=syAmpersand; GetCh(); break;
489  case '=': Sym=syEq; GetCh(); break;
490  case '<':
491  GetCh();
492  if (Ch=='='){Sym=syLEq; GetCh();}
493  else if (Ch=='>'){Sym=syNEq; GetCh();}
494  else {Sym=syLss;} break;
495  case '>':
496  if (GetCh()=='='){Sym=syGEq; GetCh();}
497  else {Sym=syGtr;} break;
498  case '?': Sym=syQuestion; GetCh(); break;
499  case '#':
500  if (IsCmtAlw){
501  TChA _CmtStr;
502  do {_CmtStr+=GetCh();} while (!ChDef->IsTerm(Ch));
503  _CmtStr.Pop(); _CmtStr.Trunc();
504  if (Ch==TCh::CrCh){
505  if (GetCh()==TCh::LfCh){GetCh();}
506  } else
507  if (Ch==TCh::LfCh){
508  if (GetCh()==TCh::CrCh){GetCh();}
509  }
510  if (IsRetEoln){Sym=syEoln;} else {GetSym(Expect);}
511  CmtStr=_CmtStr;
512  } else {
513  Sym=syHash; GetCh();
514  }
515  break;
516  case '(': Sym=syLParen; GetCh(); break;
517  case ')': Sym=syRParen; GetCh(); break;
518  case '[': Sym=syLBracket; GetCh(); break;
519  case ']': Sym=syRBracket; GetCh(); break;
520  case '{': Sym=syLBrace; GetCh(); break;
521  case '}': Sym=syRBrace; GetCh(); break;
522  default: Sym=syUndef; GetCh(); break;
523  }
524  }
525  }
526 
527  if ((!Expect.In(Sym))&&(!Expect.Empty())){
528  if (IsExcept){
529  TStr MsgStr=
530  TStr("Unexpected symbol (")+GetSymStr()+") ["+GetFPosStr()+"]";
531  throw PExcept(new TExcept(MsgStr));
532  } else {
533  Fail;
534  }
535  }
536  return Sym;
537 }
#define IAssert(Cond)
Definition: bd.h:262
static bool IsHex(const char &Ch)
Definition: dt.h:1070
char Ch
Definition: lx.h:134
Definition: lx.h:49
Definition: lx.h:49
Definition: lx.h:50
bool Empty()
Definition: ds.h:2591
bool IsCsSens
Definition: lx.h:138
int SymLnN
Definition: lx.h:152
bool IsAlNum(const char &Ch) const
Definition: lx.h:30
Definition: lx.h:45
TPt< TExcept > PExcept
Definition: bd.h:198
Definition: lx.h:50
Definition: lx.h:49
Definition: lx.h:45
TStr GetSymStr() const
Definition: lx.cpp:594
bool Empty() const
Definition: bits.h:145
#define forever
Definition: bd.h:6
TStrIntH RwStrH
Definition: lx.h:137
Definition: lx.h:48
Definition: lx.h:46
TVal & Top()
Definition: ds.h:2595
bool IsTabSep
Definition: lx.h:139
#define Fail
Definition: bd.h:238
bool IsSpace(const char &Ch) const
Definition: lx.h:27
TLxSym
Definition: lx.h:44
void Clr()
Definition: dt.h:258
Definition: lx.h:45
void AddCh(const char &Ch, const int &MxLen=-1)
Definition: dt.h:271
bool IsAlpha(const char &Ch) const
Definition: lx.h:28
Definition: lx.h:48
Definition: bits.h:119
Definition: lx.h:47
bool Empty() const
Definition: hash.h:227
Definition: lx.h:51
static int GetHex(const char &Ch)
Definition: dt.h:1072
Definition: lx.h:45
int ChN
Definition: lx.h:135
Definition: lx.h:45
bool IsRetEoln
Definition: lx.h:138
void Restore(TILx &Lx)
Definition: lx.cpp:262
Definition: lx.h:47
bool QuoteP
Definition: lx.h:153
Definition: lx.h:49
char GetUc(const char &Ch) const
Definition: lx.h:32
TLxSym Sym
Definition: lx.h:149
static bool GetValFromStr(const TStr &Str)
Definition: dt.cpp:1850
char QuoteCh
Definition: lx.h:154
static const char EofCh
Definition: dt.h:1040
Definition: lx.h:50
TChA UcStr
Definition: lx.h:150
int LnN
Definition: lx.h:135
bool IsSigNum
Definition: lx.h:138
Definition: lx.h:45
TLxSym GetSym()
Definition: lx.h:171
char * CStr()
Definition: dt.h:255
static const char TabCh
Definition: dt.h:1037
Definition: lx.h:47
Definition: lx.h:49
Definition: lx.h:51
bool IsUniStr
Definition: lx.h:138
bool IsExcept
Definition: lx.h:139
Definition: lx.h:50
bool IsNum(const char &Ch) const
Definition: lx.h:29
bool IsCmtAlw
Definition: lx.h:138
void Trunc()
Definition: dt.cpp:420
Definition: lx.h:49
Definition: lx.h:45
TChA Str
Definition: lx.h:150
static const char LfCh
Definition: dt.h:1038
int GetKeyId(const TKey &Key) const
Definition: hash.h:466
TSStack< TILxSymSt > PrevSymStStack
Definition: lx.h:136
bool Bool
Definition: lx.h:151
Definition: lx.h:47
Definition: dt.h:201
Definition: ut.h:161
Definition: lx.h:48
bool IsBof() const
Definition: lx.h:167
int SymLnChN
Definition: lx.h:152
char GetCh()
Definition: lx.h:140
static bool IsValStr(const TStr &Str)
Definition: dt.cpp:1842
Definition: lx.h:46
Definition: lx.h:50
void Pop()
Definition: ds.h:2599
Definition: dt.h:412
int LnChN
Definition: lx.h:135
bool IsTerm(const char &Ch) const
Definition: lx.h:26
static const char CrCh
Definition: dt.h:1039
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
Definition: lx.h:46
PLxChDef ChDef
Definition: lx.h:131
int Int
Definition: lx.h:151
Definition: lx.h:47
int SymChN
Definition: lx.h:152
Definition: lx.h:46
Definition: lx.h:45
int EncodeUtf8(const TIntV &src, TIntV &dest) const
Definition: unicode.h:1792
TStr GetFPosStr() const
Definition: lx.cpp:607
char Pop()
Definition: dt.h:265
Definition: lx.h:46
Definition: lx.h:45
TChA CmtStr
Definition: lx.h:150
Definition: lx.h:46
Definition: lx.h:48
Definition: lx.h:50
double Flt
Definition: lx.h:151
bool In(const int &FlagN) const
Definition: bits.h:156

Here is the call graph for this function:

Here is the caller graph for this function:

TLxSym TILx::GetSym ( )
inline

Definition at line 171 of file lx.h.

References GetSym().

Referenced by GetBool(), GetEoln(), GetFlt(), GetIdStr(), GetInt(), GetQStr(), GetStr(), GetSym(), GetVar(), GetVarBool(), GetVarBoolV(), GetVarEnd(), GetVarFlt(), GetVarFltV(), GetVarInt(), GetVarIntV(), GetVarSecTm(), GetVarStr(), GetVarStrPrV(), GetVarStrV(), GetVarStrVV(), IsVar(), PeekSym(), and SkipToSym().

171 {return GetSym(TFSet());}
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

TLxSym TILx::GetSym ( const TLxSym Sym)
inline

Definition at line 172 of file lx.h.

References GetSym().

Referenced by GetSym().

172 {return GetSym(TFSet()|Sym);}
Definition: bits.h:119
TLxSym Sym
Definition: lx.h:149
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

TLxSym TILx::GetSym ( const TLxSym Sym1,
const TLxSym Sym2 
)
inline

Definition at line 173 of file lx.h.

References GetSym().

173  {
174  return GetSym(TFSet()|Sym1|Sym2);}
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

TLxSym TILx::GetSym ( const TLxSym Sym1,
const TLxSym Sym2,
const TLxSym Sym3 
)
inline

Definition at line 175 of file lx.h.

References GetSym().

175  {
176  return GetSym(TFSet()|Sym1|Sym2|Sym3);}
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

TLxSym TILx::GetSym ( const TLxSym Sym1,
const TLxSym Sym2,
const TLxSym Sym3,
const TLxSym Sym4 
)
inline

Definition at line 177 of file lx.h.

References GetSym().

178  {
179  return GetSym(TFSet()|Sym1|Sym2|Sym3|Sym4);}
Definition: bits.h:119
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

TStr TILx::GetSymStr ( ) const

Definition at line 594 of file lx.cpp.

References TLxSymStr::GetSymStr(), Str, syFlt, syIdStr, syInt, Sym, syMnRw, syMxRw, syQStr, and syStr.

Referenced by GetSym().

594  {
595  switch (Sym){
596  case syInt: return Str;
597  case syFlt: return Str;
598  case syStr: return Str;
599  case syIdStr: return Str;
600  case syQStr: return Str;
601  default:
602  if ((syMnRw<=Sym)&&(Sym<=syMxRw)){return Str;}
603  else {return TLxSymStr::GetSymStr(Sym);}
604  }
605 }
Definition: lx.h:53
Definition: lx.h:45
Definition: lx.h:45
Definition: lx.h:52
Definition: lx.h:45
TLxSym Sym
Definition: lx.h:149
Definition: lx.h:45
TChA Str
Definition: lx.h:150
static TStr GetSymStr(const TLxSym &Sym)
Definition: lx.cpp:142
Definition: lx.h:45

Here is the call graph for this function:

Here is the caller graph for this function:

void TILx::GetVar ( const TStr VarNm,
const bool &  LBracket = false,
const bool &  NewLn = false 
)
inline

Definition at line 209 of file lx.h.

References GetEoln(), GetIdStr(), GetSym(), syColon, and syLBracket.

Referenced by GetVarBoolV(), GetVarFltV(), GetVarIntV(), GetVarStrPrV(), GetVarStrV(), and GetVarStrVV().

210  {
211  GetIdStr(VarNm); GetSym(syColon);
212  if (LBracket){GetSym(syLBracket);} if (NewLn){GetEoln();}}
void GetEoln()
Definition: lx.h:189
TLxSym GetSym()
Definition: lx.h:171
Definition: lx.h:50
TStr GetIdStr(const TStr &IdStr=TStr())
Definition: lx.h:185
Definition: lx.h:46

Here is the call graph for this function:

Here is the caller graph for this function:

bool TILx::GetVarBool ( const TStr VarNm,
const bool &  NewLn = true 
)
inline

Definition at line 219 of file lx.h.

References Bool, GetBool(), GetEoln(), GetIdStr(), GetSym(), and syColon.

219  {
220  GetIdStr(VarNm); GetSym(syColon); bool Bool=GetBool();
221  if (NewLn){GetEoln();} return Bool;}
void GetEoln()
Definition: lx.h:189
TLxSym GetSym()
Definition: lx.h:171
bool GetBool()
Definition: lx.h:180
bool Bool
Definition: lx.h:151
TStr GetIdStr(const TStr &IdStr=TStr())
Definition: lx.h:185
Definition: lx.h:46

Here is the call graph for this function:

void TILx::GetVarBoolV ( const TStr VarNm,
TBoolV BoolV,
const bool &  NewLn = true 
)

Definition at line 632 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), Bool, TVec< TVal, TSizeTy >::Clr(), GetEoln(), GetSym(), GetVar(), syBool, syQStr, and syRBracket.

632  {
633  BoolV.Clr();
634  GetVar(VarNm, true, NewLn);
635  while (GetSym(syRBracket, syBool)==syQStr){
636  BoolV.Add(Bool); if (NewLn){GetEoln();}}
637  if (NewLn){GetEoln();}
638 }
Definition: lx.h:45
void GetEoln()
Definition: lx.h:189
Definition: lx.h:45
void GetVar(const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
Definition: lx.h:209
Definition: lx.h:50
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TLxSym GetSym()
Definition: lx.h:171
bool Bool
Definition: lx.h:151
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

void TILx::GetVarEnd ( const bool &  RBracket = false,
const bool &  NewLn = false 
)
inline

Definition at line 213 of file lx.h.

References GetEoln(), GetSym(), and syRBracket.

213  {
214  if (RBracket){GetSym(syRBracket);}
215  if (NewLn){GetEoln();}}
void GetEoln()
Definition: lx.h:189
Definition: lx.h:50
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

double TILx::GetVarFlt ( const TStr VarNm,
const bool &  NewLn = true 
)
inline

Definition at line 225 of file lx.h.

References Flt, GetEoln(), GetFlt(), GetIdStr(), GetSym(), and syColon.

225  {
226  GetIdStr(VarNm); GetSym(syColon); double Flt=GetFlt();
227  if (NewLn){GetEoln();} return Flt;}
void GetEoln()
Definition: lx.h:189
double GetFlt()
Definition: lx.h:182
TLxSym GetSym()
Definition: lx.h:171
TStr GetIdStr(const TStr &IdStr=TStr())
Definition: lx.h:185
Definition: lx.h:46
double Flt
Definition: lx.h:151

Here is the call graph for this function:

void TILx::GetVarFltV ( const TStr VarNm,
TFltV FltV,
const bool &  NewLn = true 
)

Definition at line 648 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), Flt, GetEoln(), GetSym(), GetVar(), syFlt, and syRBracket.

648  {
649  FltV.Clr();
650  GetVar(VarNm, true, NewLn);
651  while (GetSym(syRBracket, syFlt)==syFlt){
652  FltV.Add(Flt); if (NewLn){GetEoln();}}
653  if (NewLn){GetEoln();}
654 }
void GetEoln()
Definition: lx.h:189
void GetVar(const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
Definition: lx.h:209
Definition: lx.h:50
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TLxSym GetSym()
Definition: lx.h:171
Definition: lx.h:45
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602
double Flt
Definition: lx.h:151

Here is the call graph for this function:

int TILx::GetVarInt ( const TStr VarNm,
const bool &  NewLn = true 
)
inline

Definition at line 222 of file lx.h.

References GetEoln(), GetIdStr(), GetInt(), GetSym(), Int, and syColon.

Referenced by TMBlobBs::LoadMain().

222  {
223  GetIdStr(VarNm); GetSym(syColon); int Int=GetInt();
224  if (NewLn){GetEoln();} return Int;}
void GetEoln()
Definition: lx.h:189
int GetInt()
Definition: lx.h:181
TLxSym GetSym()
Definition: lx.h:171
TStr GetIdStr(const TStr &IdStr=TStr())
Definition: lx.h:185
int Int
Definition: lx.h:151
Definition: lx.h:46

Here is the call graph for this function:

Here is the caller graph for this function:

void TILx::GetVarIntV ( const TStr VarNm,
TIntV IntV,
const bool &  NewLn = true 
)

Definition at line 640 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), GetEoln(), GetSym(), GetVar(), Int, syInt, and syRBracket.

640  {
641  IntV.Clr();
642  GetVar(VarNm, true, NewLn);
643  while (GetSym(syRBracket, syInt)==syInt){
644  IntV.Add(Int); if (NewLn){GetEoln();}}
645  if (NewLn){GetEoln();}
646 }
void GetEoln()
Definition: lx.h:189
Definition: lx.h:45
void GetVar(const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
Definition: lx.h:209
Definition: lx.h:50
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TLxSym GetSym()
Definition: lx.h:171
int Int
Definition: lx.h:151
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

TSecTm TILx::GetVarSecTm ( const TStr VarNm,
const bool &  NewLn = true 
)
inline

Definition at line 231 of file lx.h.

References GetEoln(), GetIdStr(), GetSym(), TSecTm::LoadTxt(), and syColon.

231  {
232  GetIdStr(VarNm); GetSym(syColon); TSecTm SecTm=TSecTm::LoadTxt(*this);
233  if (NewLn){GetEoln();} return SecTm;}
void GetEoln()
Definition: lx.h:189
TLxSym GetSym()
Definition: lx.h:171
TStr GetIdStr(const TStr &IdStr=TStr())
Definition: lx.h:185
Definition: tm.h:81
static TSecTm LoadTxt(TILx &Lx)
Definition: tm.cpp:950
Definition: lx.h:46

Here is the call graph for this function:

TStr TILx::GetVarStr ( const TStr VarNm,
const bool &  NewLn = true 
)
inline

Definition at line 228 of file lx.h.

References GetEoln(), GetIdStr(), GetQStr(), GetSym(), Str, and syColon.

Referenced by TMBlobBs::LoadMain().

228  {
229  GetIdStr(VarNm); GetSym(syColon); TStr Str=GetQStr();
230  if (NewLn){GetEoln();} return Str;}
void GetEoln()
Definition: lx.h:189
TLxSym GetSym()
Definition: lx.h:171
TStr GetQStr(const TStr &QStr=TStr())
Definition: lx.h:187
TChA Str
Definition: lx.h:150
TStr GetIdStr(const TStr &IdStr=TStr())
Definition: lx.h:185
Definition: dt.h:412
Definition: lx.h:46

Here is the call graph for this function:

Here is the caller graph for this function:

void TILx::GetVarStrPrV ( const TStr VarNm,
TStrPrV StrPrV,
const bool &  NewLn = true 
)

Definition at line 664 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), GetEoln(), GetQStr(), GetSym(), GetVar(), syLBracket, and syRBracket.

664  {
665  StrPrV.Clr();
666  GetVar(VarNm, true, NewLn);
668  TStr Str1=GetQStr(); TStr Str2=GetQStr();
670  StrPrV.Add(TStrPr(Str1, Str2)); if (NewLn){GetEoln();}
671  }
672  if (NewLn){GetEoln();}
673 }
TPair< TStr, TStr > TStrPr
Definition: ds.h:107
void GetEoln()
Definition: lx.h:189
void GetVar(const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
Definition: lx.h:209
Definition: lx.h:50
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TLxSym GetSym()
Definition: lx.h:171
TStr GetQStr(const TStr &QStr=TStr())
Definition: lx.h:187
Definition: lx.h:50
Definition: dt.h:412
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

void TILx::GetVarStrV ( const TStr VarNm,
TStrV StrV,
const bool &  NewLn = true 
)

Definition at line 656 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), GetEoln(), GetSym(), GetVar(), Str, syQStr, and syRBracket.

656  {
657  StrV.Clr();
658  GetVar(VarNm, true, NewLn);
659  while (GetSym(syRBracket, syQStr)==syQStr){
660  StrV.Add(Str); if (NewLn){GetEoln();}}
661  if (NewLn){GetEoln();}
662 }
void GetEoln()
Definition: lx.h:189
Definition: lx.h:45
void GetVar(const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
Definition: lx.h:209
Definition: lx.h:50
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TLxSym GetSym()
Definition: lx.h:171
TChA Str
Definition: lx.h:150
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

void TILx::GetVarStrVV ( const TStr VarNm,
TVec< TStrV > &  StrVV,
const bool &  NewLn = true 
)

Definition at line 675 of file lx.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), GetEoln(), GetSym(), GetVar(), TVec< TVal, TSizeTy >::Last(), Str, syLBracket, syQStr, and syRBracket.

675  {
676  StrVV.Clr();
677  GetVar(VarNm, true, NewLn);
679  StrVV.Add();
680  while (GetSym(syQStr, syRBracket)==syQStr){
681  StrVV.Last().Add(Str);}
682  if (NewLn){GetEoln();}
683  }
684  if (NewLn){GetEoln();}
685 }
void GetEoln()
Definition: lx.h:189
Definition: lx.h:45
void GetVar(const TStr &VarNm, const bool &LBracket=false, const bool &NewLn=false)
Definition: lx.h:209
Definition: lx.h:50
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:1022
TLxSym GetSym()
Definition: lx.h:171
const TVal & Last() const
Returns a reference to the last element of the vector.
Definition: ds.h:579
Definition: lx.h:50
TChA Str
Definition: lx.h:150
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

bool TILx::IsBof ( ) const
inline

Definition at line 167 of file lx.h.

Referenced by GetStrToEolnAndCh(), and GetSym().

167 {return ChN==-1;}
int ChN
Definition: lx.h:135

Here is the caller graph for this function:

bool TILx::IsEof ( ) const
inline

Definition at line 168 of file lx.h.

References TCh::EofCh.

168 {return Ch==TCh::EofCh;}
char Ch
Definition: lx.h:134
static const char EofCh
Definition: dt.h:1040
bool TILx::IsVar ( const TStr VarNm)
inline

Definition at line 207 of file lx.h.

References GetSym(), PutSym(), and syIdStr.

207  {
208  GetSym(); bool Var=((Sym==syIdStr)&&(Str==VarNm)); PutSym(); return Var;}
void PutSym()
Definition: lx.h:199
Definition: lx.h:45
TLxSym Sym
Definition: lx.h:149
TLxSym GetSym()
Definition: lx.h:171
TChA Str
Definition: lx.h:150

Here is the call graph for this function:

TILx& TILx::operator= ( const TILx )
inline

Definition at line 159 of file lx.h.

References Fail.

159 {Fail; return *this;}
#define Fail
Definition: bd.h:238
TLxSym TILx::PeekSym ( )
inline

Definition at line 200 of file lx.h.

References GetSym(), and PutSym().

Referenced by PeekVarEnd().

200 {TLxSym NextSym=GetSym(); PutSym(); return NextSym;}
void PutSym()
Definition: lx.h:199
TLxSym
Definition: lx.h:44
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

TLxSym TILx::PeekSym ( const int &  Syms)

Definition at line 580 of file lx.cpp.

References TSStack< TVal >::Empty(), GetSym(), TSStack< TVal >::Pop(), TSStack< TVal >::Push(), PutSym(), TILxSymSt::Restore(), Sym, and TSStack< TVal >::Top().

580  {
581  TILxSymSt CurSymSt(*this);
582  TSStack<TILxSymSt> SymStStack;
583  for (int SymN=0; SymN<Syms; SymN++){
584  GetSym(); SymStStack.Push(TILxSymSt(*this));}
585  TLxSym PeekedSym=Sym;
586  while (!SymStStack.Empty()){
587  SymStStack.Top().Restore(*this); SymStStack.Pop();
588  PutSym();
589  }
590  CurSymSt.Restore(*this);
591  return PeekedSym;
592 }
bool Empty()
Definition: ds.h:2591
void PutSym()
Definition: lx.h:199
TVal & Top()
Definition: ds.h:2595
TLxSym
Definition: lx.h:44
void Restore(TILx &Lx)
Definition: lx.cpp:262
TLxSym Sym
Definition: lx.h:149
Definition: lx.h:107
TLxSym GetSym()
Definition: lx.h:171
void Push()
Definition: ds.h:2597
void Pop()
Definition: ds.h:2599

Here is the call graph for this function:

bool TILx::PeekVarEnd ( const bool &  RBracket = false,
const bool &  NewLn = false 
)
inline

Definition at line 216 of file lx.h.

References Fail, PeekSym(), syEoln, and syRBracket.

216  {
217  if (RBracket){return PeekSym()==syRBracket;}
218  if (NewLn){return PeekSym()==syEoln;} Fail; return false;}
#define Fail
Definition: bd.h:238
Definition: lx.h:51
Definition: lx.h:50
TLxSym PeekSym()
Definition: lx.h:200

Here is the call graph for this function:

void TILx::PutSym ( const TILxSymSt SymSt)
inline

Definition at line 198 of file lx.h.

References TSStack< TVal >::Push().

198 {PrevSymStStack.Push(TILxSymSt(SymSt));}
Definition: lx.h:107
TSStack< TILxSymSt > PrevSymStStack
Definition: lx.h:136
void Push()
Definition: ds.h:2597

Here is the call graph for this function:

void TILx::PutSym ( )
inline

Definition at line 199 of file lx.h.

References TSStack< TVal >::Push().

Referenced by IsVar(), and PeekSym().

199 {PrevSymStStack.Push(TILxSymSt(*this));}
Definition: lx.h:107
TSStack< TILxSymSt > PrevSymStStack
Definition: lx.h:136
void Push()
Definition: ds.h:2597

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 286 of file lx.cpp.

References Fail, iloCmtAlw, iloCsSens, iloExcept, iloList, iloRetEoln, iloSigNum, iloTabSep, iloUniStr, IsCmtAlw, IsCsSens, IsExcept, IsList, IsRetEoln, IsSigNum, IsTabSep, and IsUniStr.

Referenced by TILx().

286  {
287  switch (Opt){
288  case iloCmtAlw: IsCmtAlw=Val; break;
289  case iloRetEoln: IsRetEoln=Val; break;
290  case iloSigNum: IsSigNum=Val; break;
291  case iloUniStr: IsUniStr=Val; break;
292  case iloCsSens: IsCsSens=Val; break;
293  case iloExcept: IsExcept=Val; break;
294  case iloTabSep: IsTabSep=Val; break;
295  case iloList: IsList=Val; break;
296  default: Fail;
297  }
298 }
Definition: lx.h:127
bool IsCsSens
Definition: lx.h:138
bool IsTabSep
Definition: lx.h:139
#define Fail
Definition: bd.h:238
bool IsList
Definition: lx.h:139
bool IsRetEoln
Definition: lx.h:138
Definition: lx.h:126
Definition: lx.h:126
Definition: lx.h:126
Definition: lx.h:126
bool IsSigNum
Definition: lx.h:138
bool IsUniStr
Definition: lx.h:138
bool IsExcept
Definition: lx.h:139
bool IsCmtAlw
Definition: lx.h:138
Definition: lx.h:127
Definition: lx.h:127
Definition: lx.h:126

Here is the caller graph for this function:

void TILx::SkipToEoln ( )

Definition at line 573 of file lx.cpp.

References Ch, TCh::CrCh, TCh::EofCh, GetCh(), and TCh::LfCh.

573  {
574  while ((Ch!=TCh::CrCh)&&(Ch!=TCh::LfCh)&&(Ch!=TCh::EofCh)){
575  GetCh();}
576  if (Ch==TCh::CrCh){if (GetCh()==TCh::LfCh){GetCh();}} else
577  if (Ch==TCh::LfCh){if (GetCh()==TCh::CrCh){GetCh();}}
578 }
char Ch
Definition: lx.h:134
static const char EofCh
Definition: dt.h:1040
static const char LfCh
Definition: dt.h:1038
char GetCh()
Definition: lx.h:140
static const char CrCh
Definition: dt.h:1039

Here is the call graph for this function:

void TILx::SkipToSym ( const TLxSym SkipToSym)
inline

Definition at line 195 of file lx.h.

References GetSym().

195  {
196  while (Sym!=SkipToSym){GetSym();}}
void SkipToSym(const TLxSym &SkipToSym)
Definition: lx.h:195
TLxSym Sym
Definition: lx.h:149
TLxSym GetSym()
Definition: lx.h:171

Here is the call graph for this function:

Member Data Documentation

bool TILx::Bool

Definition at line 151 of file lx.h.

Referenced by GetBool(), GetSym(), GetVarBool(), GetVarBoolV(), and TILxSymSt::Restore().

char TILx::Ch
private
PLxChDef TILx::ChDef
private

Definition at line 131 of file lx.h.

Referenced by AddRw(), GetStrToCh(), GetStrToEoln(), GetStrToEolnAndCh(), GetStrToEolnOrCh(), and GetSym().

int TILx::ChN
private

Definition at line 135 of file lx.h.

Referenced by GetQStr(), GetStrToEolnAndCh(), and GetSym().

TChA TILx::CmtStr

Definition at line 150 of file lx.h.

Referenced by GetSym(), and TILxSymSt::Restore().

double TILx::Flt
int TILx::Int

Definition at line 151 of file lx.h.

Referenced by GetInt(), GetSym(), GetVarInt(), GetVarIntV(), and TILxSymSt::Restore().

bool TILx::IsCmtAlw
private

Definition at line 138 of file lx.h.

Referenced by GetSym(), and SetOpt().

bool TILx::IsCsSens
private

Definition at line 138 of file lx.h.

Referenced by GetSym(), and SetOpt().

bool TILx::IsExcept
private

Definition at line 139 of file lx.h.

Referenced by GetSym(), and SetOpt().

bool TILx::IsList
private

Definition at line 139 of file lx.h.

Referenced by SetOpt().

bool TILx::IsRetEoln
private

Definition at line 138 of file lx.h.

Referenced by GetSym(), and SetOpt().

bool TILx::IsSigNum
private

Definition at line 138 of file lx.h.

Referenced by GetSym(), and SetOpt().

bool TILx::IsTabSep
private

Definition at line 139 of file lx.h.

Referenced by GetSym(), and SetOpt().

bool TILx::IsUniStr
private

Definition at line 138 of file lx.h.

Referenced by GetSym(), and SetOpt().

int TILx::LnChN
private

Definition at line 135 of file lx.h.

Referenced by GetFPosStr(), and GetSym().

int TILx::LnN
private

Definition at line 135 of file lx.h.

Referenced by GetFPosStr(), GetLnN(), and GetSym().

char TILx::PrevCh
private

Definition at line 134 of file lx.h.

Referenced by GetLnV(), and GetStrToEolnAndCh().

TSStack<TILxSymSt> TILx::PrevSymStStack
private

Definition at line 136 of file lx.h.

Referenced by GetSIn(), and GetSym().

char TILx::QuoteCh

Definition at line 154 of file lx.h.

Referenced by GetQStr(), and GetSym().

bool TILx::QuoteP

Definition at line 153 of file lx.h.

Referenced by GetSym().

TSIn& TILx::RSIn
private

Definition at line 133 of file lx.h.

TStrIntH TILx::RwStrH
private

Definition at line 137 of file lx.h.

Referenced by AddRw(), and GetSym().

PSIn TILx::SIn
private

Definition at line 132 of file lx.h.

Referenced by GetFPosStr(), GetLnV(), and GetSIn().

int TILx::SymChN

Definition at line 152 of file lx.h.

Referenced by GetSym(), and TILxSymSt::Restore().

int TILx::SymLnChN

Definition at line 152 of file lx.h.

Referenced by GetSym(), and TILxSymSt::Restore().

int TILx::SymLnN

Definition at line 152 of file lx.h.

Referenced by GetSym(), and TILxSymSt::Restore().

TChA TILx::UcStr

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