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
TLxSymStr Class Reference

#include <lx.h>

Collaboration diagram for TLxSymStr:

Static Public Member Functions

static TStr GetSymStr (const TLxSym &Sym)
 
static TLxSym GetSSym (const TStr &Str)
 
static bool IsSep (const TLxSym &PrevSym, const TLxSym &Sym)
 

Static Public Attributes

static const TStr UndefStr ="<undefined>"
 
static const TStr LnStr ="<line>"
 
static const TStr TabStr ="<tab>"
 
static const TStr BoolStr
 
static const TStr IntStr ="<integer>"
 
static const TStr FltStr ="<float>"
 
static const TStr StrStr ="<string>"
 
static const TStr IdStrStr ="<id-string>"
 
static const TStr QStrStr ="<q-string>"
 
static const TStr PeriodStr ="."
 
static const TStr DPeriodStr =".."
 
static const TStr CommaStr =","
 
static const TStr ColonStr =":"
 
static const TStr DColonStr ="::"
 
static const TStr SemicolonStr =";"
 
static const TStr PlusStr ="+"
 
static const TStr MinusStr ="-"
 
static const TStr AsteriskStr ="*"
 
static const TStr SlashStr ="/"
 
static const TStr PercentStr ="%"
 
static const TStr ExclamationStr ="!"
 
static const TStr VBarStr ="|"
 
static const TStr AmpersandStr ="&"
 
static const TStr QuestionStr ="?"
 
static const TStr HashStr ="#"
 
static const TStr EqStr ="="
 
static const TStr NEqStr ="<>"
 
static const TStr LssStr ="<"
 
static const TStr GtrStr =">"
 
static const TStr LEqStr ="<="
 
static const TStr GEqStr =">="
 
static const TStr LParenStr ="("
 
static const TStr RParenStr =")"
 
static const TStr LBracketStr ="["
 
static const TStr RBracketStr ="]"
 
static const TStr LBraceStr ="{"
 
static const TStr RBraceStr ="}"
 
static const TStr EolnStr ="<end-of-line>"
 
static const TStr EofStr ="<end-of-file>"
 

Detailed Description

Definition at line 56 of file lx.h.

Member Function Documentation

TLxSym TLxSymStr::GetSSym ( const TStr Str)
static

Definition at line 186 of file lx.cpp.

References THash< TKey, TDat, THashFunc >::AddDat(), AmpersandStr, AsteriskStr, ColonStr, CommaStr, DColonStr, DPeriodStr, EqStr, ExclamationStr, GEqStr, THash< TKey, TDat, THashFunc >::GetKeyId(), GtrStr, HashStr, LBraceStr, LBracketStr, THash< TKey, TDat, THashFunc >::Len(), LEqStr, LParenStr, LssStr, MinusStr, NEqStr, PercentStr, PeriodStr, PlusStr, QuestionStr, RBraceStr, RBracketStr, RParenStr, SemicolonStr, SlashStr, syAmpersand, syAsterisk, syColon, syComma, syDColon, syDPeriod, syEq, syExclamation, syGEq, syGtr, syHash, syLBrace, syLBracket, syLEq, syLParen, syLss, syMinus, syNEq, syPercent, syPeriod, syPlus, syQuestion, syRBrace, syRBracket, syRParen, sySemicolon, sySlash, syUndef, syVBar, and VBarStr.

Referenced by THtmlDoc::GetLxSym().

186  {
187  static TStrIntH StrToLxSymH(100);
188  if (StrToLxSymH.Len()==0){
189  StrToLxSymH.AddDat(PeriodStr, syPeriod);
190  StrToLxSymH.AddDat(DPeriodStr, syDPeriod);
191  StrToLxSymH.AddDat(CommaStr, syComma);
192  StrToLxSymH.AddDat(ColonStr, syColon);
193  StrToLxSymH.AddDat(DColonStr, syDColon);
194  StrToLxSymH.AddDat(SemicolonStr, sySemicolon);
195  StrToLxSymH.AddDat(PlusStr, syPlus);
196  StrToLxSymH.AddDat(MinusStr, syMinus);
197  StrToLxSymH.AddDat(AsteriskStr, syAsterisk);
198  StrToLxSymH.AddDat(SlashStr, sySlash);
199  StrToLxSymH.AddDat(PercentStr, syPercent);
200  StrToLxSymH.AddDat(ExclamationStr, syExclamation);
201  StrToLxSymH.AddDat(VBarStr, syVBar);
202  StrToLxSymH.AddDat(AmpersandStr, syAmpersand);
203  StrToLxSymH.AddDat(QuestionStr, syQuestion);
204  StrToLxSymH.AddDat(HashStr, syHash);
205  StrToLxSymH.AddDat(EqStr, syEq);
206  StrToLxSymH.AddDat(NEqStr, syNEq);
207  StrToLxSymH.AddDat(LssStr, syLss);
208  StrToLxSymH.AddDat(GtrStr, syGtr);
209  StrToLxSymH.AddDat(LEqStr, syLEq);
210  StrToLxSymH.AddDat(GEqStr, syGEq);
211  StrToLxSymH.AddDat(LParenStr, syLParen);
212  StrToLxSymH.AddDat(RParenStr, syRParen);
213  StrToLxSymH.AddDat(LBracketStr, syLBracket);
214  StrToLxSymH.AddDat(RBracketStr, syRBracket);
215  StrToLxSymH.AddDat(LBraceStr, syLBrace);
216  StrToLxSymH.AddDat(RBraceStr, syRBrace);
217  }
218  int KeyId=StrToLxSymH.GetKeyId(Str);
219  if (KeyId==-1){
220  return syUndef;
221  } else {
222  return TLxSym(int(StrToLxSymH[KeyId]));
223  }
224 }
Definition: lx.h:49
Definition: lx.h:49
Definition: lx.h:50
static const TStr QuestionStr
Definition: lx.h:81
static const TStr CommaStr
Definition: lx.h:69
Definition: lx.h:50
Definition: lx.h:49
Definition: lx.h:48
static const TStr DPeriodStr
Definition: lx.h:68
Definition: lx.h:46
static const TStr ColonStr
Definition: lx.h:70
TLxSym
Definition: lx.h:44
Definition: lx.h:48
Definition: lx.h:47
Definition: lx.h:47
Definition: lx.h:49
static const TStr PercentStr
Definition: lx.h:77
static const TStr PlusStr
Definition: lx.h:73
Definition: lx.h:50
static const TStr HashStr
Definition: lx.h:82
static const TStr VBarStr
Definition: lx.h:79
Definition: lx.h:45
static const TStr EqStr
Definition: lx.h:83
Definition: lx.h:47
Definition: lx.h:49
static const TStr SlashStr
Definition: lx.h:76
static const TStr LssStr
Definition: lx.h:85
static const TStr ExclamationStr
Definition: lx.h:78
static const TStr RBraceStr
Definition: lx.h:94
static const TStr GtrStr
Definition: lx.h:86
static const TStr LBracketStr
Definition: lx.h:91
Definition: lx.h:50
static const TStr AsteriskStr
Definition: lx.h:75
Definition: lx.h:49
static const TStr LBraceStr
Definition: lx.h:93
Definition: lx.h:47
Definition: lx.h:48
static const TStr SemicolonStr
Definition: lx.h:72
Definition: lx.h:46
Definition: lx.h:50
static const TStr NEqStr
Definition: lx.h:84
static const TStr DColonStr
Definition: lx.h:71
static const TStr LEqStr
Definition: lx.h:87
Definition: lx.h:46
Definition: lx.h:47
Definition: lx.h:46
static const TStr PeriodStr
Definition: lx.h:67
static const TStr MinusStr
Definition: lx.h:74
static const TStr GEqStr
Definition: lx.h:88
static const TStr RBracketStr
Definition: lx.h:92
Definition: lx.h:46
Definition: lx.h:46
Definition: lx.h:48
Definition: lx.h:50
static const TStr LParenStr
Definition: lx.h:89
static const TStr RParenStr
Definition: lx.h:90
static const TStr AmpersandStr
Definition: lx.h:80

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TLxSymStr::GetSymStr ( const TLxSym Sym)
static

Definition at line 142 of file lx.cpp.

References AmpersandStr, AsteriskStr, ColonStr, CommaStr, DColonStr, DPeriodStr, EofStr, EolnStr, EqStr, ExclamationStr, Fail, FltStr, GEqStr, GtrStr, HashStr, IdStrStr, IntStr, LBraceStr, LBracketStr, LEqStr, LnStr, LParenStr, LssStr, MinusStr, NEqStr, PercentStr, PeriodStr, PlusStr, QStrStr, QuestionStr, RBraceStr, RBracketStr, RParenStr, SemicolonStr, SlashStr, StrStr, syAmpersand, syAsterisk, syColon, syComma, syDColon, syDPeriod, syEof, syEoln, syEq, syExclamation, syFlt, syGEq, syGtr, syHash, syIdStr, syInt, syLBrace, syLBracket, syLEq, syLn, syLParen, syLss, syMinus, syNEq, syPercent, syPeriod, syPlus, syQStr, syQuestion, syRBrace, syRBracket, syRParen, sySemicolon, sySlash, syStr, syTab, syUndef, syVBar, TabStr, UndefStr, and VBarStr.

Referenced by TILx::GetSymStr(), and TOLx::PutSym().

142  {
143  switch (Sym){
144  case syUndef: return UndefStr;
145  case syLn: return LnStr;
146  case syTab: return TabStr;
147  case syInt: return IntStr;
148  case syFlt: return FltStr;
149  case syStr: return StrStr;
150  case syIdStr: return IdStrStr;
151  case syQStr: return QStrStr;
152  case syPeriod: return PeriodStr;
153  case syDPeriod: return DPeriodStr;
154  case syComma: return CommaStr;
155  case syColon: return ColonStr;
156  case syDColon: return DColonStr;
157  case sySemicolon: return SemicolonStr;
158  case syPlus: return PlusStr;
159  case syMinus: return MinusStr;
160  case syAsterisk: return AsteriskStr;
161  case sySlash: return SlashStr;
162  case syPercent: return PercentStr;
163  case syExclamation: return ExclamationStr;
164  case syVBar: return VBarStr;
165  case syAmpersand: return AmpersandStr;
166  case syQuestion: return QuestionStr;
167  case syHash: return HashStr;
168  case syEq: return EqStr;
169  case syNEq: return NEqStr;
170  case syLss: return LssStr;
171  case syGtr: return GtrStr;
172  case syLEq: return LEqStr;
173  case syGEq: return GEqStr;
174  case syLParen: return LParenStr;
175  case syRParen: return RParenStr;
176  case syLBracket: return LBracketStr;
177  case syRBracket: return RBracketStr;
178  case syLBrace: return LBraceStr;
179  case syRBrace: return RBraceStr;
180  case syEoln: return EolnStr;
181  case syEof: return EofStr;
182  default: Fail; return TStr();
183  }
184 }
Definition: lx.h:49
Definition: lx.h:49
Definition: lx.h:50
static const TStr QuestionStr
Definition: lx.h:81
static const TStr CommaStr
Definition: lx.h:69
Definition: lx.h:50
Definition: lx.h:49
Definition: lx.h:45
Definition: lx.h:48
static const TStr DPeriodStr
Definition: lx.h:68
Definition: lx.h:46
#define Fail
Definition: bd.h:238
static const TStr EofStr
Definition: lx.h:96
static const TStr ColonStr
Definition: lx.h:70
Definition: lx.h:45
Definition: lx.h:48
Definition: lx.h:47
Definition: lx.h:51
Definition: lx.h:45
Definition: lx.h:45
Definition: lx.h:47
Definition: lx.h:49
static const TStr PercentStr
Definition: lx.h:77
static const TStr PlusStr
Definition: lx.h:73
static const TStr IntStr
Definition: lx.h:62
Definition: lx.h:50
static const TStr HashStr
Definition: lx.h:82
static const TStr QStrStr
Definition: lx.h:66
static const TStr VBarStr
Definition: lx.h:79
Definition: lx.h:45
static const TStr EqStr
Definition: lx.h:83
Definition: lx.h:47
Definition: lx.h:49
Definition: lx.h:51
static const TStr SlashStr
Definition: lx.h:76
static const TStr LssStr
Definition: lx.h:85
static const TStr ExclamationStr
Definition: lx.h:78
static const TStr RBraceStr
Definition: lx.h:94
static const TStr GtrStr
Definition: lx.h:86
static const TStr LBracketStr
Definition: lx.h:91
Definition: lx.h:50
static const TStr AsteriskStr
Definition: lx.h:75
static const TStr FltStr
Definition: lx.h:63
Definition: lx.h:49
Definition: lx.h:45
static const TStr LBraceStr
Definition: lx.h:93
Definition: lx.h:47
Definition: lx.h:48
static const TStr EolnStr
Definition: lx.h:95
static const TStr SemicolonStr
Definition: lx.h:72
Definition: lx.h:46
Definition: lx.h:50
static const TStr UndefStr
Definition: lx.h:58
Definition: dt.h:412
static const TStr NEqStr
Definition: lx.h:84
static const TStr DColonStr
Definition: lx.h:71
static const TStr LEqStr
Definition: lx.h:87
Definition: lx.h:46
static const TStr LnStr
Definition: lx.h:59
static const TStr StrStr
Definition: lx.h:64
static const TStr IdStrStr
Definition: lx.h:65
Definition: lx.h:47
Definition: lx.h:46
Definition: lx.h:45
static const TStr PeriodStr
Definition: lx.h:67
static const TStr MinusStr
Definition: lx.h:74
static const TStr GEqStr
Definition: lx.h:88
static const TStr RBracketStr
Definition: lx.h:92
Definition: lx.h:46
Definition: lx.h:45
static const TStr TabStr
Definition: lx.h:60
Definition: lx.h:46
Definition: lx.h:48
Definition: lx.h:50
static const TStr LParenStr
Definition: lx.h:89
static const TStr RParenStr
Definition: lx.h:90
static const TStr AmpersandStr
Definition: lx.h:80

Here is the caller graph for this function:

bool TLxSymStr::IsSep ( const TLxSym PrevSym,
const TLxSym Sym 
)
static

Definition at line 226 of file lx.cpp.

References TFSet::In(), syColon, syComma, syDColon, syEof, syEoln, syEq, syExclamation, syLBrace, syLBracket, syLParen, syPeriod, syQuestion, syRBrace, syRBracket, syRParen, sySemicolon, and syUndef.

Referenced by TOLx::PutSep().

226  {
227  static TFSet SepPrevSymSet=TFSet()|
230  syEoln|syEof;
231 
232  static TFSet SepSymSet=TFSet()|
234  syEq|
237  syEoln|syEof;
238 
239  return !SepPrevSymSet.In(PrevSym) && !SepSymSet.In(Sym);
240 }
Definition: lx.h:49
Definition: lx.h:50
Definition: lx.h:50
Definition: lx.h:46
Definition: bits.h:119
Definition: lx.h:51
Definition: lx.h:50
Definition: lx.h:45
Definition: lx.h:51
Definition: lx.h:50
Definition: lx.h:50
Definition: lx.h:46
Definition: lx.h:46
Definition: lx.h:46
Definition: lx.h:46
Definition: lx.h:48
Definition: lx.h:50
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:

Member Data Documentation

const TStr TLxSymStr::AmpersandStr ="&"
static

Definition at line 80 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::AsteriskStr ="*"
static

Definition at line 75 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::BoolStr
static

Definition at line 61 of file lx.h.

const TStr TLxSymStr::ColonStr =":"
static

Definition at line 70 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::CommaStr =","
static

Definition at line 69 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::DColonStr ="::"
static

Definition at line 71 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::DPeriodStr =".."
static

Definition at line 68 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::EofStr ="<end-of-file>"
static

Definition at line 96 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::EolnStr ="<end-of-line>"
static

Definition at line 95 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::EqStr ="="
static

Definition at line 83 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::ExclamationStr ="!"
static

Definition at line 78 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::FltStr ="<float>"
static

Definition at line 63 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::GEqStr =">="
static

Definition at line 88 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::GtrStr =">"
static

Definition at line 86 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::HashStr ="#"
static

Definition at line 82 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::IdStrStr ="<id-string>"
static

Definition at line 65 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::IntStr ="<integer>"
static

Definition at line 62 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::LBraceStr ="{"
static

Definition at line 93 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::LBracketStr ="["
static

Definition at line 91 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::LEqStr ="<="
static

Definition at line 87 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::LnStr ="<line>"
static

Definition at line 59 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::LParenStr ="("
static

Definition at line 89 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::LssStr ="<"
static

Definition at line 85 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::MinusStr ="-"
static

Definition at line 74 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::NEqStr ="<>"
static

Definition at line 84 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::PercentStr ="%"
static

Definition at line 77 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::PeriodStr ="."
static

Definition at line 67 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::PlusStr ="+"
static

Definition at line 73 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::QStrStr ="<q-string>"
static

Definition at line 66 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::QuestionStr ="?"
static

Definition at line 81 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::RBraceStr ="}"
static

Definition at line 94 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::RBracketStr ="]"
static

Definition at line 92 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::RParenStr =")"
static

Definition at line 90 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::SemicolonStr =";"
static

Definition at line 72 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::SlashStr ="/"
static

Definition at line 76 of file lx.h.

Referenced by GetSSym(), and GetSymStr().

const TStr TLxSymStr::StrStr ="<string>"
static

Definition at line 64 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::TabStr ="<tab>"
static

Definition at line 60 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::UndefStr ="<undefined>"
static

Definition at line 58 of file lx.h.

Referenced by GetSymStr().

const TStr TLxSymStr::VBarStr ="|"
static

Definition at line 79 of file lx.h.

Referenced by GetSSym(), and GetSymStr().


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