WSF
WsfPProxySatisfy Class Reference

#include <WsfPProxySatisfy.hpp>

Collaboration diagram for WsfPProxySatisfy:

Classes

struct  SatPoint
struct  SatisfyResult
struct  EquationExpr
struct  Equation
 Represents an assignment being made in a grammar action. More...
struct  SolveResult

Public Types

enum  SatMode { cSM_NONE , cSM_TARGET , cSM_FIX }
enum  SatisfyResultEnum {
  cNOT_SATISFIABLE = 0 , cSATISFIABLE = 1 , cADDS_VALUE = 2 , cCHANGED_TARGET = 4 ,
  cSUCCESS = cADDS_VALUE | cSATISFIABLE , cSUCCESS_COMPLETE = cCHANGED_TARGET | cSUCCESS
}
enum  TypeLoadLookupResult { cTL_SUCCESS , cTL_COLLISION , cTL_LOADFAIL , cTL_FAILURE }

Public Member Functions

bool FixMode () const
 WsfPProxySatisfy (WsfPProxyRegistry *aRegistryPtr, WsfPProxyValue aDesiredRootValue, WsfPProxyUndoValue aCurrentRootValue, WsfPParseRuleTracer *aTracerPtr)
 ~WsfPProxySatisfy ()
bool SatisfyRootDifferences ()
bool SatisfyBlock (WsfPParseRuleTraceContext *aContextPtr)
bool SatisfyBlock (WsfPParseRuleTraceContext *aContextPtr, WsfPProxyValue aExistingValues)
bool SatisfyAttribute (const WsfPProxyPath &aPath)
WsfPProxySatisfy::SatisfyResult SatisfyAttributeInContext (const WsfPProxyPath &aPath, WsfPParseRuleTraceContext *aContextPtr)
bool IsEqual (const WsfPProxyValue &A, const WsfPProxyValue &B)
WsfPProxyValue LookupBasicValue (const WsfPProxyPath &aPath)
WsfPProxyValue LookupBasicValue (const WsfParseTypePath &aPath)
WsfPProxyUndoValue LookupCurrent (WsfPProxyUndoValue &aCurrent, const WsfParseTypePath &aAddr, bool aRelative)
WsfPProxyUndoValue LookupCurrent (WsfPProxyUndoValue &aCurrent, const WsfParseActionAddress &aAddr)
WsfPProxyValue Lookup (WsfPProxyValue &aRoot, const WsfPProxyValue &c, const WsfParseActionAddress &aAddr, WsfPProxyPath *aUpdatePath=nullptr)
WsfPProxyValue LookupDesired (WsfPProxyValue aDesiredValue, const WsfParseActionAddress &aAddr, WsfPProxyPath *aUpdatePath=nullptr)
WsfPProxyValue LookupCurrentOrBasicValue (WsfPProxyUndoValue &aCurrent, const WsfParseTypePath &aAddr, bool aRelative)
WsfPProxyValue LookupDesired (WsfPProxyValue aDesiredValue, const WsfParseTypePath &aAddr, bool aRelative, WsfPProxyPath *aUpdatePath)
void EquationExpression (WsfParseActionPart *aExprPtr, WsfParseValueType *aLHS_TypePtr, EquationExpr &aExpr)
EquationExpr EvalExpr (EquationExpr &aExpr)
bool SolveEquation (const WsfPProxyValue &aLhs, EquationExpr &aRHS, std::vector< WsfPProxyValue * > &aVariables)
bool SolveEquations (const WsfPProxyValue &aCurrentDesired, std::vector< Equation > &aEquations, std::vector< WsfPProxyValue * > &aVariables)
 Attempts to solve a set of equations.
bool BuildSequenceEquations (WsfParseSequence *aSequence, WsfPProxyUndoValue &aCurrentValue, const WsfPProxyValue &aDesiredValue, std::vector< Equation > &aEquations, WsfParseNode *aExistingNodePtr, std::vector< WsfPProxyValue * > &aVariables)
int ApplyEquations (size_t aActionSetIndex, size_t &aNextEquation, std::vector< Equation > &aEquations, WsfPProxyUndoValue &aCurrentValue, WsfPProxyValue aDesiredValue)
void FollowAction (WsfParseAction *aActionPtr, WsfPParseRuleTrace *aParentTracePtr, WsfPProxyUndoValue &aCurrentValue, WsfPProxyValue *aDesiredValue, WsfPProxyPath &aCurrentPath, std::vector< WsfPProxyValue * > aVariables, SatisfyResult &aResult)
WsfParseNamedRuleGetRuleOutput (WsfParseRule *aRulePtr)
bool FindBindingAddress (WsfPParseRuleTrace *aTracePtr, WsfPProxyUndoValue &aCurrentValue, WsfPProxyValue aDesiredValue, WsfParseSequence *aSeq, int aNextSequenceChild, WsfParseActionAddress &aBindAddr)
bool FindBindingAddress2 (WsfPParseRuleTrace *aTracePtr, WsfPProxyUndoValue &aCurrentValue, WsfPProxyValue aDesiredValue, std::vector< WsfPProxyBasicValue > &aReturnValues, WsfParseSequence *aSeq, size_t aNextSequenceChild, WsfPProxyPath &aBindAddr)
SatisfyResult SatisfySequence (SatPoint pt)
SatisfyResult SatisfyAlternate (SatPoint pt)
SatisfyResult SatisfyValueRule (WsfPProxyBasicValue aDesiredValue, WsfPParseRuleTrace *aTracePtr)
SatisfyResult SatisfyRoot (SatPoint pt)
SatisfyResult SatisfyRecurrence (SatPoint pt)
TypeLoadLookupResult LookupTypeLoad (WsfParseTypeInfoData::Operation aOperation, bool aIsSaveType, const WsfParseTypeName &aType, WsfPProxyUndoValue &aCurrent, WsfPProxyValue &aDesired, std::string &aObjectName)
SatisfyResult SatisfyTypeLoad (WsfParseRule *currentRulePtr, SatPoint pt)
SatisfyResult Satisfy (SatPoint pt)

Public Attributes

WsfPProxyValue mDesiredRoot
WsfPProxyRegistrymRegistryPtr
ProxyEvaluator mEvaluator
WsfPParseRuleTracemTracePtr
WsfPParseRuleTracermTracerPtr
bool mRecurrenceInsertBeforeEnd
std::set< const WsfPProxyType * > mTypesThatNeedToBeCleared
std::set< void * > mAttemptedToClear
SatMode mSatMode
WsfPProxyPath mTargetPath
WsfPProxyUndoValue mCurrentRoot
std::ofstream debugOutput

Member Enumeration Documentation

◆ SatisfyResultEnum

Enumerator
cNOT_SATISFIABLE 
cSATISFIABLE 
cADDS_VALUE 
cCHANGED_TARGET 
cSUCCESS 
cSUCCESS_COMPLETE 

◆ SatMode

Enumerator
cSM_NONE 
cSM_TARGET 
cSM_FIX 

◆ TypeLoadLookupResult

Enumerator
cTL_SUCCESS 
cTL_COLLISION 
cTL_LOADFAIL 
cTL_FAILURE 

Constructor & Destructor Documentation

◆ WsfPProxySatisfy()

◆ ~WsfPProxySatisfy()

WsfPProxySatisfy::~WsfPProxySatisfy ( )

Member Function Documentation

◆ ApplyEquations()

◆ BuildSequenceEquations()

◆ EquationExpression()

◆ EvalExpr()

◆ FindBindingAddress()

bool WsfPProxySatisfy::FindBindingAddress ( WsfPParseRuleTrace * aTracePtr,
WsfPProxyUndoValue & aCurrentValue,
WsfPProxyValue aDesiredValue,
WsfParseSequence * aSeq,
int aNextSequenceChild,
WsfParseActionAddress & aBindAddr )

◆ FindBindingAddress2()

◆ FixMode()

bool WsfPProxySatisfy::FixMode ( ) const
inline

Referenced by SatisfyRecurrence().

◆ FollowAction()

void WsfPProxySatisfy::FollowAction ( WsfParseAction * aActionPtr,
WsfPParseRuleTrace * aParentTracePtr,
WsfPProxyUndoValue & aCurrentValue,
WsfPProxyValue * aDesiredValue,
WsfPProxyPath & aCurrentPath,
std::vector< WsfPProxyValue * > aVariables,
SatisfyResult & aResult )

References cADDS_VALUE, WsfParseActionObjectMapOp::cAPPLY, WsfParseActionPart::cASSIGN, cCHANGED_TARGET, WsfParseActionPart::cCOPY, WsfParseTypeInfoData::cCREATE_TYPE, WsfParseActionPart::cDEBUG_PRINT, WsfParseTypeInfoData::cDELETE_TYPE, WsfPParseRuleTrace::Children(), WsfParseActionPart::cLIST_OP, WsfParseActionPart::cLITERAL, WsfParseTypeInfoData::cLOAD_TYPE, WsfParseActionObjectMapOp::cMAP_SET, WsfParseTypeInfoData::cNESTED_LOAD, WsfParseTypeInfoData::cNESTED_SAVE, WsfParseActionObjectMapOp::cNEW, WsfParseActionPart::cNODE_REFERENCE, cNOT_SATISFIABLE, WsfParseActionPart::cOBJECT_MAP_OP, WsfPProxyValue::ConstructNew(), WsfPProxyValue::Copy(), WsfParseActionPart::cPUSH, WsfParseActionListOp::cPUSH_BACK, cSATISFIABLE, WsfParseActionPart::cSKIP, cSUCCESS, WsfParseRule::cTYPE_LOAD, WsfPProxyUndoValue::Exists(), WsfPProxyList::Get(), WsfPProxyUndoValue::Get(), WsfPProxyUndoValue::GetAttr(), WsfPProxyValue::GetAttr(), WsfParseNode::GetAuxiliaryValue(), WsfPProxyValue::GetList(), WsfPProxyValue::GetObjectMap(), WsfParseTypeLoadRule::GetOperation(), WsfPProxyUndoValue::GetPath(), WsfPParseRuleTrace::GetText(), WsfPProxyValue::GetType(), WsfPProxyPath::IsPrefixOf(), WsfPProxyUndoValue::ListPush(), LookupCurrent(), LookupCurrentOrBasicValue(), LookupDesired(), WsfParseActionPart::mActionPartType, WsfPProxyUndoValue::MapDelete(), WsfPProxyUndoValue::MapInsert(), WsfParseActionListOp::mAttributeAddr, WsfParseActionObjectMapOp::mAttributeAddr, WsfParseActionPush::mAttributeAddr, mEvaluator, WsfParseTypeInfoData::mFlags, WsfParseActionNodeReference::mIndex, WsfParseTypeInfoData::mLoadKey, WsfParseTypeLoadRule::mLoadType, WsfParseTypeName::mNestedLookup, WsfPParseRuleTrace::mNodePtr, WsfParseActionObjectMapOp::mObjectName, WsfParseActionListOp::mOperation, WsfParseActionObjectMapOp::mOperation, WsfParseTypeName::mOrdinal, WsfPProxyUndoValue::MoveToAttr(), WsfParseTypeName::mPath, WsfParseActionListOp::mPushedValuePtr, mRegistryPtr, WsfParseTypeInfoData::mSaveKey, WsfParseTypeLoadRule::mSaveType, WsfParseAction::mSubActions, mTargetPath, ok, WsfPParseRuleTrace::Rule(), WsfPProxyList::Size(), WsfPProxyPath::size(), WsfPProxyBasicValue::ToString(), and WsfParseRule::Type().

Referenced by SatisfySequence().

◆ GetRuleOutput()

◆ IsEqual()

bool WsfPProxySatisfy::IsEqual ( const WsfPProxyValue & A,
const WsfPProxyValue & B )

◆ Lookup()

◆ LookupBasicValue() [1/2]

WsfPProxyValue WsfPProxySatisfy::LookupBasicValue ( const WsfParseTypePath & aPath)

References mRegistryPtr.

◆ LookupBasicValue() [2/2]

WsfPProxyValue WsfPProxySatisfy::LookupBasicValue ( const WsfPProxyPath & aPath)

◆ LookupCurrent() [1/2]

◆ LookupCurrent() [2/2]

◆ LookupCurrentOrBasicValue()

WsfPProxyValue WsfPProxySatisfy::LookupCurrentOrBasicValue ( WsfPProxyUndoValue & aCurrent,
const WsfParseTypePath & aAddr,
bool aRelative )

◆ LookupDesired() [1/2]

WsfPProxyValue WsfPProxySatisfy::LookupDesired ( WsfPProxyValue aDesiredValue,
const WsfParseActionAddress & aAddr,
WsfPProxyPath * aUpdatePath = nullptr )
inline

◆ LookupDesired() [2/2]

WsfPProxyValue WsfPProxySatisfy::LookupDesired ( WsfPProxyValue aDesiredValue,
const WsfParseTypePath & aAddr,
bool aRelative,
WsfPProxyPath * aUpdatePath )

◆ LookupTypeLoad()

◆ Satisfy()

WsfPProxySatisfy::SatisfyResult WsfPProxySatisfy::Satisfy ( SatPoint pt)

◆ SatisfyAlternate()

◆ SatisfyAttribute()

◆ SatisfyAttributeInContext()

◆ SatisfyBlock() [1/2]

◆ SatisfyBlock() [2/2]

bool WsfPProxySatisfy::SatisfyBlock ( WsfPParseRuleTraceContext * aContextPtr,
WsfPProxyValue aExistingValues )

◆ SatisfyRecurrence()

◆ SatisfyRoot()

◆ SatisfyRootDifferences()

◆ SatisfySequence()

◆ SatisfyTypeLoad()

◆ SatisfyValueRule()

◆ SolveEquation()

bool WsfPProxySatisfy::SolveEquation ( const WsfPProxyValue & aLhs,
EquationExpr & aRHS,
std::vector< WsfPProxyValue * > & aVariables )

Attempts to solve an equation to determine: -If the equation is unsolvable, returns false -If the equation can be solved, the variable values are stored in aVariables

Parameters
aLhsThe desired value of the equation's left-hand-side.
aRHSThe expression to evaluate
aVariablesThe variables values used in the expression. Variables not bound to a value are null.

References WsfPProxySatisfy::EquationExpr::cFUNCTION, WsfPProxySatisfy::EquationExpr::cNODE_INDEX, WsfPProxyValue::Copy(), WsfPProxySatisfy::EquationExpr::cUNSET_VALUE, WsfPProxySatisfy::EquationExpr::cVALUE, WsfPProxyValue::GetDataPtr(), WsfPProxyValue::GetList(), WsfPProxyValue::GetType(), IsEqual(), WsfPProxyValue::IsUnset(), mAttemptedToClear, WsfPProxySatisfy::EquationExpr::mExprType, WsfPProxySatisfy::EquationExpr::mNodeIndex, mTypesThatNeedToBeCleared, and WsfPProxySatisfy::EquationExpr::mValue.

Referenced by SolveEquations().

◆ SolveEquations()

bool WsfPProxySatisfy::SolveEquations ( const WsfPProxyValue & aCurrentDesired,
std::vector< Equation > & aEquations,
std::vector< WsfPProxyValue * > & aVariables )

Member Data Documentation

◆ debugOutput

std::ofstream WsfPProxySatisfy::debugOutput
mutable

◆ mAttemptedToClear

std::set<void*> WsfPProxySatisfy::mAttemptedToClear

Referenced by SolveEquation().

◆ mCurrentRoot

◆ mDesiredRoot

◆ mEvaluator

ProxyEvaluator WsfPProxySatisfy::mEvaluator

◆ mRecurrenceInsertBeforeEnd

bool WsfPProxySatisfy::mRecurrenceInsertBeforeEnd

◆ mRegistryPtr

◆ mSatMode

SatMode WsfPProxySatisfy::mSatMode

◆ mTargetPath

◆ mTracePtr

◆ mTracerPtr

WsfPParseRuleTracer* WsfPProxySatisfy::mTracerPtr

◆ mTypesThatNeedToBeCleared

std::set<const WsfPProxyType*> WsfPProxySatisfy::mTypesThatNeedToBeCleared

Referenced by SolveEquation(), and WsfPProxySatisfy().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved