30 ValType(SIn), Flt(SIn), Str(SIn), ValV(SIn), ValL(SIn){}
34 Flt.Save(SOut); Str.Save(SOut); ValV.Save(SOut); ValL.Save(SOut);}
37 bool operator==(
const TExpVal& ExpVal)
const;
38 bool operator<(
const TExpVal& ExpVal)
const;
47 if (GetValType()==
evtFlt){_Flt=Flt;
return true;}
else {
return false;}}
49 if (GetValType()==
evtFlt){_Flt=Flt;
return true;}
else {
return false;}}
51 if (GetValType()==
evtFlt){
return Flt;}
else {
return 0;}}
52 int GetFltValAsInt(
const bool& ThrowExceptP=
true)
const;
55 void SaveTxt(
TOLx& Lx)
const;
56 void SaveTxt(
const PSOut& SOut)
const;
60 static PExpVal GetUndefExpVal();
81 virtual void Save(
TSOut& SOut)
const {Rnd.Save(SOut);}
90 bool IsVar;
return GetVarVal(VarNm, IsVar);}
101 static bool IsFuncOk(
158 void AssertArgs(
const int& RqArgs,
const int& ActArgs);
197 static const
TFSet MulOpSymSet, UAddOpSymSet, AddOpSymSet, RelOpSymSet;
198 static const
TFSet FactExpExpect, MulExpExpect, AddExpExpect;
199 static const
TFSet RelExpExpect, ExpExpect;
207 void SaveTxtOp(
TOLx& Lx) const;
209 const
PExpEnv& ExpEnv, const
bool& DbgP,
TChA& DbgChA);
211 const
PExpEnv& ExpEnv, const
bool& DbgP,
TChA& DbgChA);
214 ExpType(_ExpType), IsParen(false),
215 ExpVal(), ExpNm(), ExpOp(), ExpBiId(), ArgExpV(){}
217 const PExp& Exp1,
const PExp& Exp2=NULL,
const PExp& Exp3=NULL);
223 ExpType(SIn), IsParen(SIn),
224 ExpVal(SIn), ExpNm(SIn), ExpOp(SIn), ExpBiId(SIn), ArgExpV(SIn){}
227 ExpType.Save(SOut); IsParen.Save(SOut);
228 ExpVal.Save(SOut); ExpNm.Save(SOut); ExpOp.Save(SOut);
229 ExpBiId.Save(SOut); ArgExpV.Save(SOut);}
235 bool Ok; LoadTxt(ExpStr, Ok, MsgStr);
return Ok;}
236 static PExp LoadTxt(
const PSIn& SIn,
bool& Ok,
TStr& MsgStr,
241 bool Ok;
TStr MsgStr;
return LoadTxt(ExpStr, Ok, MsgStr);}
243 void SaveTxt(
TOLx& Lx)
const;
247 TStr GetTopObjNm()
const;
248 int GetArgExps()
const;
249 TStr GetArgExpStr(
const int& ArgExpN)
const;
255 return Eval(Ok, MsgStr,
false, DbgStr, ExpEnv);}
257 TStr DbgStr;
return Eval(Ok, MsgStr,
false, DbgStr, ExpEnv);}
259 bool Ok;
TStr MsgStr;
return Eval(Ok, MsgStr, DbgP, DbgStr, ExpEnv);}
261 static PExpVal LoadAndEvalExpL(
262 const TStr& ExpLStr,
bool& Ok,
TStr& MsgStr,
268 static void GetBiDescV(
TStrPrV& BiDescV);
282 const TStr& _DescStr,
const TStr& _DfValStr):
283 Nm(_Nm), TypeStr(_TypeStr), DescStr(_DescStr), DfValStr(_DfValStr){}
285 const TStr& DescStr,
const TStr& DfValStr){
289 Nm(SIn), TypeStr(SIn), DescStr(SIn), DfValStr(SIn){}
293 Nm.Save(SOut); TypeStr.Save(SOut); DescStr.Save(SOut); DfValStr.Save(SOut);}
319 Type(_Type), CatNm(_CatNm), HdItem(_HdItem), ArgItemV(_ArgItemV){}
325 Type(SIn), CatNm(SIn), HdItem(SIn), ArgItemV(SIn){}
329 Type.Save(SOut); CatNm.
Save(SOut); HdItem.
Save(SOut); ArgItemV.Save(SOut);}
340 return ArgItemV[ArgItemN];}
343 TStr GetHdArgNmStr()
const;
371 void GetCatNmV(
TStrV& CatNmV)
const;
372 void GetObjHdNmV(
const TStr& CatNm,
TStrV& ObjHdNmV)
const;
void SaveTxt(const PSOut &SOut) const
PExpVal GetBiConstVal(const TExpBiId &ExpBiId)
TExpHelpItem(const TStr &_Nm, const TStr &_TypeStr, const TStr &_DescStr, const TStr &_DfValStr)
PExpVal Eval(bool &Ok, TStr &MsgStr, const PExpEnv &ExpEnv=TExpEnv::DfExpEnv)
static PExpHelpItem Load(TSIn &SIn)
bool operator==(const TExp &) const
static TLxSym GetLxSymFromExpOp(const TExpOp &ExpOp)
bool operator==(const TExpEnv &) const
virtual int GetVars() const
TExpVal(const double &_Flt)
static PExp LoadTxt(const TStr &ExpStr)
TExpVal & operator=(const TExpVal &)
bool operator==(const TExpHelpItem &) const
void AddBi(const TStr &ExpBiNm, const TExpBiId &ExpBiId, const TExpBiArgType &ExpBiArgType=ebatUndef)
static PExpVal GetUndefExpVal()
TExpHelpObj(const TExpHelpObjType &_Type, const TStr &_CatNm, const PExpHelpItem &_HdItem, const TExpHelpItemV &_ArgItemV)
virtual void GetVarNmVal(const int &, TStr &, PExpVal &) const
TExpVal(const TFlt &_Flt)
void Save(TSOut &SOut) const
static PExpHelp LoadXml(const TStr &FNm)
TExpHelpItem & operator=(const TExpHelpItem &)
virtual void PutVarVal(const TStr &, const PExpVal &)
PExpHelpItem GetHdItem() const
virtual PExpVal GetVarVal(const TStr &, bool &IsVar)
static PExpHelpObj New(const TExpHelpObjType &Type, const TStr &CatNm, const PExpHelpItem &HdItem, const TExpHelpItemV &ArgItemV=TExpHelpItemV())
static PExpEnv Load(TSIn &SIn)
void Save(TSOut &SOut) const
#define ClassTPVL(TNm, PNm, TNmV, TNmL, TNmLN)
#define ClassTP(TNm, PNm)
static PSIn New(const TStr &FNm)
#define ClassTPV(TNm, PNm, TNmV)
PPp MkClone(const PPp &Pp)
PExpVal Eval(const PExpEnv &ExpEnv=TExpEnv::DfExpEnv)
void AssertArgs(const int &RqArgs, const int &ActArgs)
static TStr GetExpOpStr(const TExpOp &ExpOp)
TExpBiArgType GetExpBiArgType(const TExpBiId &ExpBiId)
virtual PExpVal GetVarVal(const TStr &VarNm)
void AddObj(const PExpHelpObj &Obj)
static PExpVal New(const TFlt &Flt)
void Save(TSOut &SOut, const bool &IsSmall=false) const
bool operator==(const TExpHelp &) const
TVec< PExpHelpItem > TExpHelpItemV
static PSIn New(const TStr &Str)
static PExp Load(TSIn &SIn)
TExpVal(const TStr &_Str)
bool operator==(const TExpHelpObj &) const
TExpValType GetValType() const
static PExpVal New(const double &Flt)
virtual void Save(TSOut &SOut) const
static PExp LoadTxt(const TStr &ExpStr, bool &Ok, TStr &MsgStr)
PExpVal GetBiFuncVal(const TExpBiId &ExpBiId, const TExpValV &ArgValV, const PExpEnv &ExpEnv)
bool IsExpBiId(const TStr &ExpBiNm, TExpBiId &ExpBiId)
virtual PExpVal GetFuncVal(const TStr &, const TExpValV &, bool &IsFunc)
bool operator==(const TExpBi &) const
bool IsExpBiId(const TStr &ExpBiNm)
static PExpVal New(const TExpValType &ValType=evtUndef)
void AddToVec(const PExpVal &ExpVal)
TExpEnv & operator=(const TExpEnv &)
static bool IsExpStrOk(const TStr &ExpStr, TStr &MsgStr)
TExpHelp & operator=(const TExpHelp &)
void AssertArgValType(const TExpValType &ExpValType, const PExpVal &ExpVal)
static PExpVal New(const TStr &Str)
void Save(TSOut &SOut) const
static PExpHelpObj Load(TSIn &SIn)
static PExpHelp Load(TSIn &SIn)
TExpHelpObj & operator=(const TExpHelpObj &)
void AddToLst(const PExpVal &ExpVal)
PExpVal Eval(const PExpEnv &ExpEnv, const bool &DbgP, TStr &DbgStr)
PExpHelpItem GetArgItem(const int &ArgItemN) const
static TStr GetSymStr(const TLxSym &Sym)
static PExpHelpItem New(const TStr &Nm, const TStr &TypeStr, const TStr &DescStr, const TStr &DfValStr)
bool IsFltVal(double &_Flt) const
TPt< TExpHelpItem > PExpHelpItem
void Save(TSOut &SOut) const
void Save(TSOut &SOut) const
TExpHelpObjType GetType() const
void Save(TSOut &SOut) const
TExp & operator=(const TExp &)
TPt< TExpHelpObj > PExpHelpObj
TExpBi & operator=(const TExpBi &)
static PExpVal Load(TSIn &SIn)
bool IsFltVal(TFlt &_Flt) const
TIntIntH ExpBiIdToArgTypeH