WSF
WsfParseNode Class Reference

#include <WsfParseNode.hpp>

Collaboration diagram for WsfParseNode:

Public Types

enum  Flags {
  cERROR_INCOMPLETE = 0x1 , cTYPE_NAME_NODE = 0x2 , cTYPE_REFERENCE_NODE = 0x4 , cTYPE_MASK = cTYPE_NAME_NODE | cTYPE_REFERENCE_NODE ,
  cNAMED_NODE = 0x8 , cLOAD_TYPE_NODE = 0x10 , cLAZY_TYPE_REFERENCE_NODE = 0x20 , cLAZY_TYPENAME_NODE = 0x40 ,
  cLAZY_TYPE_MASK = cLAZY_TYPE_REFERENCE_NODE | cLAZY_TYPENAME_NODE , cBLOCK_NODE = 0x80 , cSCRIPT_BLOCK = 0x100 , cSCRIPT_FUNCTION = 0x200 ,
  cSCRIPT_VARIABLES = 0x400 , cSCRIPT_MASK = 0x700 , cDELAY_LOAD = 0x800 , cBLOCK_START = 0x1000 ,
  cBLOCK_END = 0x2000 , cPRUNE_NODE = 0x4000
}

Public Member Functions

void Add (WsfParseNode *aChild)
void MarkIncomplete ()
void SetFlags (int aMask)
int GetFlags () const
void DebugPrint (ut::log::MessageStream &aStream)
WsfParseNodeNext (bool aRecurseDown=true) const
WsfParseNodeNextLeaf (bool aRecurseDown=true) const
 Returns the next node containing a value.
WsfParseNodePreviousLeaf () const
 Returns the previous node containing a value.
WsfParseNodePrevious () const
 Returns the previous node in a DFS traversal.
WsfParseNodeFindChildByType (const std::string &aType) const
 Returns the first child with the specified type. Returns null if none is found.
UtTextRange SubtreeRange (UtTextDocument *aSource)
UtTextDocumentRange SubtreeRange ()
UtTextRange GetBoundingRange (UtTextDocument *aSource)
WsfParseNodeGetLeftmostValue (UtTextDocument *aSourcePtr)
WsfParseNodeGetRightmostValue (UtTextDocument *aSourcePtr)
WsfParseNodeGetLeftmostValue ()
WsfParseNodeGetRightmostValue ()
WsfParseNodeGetRightmostLeaf ()
WsfParseNodeGetLeftmostLeaf ()
WsfParseAuxDataGetAuxiliaryValue () const
void SetAuxiliaryValue (WsfParseAuxData *aValuePtr)
WsfParseNodeGetParent () const
WsfParseNodeGetChild (size_t aIndex) const
void Detatch ()
void Replace (WsfParseNode *aNodePtr)
void ResetLinks ()
WsfParseNodeRight ()
WsfParseNodeFarRight ()
WsfParseNodeLeft ()
WsfParseNodeFarLeft ()
WsfParseNodeDown ()
void InsertBefore (WsfParseNode *aNodePtr)
void InsertAfter (WsfParseNode *aNodePtr)
size_t LexicalIndex () const
size_t LoadOrder () const
void SetLexicalIndex (size_t aLexicalIndex)
WsfParseRuleGetTopLevelRule () const
void MarkPruned ()
std::string GetTextValue ()
void Print (std::ostream &aStream, int aIndent, bool aVerbose)

Static Public Member Functions

static bool GetRangeNodes (WsfParseNode *aRootNodePtr, const UtTextDocumentRange &aRange, const std::vector< WsfParseNode * > &aFileTransitionNodes, std::vector< WsfParseNode * > &aNodes)
static std::string GetNodeString (WsfParseNode *aNodePtr)

Public Attributes

int mFlags
 Bit-set of flags for the node.
WsfParseRulemRulePtr
 The WsfParseReader object which created this node.
const char * mType
WsfParseAuxDatamAuxiliaryValue
UtTextDocumentRange mValue

Protected Member Functions

 WsfParseNode (WsfParseRule *aReader, const char *aType, UtTextDocumentRange aValue=UtTextDocumentRange())
 WsfParseNode ()
 ~WsfParseNode ()=default
 WsfParseNode (const WsfParseNode &)=default

Friends

class WsfParseNodePool
class WsfParseNodeP

Detailed Description

A node resulting from WsfParser execution. Each node represents a matched rule from the grammar.

Member Enumeration Documentation

◆ Flags

Enumerator
cERROR_INCOMPLETE 

Flag indicates the node is the result of a partially matched rule.

cTYPE_NAME_NODE 
cTYPE_REFERENCE_NODE 
cTYPE_MASK 
cNAMED_NODE 
cLOAD_TYPE_NODE 
cLAZY_TYPE_REFERENCE_NODE 
cLAZY_TYPENAME_NODE 
cLAZY_TYPE_MASK 
cBLOCK_NODE 
cSCRIPT_BLOCK 
cSCRIPT_FUNCTION 
cSCRIPT_VARIABLES 
cSCRIPT_MASK 
cDELAY_LOAD 
cBLOCK_START 
cBLOCK_END 
cPRUNE_NODE 

Constructor & Destructor Documentation

◆ WsfParseNode() [1/3]

◆ WsfParseNode() [2/3]

WsfParseNode::WsfParseNode ( )
inlineprotected

◆ ~WsfParseNode()

WsfParseNode::~WsfParseNode ( )
protecteddefault

◆ WsfParseNode() [3/3]

WsfParseNode::WsfParseNode ( const WsfParseNode & )
protecteddefault

References WsfParseNode().

Member Function Documentation

◆ Add()

◆ DebugPrint()

void WsfParseNode::DebugPrint ( ut::log::MessageStream & aStream)

References DebugPrint(), mType, mValue, Right(), and WsfParseNode().

Referenced by DebugPrint().

◆ Detatch()

void WsfParseNode::Detatch ( )

◆ Down()

◆ FarLeft()

WsfParseNode * WsfParseNode::FarLeft ( )

◆ FarRight()

WsfParseNode * WsfParseNode::FarRight ( )

References WsfParseNode().

Referenced by GetRangeNodes(), and GetRightmostLeaf().

◆ FindChildByType()

WsfParseNode * WsfParseNode::FindChildByType ( const std::string & aType) const

Returns the first child with the specified type. Returns null if none is found.

References mType, Right(), and WsfParseNode().

Referenced by wizard::AutoComplete::FindBlock(), and wizard::ParseResults::FindBlock().

◆ GetAuxiliaryValue()

◆ GetBoundingRange()

UtTextRange WsfParseNode::GetBoundingRange ( UtTextDocument * aSource)

◆ GetChild()

◆ GetFlags()

◆ GetLeftmostLeaf()

WsfParseNode * WsfParseNode::GetLeftmostLeaf ( )

References WsfParseNode().

Referenced by GetLeftmostValue(), and GetLeftmostValue().

◆ GetLeftmostValue() [1/2]

WsfParseNode * WsfParseNode::GetLeftmostValue ( )

◆ GetLeftmostValue() [2/2]

WsfParseNode * WsfParseNode::GetLeftmostValue ( UtTextDocument * aSourcePtr)

◆ GetNodeString()

◆ GetParent()

◆ GetRangeNodes()

bool WsfParseNode::GetRangeNodes ( WsfParseNode * aRootNodePtr,
const UtTextDocumentRange & aRange,
const std::vector< WsfParseNode * > & aFileTransitionNodes,
std::vector< WsfParseNode * > & aNodes )
static

Returns the ranges of nodes containing the values in the given range.

Parameters
aRootNodePtrThe root node of the tree.
aRangeThe range of text to find nodes in.
aFileTransitionNodesThe first node of each file. Used for accelerating searches.
aNodesA vector containing a pair of nodes for each range marking the begin and end.
Note
Run time is O([Tokens In File] - [Tokens in range] + [Files in scenario]) When requesting the entire file range, O([Files in scenario])

References Down(), FarRight(), GetParent(), Left(), mValue, Next(), NextLeaf(), PreviousLeaf(), and WsfParseNode().

Referenced by WsfPProxySerialize::Finalize().

◆ GetRightmostLeaf()

WsfParseNode * WsfParseNode::GetRightmostLeaf ( )

◆ GetRightmostValue() [1/2]

WsfParseNode * WsfParseNode::GetRightmostValue ( )

◆ GetRightmostValue() [2/2]

WsfParseNode * WsfParseNode::GetRightmostValue ( UtTextDocument * aSourcePtr)

◆ GetTextValue()

std::string WsfParseNode::GetTextValue ( )

References mValue, Next(), and WsfParseNode().

◆ GetTopLevelRule()

WsfParseRule * WsfParseNode::GetTopLevelRule ( ) const

◆ InsertAfter()

void WsfParseNode::InsertAfter ( WsfParseNode * aNodePtr)

◆ InsertBefore()

void WsfParseNode::InsertBefore ( WsfParseNode * aNodePtr)

References GetParent(), and WsfParseNode().

◆ Left()

◆ LexicalIndex()

◆ LoadOrder()

size_t WsfParseNode::LoadOrder ( ) const

◆ MarkIncomplete()

void WsfParseNode::MarkIncomplete ( )
inline

◆ MarkPruned()

void WsfParseNode::MarkPruned ( )

◆ Next()

◆ NextLeaf()

◆ Previous()

WsfParseNode * WsfParseNode::Previous ( ) const

Returns the previous node in a DFS traversal.

References GetRightmostLeaf(), and WsfParseNode().

Referenced by GetRightmostValue(), GetRightmostValue(), wizard::WsfStyler::GetTextTypeFromNode(), and PreviousLeaf().

◆ PreviousLeaf()

◆ Print()

◆ Replace()

void WsfParseNode::Replace ( WsfParseNode * aNodePtr)

Remove this node from the tree, replacing it with aNodePtr. aNodePtr should have no siblings or parent

References WsfParseNode().

◆ ResetLinks()

void WsfParseNode::ResetLinks ( )

◆ Right()

◆ SetAuxiliaryValue()

void WsfParseNode::SetAuxiliaryValue ( WsfParseAuxData * aValuePtr)
inline

◆ SetFlags()

◆ SetLexicalIndex()

void WsfParseNode::SetLexicalIndex ( size_t aLexicalIndex)
inline

◆ SubtreeRange() [1/2]

UtTextDocumentRange WsfParseNode::SubtreeRange ( )

◆ SubtreeRange() [2/2]

◆ WsfParseNodeP

friend class WsfParseNodeP
friend

References Add(), WsfParseNode(), and WsfParseNodeP.

Referenced by WsfParseNodeP.

◆ WsfParseNodePool

friend class WsfParseNodePool
friend

References WsfParseNodePool.

Referenced by WsfParseNodePool.

Member Data Documentation

◆ mAuxiliaryValue

◆ mFlags

◆ mRulePtr

◆ mType

◆ mValue

UtTextDocumentRange WsfParseNode::mValue

Leaf nodes in the parse tree should have a value. The value is the range of characters matched by the rule. User should verify the range is valid before using.

Referenced by wizard::CreatePlatformDialog::ChooseFileFromType(), WsfParseSequence::CompleteDelayLoad(), wizard::CreateTypeDialog::CreateTypeDialog(), WsfParseTypeLoadRule::CreateTypePath(), DebugPrint(), WsfParser::FinalizeParseTree(), wizard::AutoComplete::FindBlock(), wizard::GrammarDocumentation::FindDocumentation(), wizard::ParseResults::FindNamedNodes(), wizard::ParseResults::FindNames(), wizard::ParseUtil::FindReferenceType(), wizard::ParseResults::FindTypeDefinitionNode(), wizard::ParseResults::FindTypeReferenceNodes(), wizard::ParseResults::FindUserTypeDocumentation(), wizard::WsfStyler::FoldDocument(), GetBoundingRange(), wizard::InputContext::GetContext(), wizard::ParseResults::GetFileNotifications(), wizard::InputContext::GetInputContext(), GetLeftmostValue(), GetLeftmostValue(), GetNodeString(), wizard::ParseResults::GetRangeNodes(), GetRangeNodes(), GetRightmostValue(), GetRightmostValue(), wizard::WsfStyler::GetTextTypeFromNode(), GetTextValue(), wizard::ParseResults::IndexNames(), NextLeaf(), PreviousLeaf(), Print(), WsfParser::ProcessSpecialNode(), WsfParseStringWithExceptionsRule::Read(), WsfPProxyEnumType::Read(), WsfParseDelimited::ReadRange(), WsfParseTypeLoadRule::Resolve(), wizard::EditAssist_Type::SetTypeData(), ProxyEvaluator::StringOrdValue(), SubtreeRange(), SubtreeRange(), wizard::ParseResults::TypeInformationFromNode(), wizard::WsfStyler::UpdateStyle(), WsfParseNode(), and WsfParseNode().


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