|
WSF
|
#include <WsfParser.hpp>
Public Member Functions | |
| WsfParser (WsfParseSourceProvider *aSourceProviderPtr, const UtPath &aWorkingDirectory, WsfParseDefinitions *aDefinitionsPtr=nullptr) | |
| WsfParser (const WsfParser &aRhs) | |
| WsfParser & | operator= (const WsfParser &)=delete |
| ~WsfParser () | |
| WsfParseNode * | ParseFiles (const std::vector< UtPath > &aFileList, int aMaxErrors) |
| void | PushDeferredSource (const UtPath &aFilePath) |
| UtTextDocument * | PushSource (const std::string &aFilePath, bool aForceInclude, UtTextDocumentRange *aIncludeLocation=nullptr, bool aSearchIncludePaths=true) |
| UtTextDocument * | FindSource (const std::string &aFilePath, bool aSearchIncludePaths=true, bool aReadFile=true) |
| size_t | GetWordsRead () const |
| Returns the number of words that have been read since the last call to Reset(). | |
| UtTextDocumentRange | ReadWord () |
| UtTextDocumentRange | ReadTerminator (const std::string &aTerminator) |
| void | UndoRead (size_t aWordCount=1) |
| UtTextDocumentRange | UndoReadAndGetRange (size_t aWordCount) |
| void | PushToUndoStack (const UtTextDocumentRange &aRange) |
| Store a parsed word for later retrieval after UndoRead(). | |
| void | PartialMatch (UtTextDocumentRange aRange) |
| void | AddError (WsfParseError *aErrorPtr) |
| void | AddError (WsfParseRule *aReader, UtTextDocumentRange &aRange) |
| void | ClearPartialMatches () |
| WsfParseSourceInclude * | GetCurrentInclude () |
| WsfParseSourceInclude * | GetInclude (UtTextDocument *aParseSourcePtr) |
| WsfParseIndex *& | GetParseIndex () |
| WsfParseDefinitions * | GetDefinitions () |
| void | SetDefinitions (WsfParseDefinitions *aDefinitionsPtr) |
| void | SwapDefinitions (WsfParseDefinitions *&aDefinitionsPtr) |
| void | PopSource () |
| void | ProcessSpecialNode (WsfParseNode *aNodePtr) |
| void | Reset () |
| Reset the parser back to its original state. | |
| void | PushTerminator (const char *aTerminatorString) |
| void | PopTerminator () |
| void | SetWorkingDirectory (const UtPath &aWorkingDirectory) |
| const UtPath & | GetWorkingDirectory () const |
| const std::vector< WsfParseError * > & | GetErrors () const |
| WsfParseSourceProvider * | GetSourceProvider () |
| WsfParseNode * | GetCurrentSequence () |
| void | PushSequence (WsfParseNode *aNodePtr) |
| void | PopSequence () |
| void | DelayLoad (const std::string &aKind, const std::string &aName, WsfParseNode *aNodePtr, ptrdiff_t aTextOffset, WsfParseRule *aSequencePtr) |
| bool | Requires (const std::string &aKind, const std::string &aName) |
| void | ResolveDelayLoad () |
| bool | IsDelayLoading () |
| void | DeleteAllNodes () |
| Node pool functions. | |
| void | SwapPool (WsfParser &aRhs) |
| void | SwapPool (WsfParseNodePool &aPool) |
| WsfParseNode * | NewNode (WsfParseRule *aRule, const char *aType, UtTextDocumentRange aValue=UtTextDocumentRange()) |
| WsfParseNode * | NewNode () |
| void | FreeNode (WsfParseNode *aNodePtr) |
| void | AddAuxiliaryValue (WsfParseAuxData *aDataPtr) |
| void | FinalizeParseTree (WsfParseNode *aRootNodePtr, std::vector< WsfParseNode * > &aFileTransitionNodes) |
| Numbers parse nodes and creates the list of file transition nodes. | |
| bool | FullyExpandNodes () const |
| void | SetFullyExpandNodes (bool aValue) |
| void | SetIgnoreIncludes (bool aIngoreIncludes) |
WsfParser acts as a lexer for wsf core files. Tokens are produced delimited by whitespace. Limited backtracking is allowed using UndoRead().
| WsfParser::WsfParser | ( | WsfParseSourceProvider * | aSourceProviderPtr, |
| const UtPath & | aWorkingDirectory, | ||
| WsfParseDefinitions * | aDefinitionsPtr = nullptr ) |
References WsfParseUtil::InitializeParseUtil().
Referenced by operator=(), Requires(), SwapPool(), and WsfParser().
| WsfParser::WsfParser | ( | const WsfParser & | aRhs | ) |
References WsfParser().
| WsfParser::~WsfParser | ( | ) |
|
inline |
Referenced by WsfParseTypeLoadRule::Read(), Requires(), and WsfParseQuotedStringRule::SetFileReference().
|
inline |
Referenced by WsfParseSequence::CompleteDelayLoad(), ParseFiles(), and WsfParseRecurrence::Read().
| void WsfParser::AddError | ( | WsfParseRule * | aReader, |
| UtTextDocumentRange & | aRange ) |
References WsfParseError::mRange, and WsfParseError::mReaderPtr.
|
inline |
Referenced by WsfParseAlternate::Read().
| void WsfParser::DelayLoad | ( | const std::string & | aKind, |
| const std::string & | aName, | ||
| WsfParseNode * | aNodePtr, | ||
| ptrdiff_t | aTextOffset, | ||
| WsfParseRule * | aSequencePtr ) |
Referenced by WsfParseSequence::CompleteDelayLoad().
|
inline |
Node pool functions.
Referenced by Reset().
| void WsfParser::FinalizeParseTree | ( | WsfParseNode * | aRootNodePtr, |
| std::vector< WsfParseNode * > & | aFileTransitionNodes ) |
Numbers parse nodes and creates the list of file transition nodes.
References WsfParseNode::mValue, WsfParseNode::Next(), and WsfParseNode::SetLexicalIndex().
| UtTextDocument * WsfParser::FindSource | ( | const std::string & | aFilePath, |
| bool | aSearchIncludePaths = true, | ||
| bool | aReadFile = true ) |
Referenced by operator=(), PushSource(), and WsfParseQuotedStringRule::SetFileReference().
|
inline |
Referenced by WsfParseRecurrence::Read(), WsfParseSequence::Read(), and WsfParseStringWithExceptionsRule::Read().
|
inline |
Referenced by WsfParseNamedRule::Read(), and WsfParseRuleReference::Read().
|
inline |
Referenced by ParseFiles().
|
inline |
Referenced by WsfParseTypeLoadRule::CreateTypePath().
|
inline |
|
inline |
Referenced by ParseFiles().
| WsfParseSourceInclude * WsfParser::GetInclude | ( | UtTextDocument * | aParseSourcePtr | ) |
|
inline |
|
inline |
|
inline |
Returns the number of words that have been read since the last call to Reset().
Referenced by WsfParseSequence::Read().
|
inline |
Referenced by WsfParseQuotedStringRule::SetFileReference().
|
inline |
Referenced by WsfParseSequence::Read(), and WsfParseTypeLoadRule::Read().
|
inline |
|
inline |
Referenced by WsfParseAlternate::Read(), WsfParseLineStringRule::Read(), WsfParseNamedRule::Read(), WsfParseQuotedStringRule::Read(), WsfParseRecurrence::Read(), WsfParseRuleReference::Read(), WsfParseScriptRule::Read(), WsfParseSequence::Read(), WsfParseTypeLoadRule::Read(), WsfParseDelimited::ReadRange(), WsfParseIntRule::ReadRange(), WsfParseLiteral::ReadRange(), WsfParseRealRule::ReadRange(), WsfParseStringRule::ReadRange(), and WsfParseStringWithExceptionsRule::ReadRange().
References FindSource(), ParseFiles(), PushDeferredSource(), PushSource(), and WsfParser().
| WsfParseNode * WsfParser::ParseFiles | ( | const std::vector< UtPath > & | aFileList, |
| int | aMaxErrors ) |
|
inline |
Referenced by WsfParseSequence::Read().
|
inline |
Referenced by WsfParseSequence::Read().
| void WsfParser::PopSource | ( | ) |
|
inline |
Referenced by WsfParseRecurrence::Read().
| void WsfParser::ProcessSpecialNode | ( | WsfParseNode * | aNodePtr | ) |
References WsfParseNode::GetChild(), and WsfParseNode::mValue.
Referenced by WsfParseSequence::Read().
| void WsfParser::PushDeferredSource | ( | const UtPath & | aFilePath | ) |
Referenced by operator=(), and ParseFiles().
|
inline |
Referenced by WsfParseSequence::Read().
| UtTextDocument * WsfParser::PushSource | ( | const std::string & | aFilePath, |
| bool | aForceInclude, | ||
| UtTextDocumentRange * | aIncludeLocation = nullptr, | ||
| bool | aSearchIncludePaths = true ) |
Add a source text to be parsed next. This has the same effect of an 'include'.
| aFilePath | The path to the file, may be relative to any path variables |
| aForceInclude | 'false' if the file should only be added once (like 'include_once') |
| aIncludeLocation | Location input is being included from |
| aSearchIncludePaths | 'true' if include paths should be searched for source |
References FindSource().
Referenced by operator=(), ParseFiles(), and ReadWord().
|
inline |
Referenced by WsfParseRecurrence::Read().
| void WsfParser::PushToUndoStack | ( | const UtTextDocumentRange & | aRange | ) |
Store a parsed word for later retrieval after UndoRead().
| UtTextDocumentRange WsfParser::ReadTerminator | ( | const std::string & | aTerminator | ) |
Reads the next white-space-delimited terminal token from the input
| an empty or invalid range | if the read failed |
References ReadWord().
Referenced by WsfParseLiteral::Read().
| UtTextDocumentRange WsfParser::ReadWord | ( | ) |
Reads the next white-space-delimited token from the input
| an empty or invalid range | if the read failed |
References PushSource(), and WsfParseUtil::TrimIter().
Referenced by WsfParseSequence::CompleteDelayLoad(), ParseFiles(), WsfParseAlternate::Read(), WsfParseDelimited::Read(), WsfParseIntRule::Read(), WsfParseLineStringRule::Read(), WsfParseLiteral::Read(), WsfParseQuotedStringRule::Read(), WsfParseRealRule::Read(), WsfParseRecurrence::Read(), WsfParseScriptRule::Read(), WsfParseStringRule::Read(), and ReadTerminator().
| bool WsfParser::Requires | ( | const std::string & | aKind, |
| const std::string & | aName ) |
| void WsfParser::Reset | ( | ) |
Reset the parser back to its original state.
References DeleteAllNodes().
Referenced by ParseFiles().
| void WsfParser::ResolveDelayLoad | ( | ) |
References Requires().
Referenced by ParseFiles().
| void WsfParser::SetDefinitions | ( | WsfParseDefinitions * | aDefinitionsPtr | ) |
|
inline |
|
inline |
|
inline |
| void WsfParser::SwapDefinitions | ( | WsfParseDefinitions *& | aDefinitionsPtr | ) |
References std::swap().
|
inline |
|
inline |
References WsfParser().
| void WsfParser::UndoRead | ( | size_t | aWordCount = 1 | ) |
Undo a previous call to ReadWord(). The number of words allowed to undone is limited to cRECALL_SIZE.
Referenced by ParseFiles(), WsfParseAlternate::Read(), WsfParseDelimited::Read(), WsfParseIntRule::Read(), WsfParseLineStringRule::Read(), WsfParseLiteral::Read(), WsfParseQuotedStringRule::Read(), WsfParseRealRule::Read(), WsfParseRecurrence::Read(), WsfParseScriptRule::Read(), WsfParseSequence::Read(), WsfParseStringRule::Read(), WsfParseStringWithExceptionsRule::Read(), and UndoReadAndGetRange().
| UtTextDocumentRange WsfParser::UndoReadAndGetRange | ( | size_t | aWordCount | ) |
References UndoRead().
Referenced by WsfParseSequence::Read().