SNAP Library, User Reference  2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
lx.h File Reference

Go to the source code of this file.

Classes

class  TLxSymStr
class  TILxSymSt
class  TILx
class  TOLx
class  TPreproc

Enumerations

enum  TLxChTy {
  lctUndef, lctSpace, lctNum, lctAlpha,
  lctSSym, lctTerm
}
enum  TLxChDefTy { lcdtUsAscii, lcdtYuAscii }
enum  TLxSym {
  syUndef, syLn, syTab, syBool,
  syInt, syFlt, syStr, syIdStr,
  syQStr, syPeriod, syDPeriod, syComma,
  syColon, syDColon, sySemicolon, syPlus,
  syMinus, syAsterisk, sySlash, syPercent,
  syExclamation, syVBar, syAmpersand, syQuestion,
  syHash, syEq, syNEq, syLss,
  syGtr, syLEq, syGEq, syLParen,
  syRParen, syLBracket, syRBracket, syLBrace,
  syRBrace, syEoln, syEof, syMnRw,
  syRw1, syRw2, syRw3, syRw4,
  syRw5, syRw6, syRw7, syRw8,
  syRw9, syRw10, syRw11, syRw12,
  syRw13, syRw14, syRw15, syRw16,
  syRw17, syMxRw
}
enum  TILxOpt {
  iloCmtAlw, iloRetEoln, iloSigNum, iloUniStr,
  iloCsSens, iloExcept, iloTabSep, iloList,
  iloMx
}
enum  TOLxOpt {
  oloCmtAlw, oloFrcEoln, oloSigNum, oloUniStr,
  oloCsSens, oloTabSep, oloVarIndent, oloMx
}

Functions

void SetUcCh (const TStr &Str)
void SetChTy (const TLxChTy &ChTy, const TStr &Str)
 TLxChDef (const TLxChDefTy &ChDefTy)
static PLxChDef New (const TLxChDefTy &ChDefTy=lcdtUsAscii)
 TLxChDef (TSIn &SIn)
static PLxChDef Load (TSIn &SIn)
void Save (TSOut &SOut)
TLxChDefoperator= (const TLxChDef &ChDef)
int GetChTy (const char &Ch) const
bool IsTerm (const char &Ch) const
bool IsSpace (const char &Ch) const
bool IsAlpha (const char &Ch) const
bool IsNum (const char &Ch) const
bool IsAlNum (const char &Ch) const
char GetUc (const char &Ch) const
bool IsNmStr (const TStr &Str) const
TStr GetUcStr (const TStr &Str) const
static PLxChDef GetChDef (const TLxChDefTy &ChDefTy=lcdtUsAscii)

Variables

ClassTP(TLxChDef, PLxChDef)
private TChV 
UcChV

Enumeration Type Documentation

enum TILxOpt
Enumerator:
iloCmtAlw 
iloRetEoln 
iloSigNum 
iloUniStr 
iloCsSens 
iloExcept 
iloTabSep 
iloList 
iloMx 

Definition at line 123 of file lx.h.

enum TLxChDefTy
Enumerator:
lcdtUsAscii 
lcdtYuAscii 

Definition at line 4 of file lx.h.

enum TLxChTy
Enumerator:
lctUndef 
lctSpace 
lctNum 
lctAlpha 
lctSSym 
lctTerm 

Definition at line 3 of file lx.h.

enum TLxSym
Enumerator:
syUndef 
syLn 
syTab 
syBool 
syInt 
syFlt 
syStr 
syIdStr 
syQStr 
syPeriod 
syDPeriod 
syComma 
syColon 
syDColon 
sySemicolon 
syPlus 
syMinus 
syAsterisk 
sySlash 
syPercent 
syExclamation 
syVBar 
syAmpersand 
syQuestion 
syHash 
syEq 
syNEq 
syLss 
syGtr 
syLEq 
syGEq 
syLParen 
syRParen 
syLBracket 
syRBracket 
syLBrace 
syRBrace 
syEoln 
syEof 
syMnRw 
syRw1 
syRw2 
syRw3 
syRw4 
syRw5 
syRw6 
syRw7 
syRw8 
syRw9 
syRw10 
syRw11 
syRw12 
syRw13 
syRw14 
syRw15 
syRw16 
syRw17 
syMxRw 

Definition at line 42 of file lx.h.

enum TOLxOpt
Enumerator:
oloCmtAlw 
oloFrcEoln 
oloSigNum 
oloUniStr 
oloCsSens 
oloTabSep 
oloVarIndent 
oloMx 

Definition at line 245 of file lx.h.


Function Documentation

static PLxChDef GetChDef ( const TLxChDefTy ChDefTy = lcdtUsAscii) [static]
int GetChTy ( const char &  Ch) const

Definition at line 23 of file lx.h.

{return ChTyV[Ch-TCh::Mn];}
char GetUc ( const char &  Ch) const

Definition at line 30 of file lx.h.

{return UcChV[Ch-TCh::Mn];}
TStr GetUcStr ( const TStr Str) const

Definition at line 56 of file html.h.

                                       {
    TChA ChA(Str); GetUcChA(ChA); return ChA;}
bool IsAlNum ( const char &  Ch) const

Definition at line 28 of file lx.h.

                                     {
    return (ChTyV[Ch-TCh::Mn]==TInt(lctAlpha))||(ChTyV[Ch-TCh::Mn]==TInt(lctNum));}
bool IsAlpha ( const char &  Ch) const

Definition at line 26 of file lx.h.

{return ChTyV[Ch-TCh::Mn]==TInt(lctAlpha);}
bool TLxChDef::IsNmStr ( const TStr Str) const

Definition at line 63 of file lx.cpp.

                                            {
  if (Str.Len()==0){return false;}
  if (!IsAlpha(Str.GetCh(0))){return false;}
  for (int ChN=1; ChN<Str.Len(); ChN++){
    if (!IsAlNum(Str.GetCh(ChN))){return false;}}
  return true;
}
bool IsNum ( const char &  Ch) const

Definition at line 27 of file lx.h.

{return ChTyV[Ch-TCh::Mn]==TInt(lctNum);}
bool IsSpace ( const char &  Ch) const

Definition at line 25 of file lx.h.

{return ChTyV[Ch-TCh::Mn]==TInt(lctSpace);}
bool IsTerm ( const char &  Ch) const

Definition at line 24 of file lx.h.

{return ChTyV[Ch-TCh::Mn]==TInt(lctTerm);}
static PLxChDef Load ( TSIn SIn) [static]

Definition at line 17 of file lx.h.

{return new TLxChDef(SIn);}
static PLxChDef New ( const TLxChDefTy ChDefTy = lcdtUsAscii) [static]

Definition at line 14 of file lx.h.

                                                            {
    return PLxChDef(new TLxChDef(ChDefTy));}
TLxChDef& operator= ( const TLxChDef ChDef)

Definition at line 20 of file lx.h.

                                            {
    ChTyV=ChDef.ChTyV; UcChV=ChDef.UcChV; return *this;}
void Save ( TSOut SOut)

Definition at line 18 of file lx.h.

{ChTyV.Save(SOut); UcChV.Save(SOut);}
void SetChTy ( const TLxChTy ChTy,
const TStr Str 
)
void SetUcCh ( const TStr Str)
TLxChDef::TLxChDef ( const TLxChDefTy ChDefTy)

Definition at line 13 of file lx.cpp.

                                           :
  ChTyV(TCh::Vals), UcChV(TCh::Vals){

  if (ChDefTy==lcdtUsAscii){
    // Character-Types
    ChTyV.PutAll(TInt(lctSpace));
    SetChTy(lctNum, "0123456789");
    SetChTy(lctAlpha, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    SetChTy(lctAlpha, "abcdefghijklmnopqrstuvwxyz");
    SetChTy(lctAlpha, "@_");
    SetChTy(lctSSym, "\"'.,:;+-*/%!#|&<=>?()[]{}");
    SetChTy(lctTerm, TStr(TCh::CrCh));
    SetChTy(lctTerm, TStr(TCh::LfCh));
    SetChTy(lctTerm, TStr(TCh::EofCh));

    // Upper-Case
    for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++){UcChV[Ch-TCh::Mn]=TCh(char(Ch));}
    SetUcCh("Aa"); SetUcCh("Bb"); SetUcCh("Cc"); SetUcCh("Dd"); SetUcCh("Ee");
    SetUcCh("Ff"); SetUcCh("Gg"); SetUcCh("Hh"); SetUcCh("Ii"); SetUcCh("Jj");
    SetUcCh("Kk"); SetUcCh("Ll"); SetUcCh("Mm"); SetUcCh("Nn"); SetUcCh("Oo");
    SetUcCh("Pp"); SetUcCh("Qq"); SetUcCh("Rr"); SetUcCh("Ss"); SetUcCh("Tt");
    SetUcCh("Uu"); SetUcCh("Vv"); SetUcCh("Ww"); SetUcCh("Xx"); SetUcCh("Yy");
    SetUcCh("Zz");
  } else
  if (ChDefTy==lcdtYuAscii){
    // Character-Types
    ChTyV.PutAll(TInt(lctSpace));
    SetChTy(lctNum, "0123456789");
    SetChTy(lctAlpha, "ABC^]D\\EFGHIJKLMNOPQRS[TUVWXYZ@");
    SetChTy(lctAlpha, "abc~}d|efghijklmnopqrs{tuvwxyz`");
    SetChTy(lctAlpha, "_");
    SetChTy(lctSSym, "\".,:;+-*/%!#&<=>?()");
    SetChTy(lctTerm, TStr(TCh::CrCh));
    SetChTy(lctTerm, TStr(TCh::LfCh));
    SetChTy(lctTerm, TStr(TCh::EofCh));

    // Upper-Case
    for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++){UcChV[Ch-TCh::Mn]=TCh(char(Ch));}
    SetUcCh("Aa"); SetUcCh("Bb"); SetUcCh("Cc"); SetUcCh("^~"); SetUcCh("]}");
    SetUcCh("Dd"); SetUcCh("\\|"); SetUcCh("Ee"); SetUcCh("Ff"); SetUcCh("Gg");
    SetUcCh("Hh"); SetUcCh("Ii"); SetUcCh("Jj"); SetUcCh("Kk"); SetUcCh("Ll");
    SetUcCh("Mm"); SetUcCh("Nn"); SetUcCh("Oo"); SetUcCh("Pp"); SetUcCh("Qq");
    SetUcCh("Rr"); SetUcCh("Ss"); SetUcCh("[{"); SetUcCh("Tt"); SetUcCh("Uu");
    SetUcCh("Vv"); SetUcCh("Ww"); SetUcCh("Xx"); SetUcCh("Yy"); SetUcCh("Zz");
    SetUcCh("@`");
  } else {
    Fail;
  }
}
TLxChDef ( TSIn SIn)

Definition at line 16 of file lx.h.

: ChTyV(SIn), UcChV(SIn){}

Variable Documentation

ClassTP (TLxChDef, PLxChDef) private TChV UcChV

Definition at line 6 of file lx.h.