GH_Lexer

References
public class GH_Lexer
Represents a lexical mask for path operations.

Constructors

GH_Lexer

#
public GH_Lexer()
Blank constructor.

GH_Lexer

#
public GH_Lexer(string mask)
Create a new mask from a textual string.
mask (string)Mask string.

Properties

IsItem

#
public bool IsItem { get; }
Gets a value indicating whether or not the item portion of the lexer has been set.

IsPath

#
public bool IsPath { get; }
Gets a value indicating whether or not the path portion of the lexer has been set.

Item

#
public string Item { get; }
Gets the item string that was extracted from the mask. The default is "append"

Mask

#
public string Mask { get; }
Gets the original string that represents the user input for this lexer.

Path

#
public List<string> Path { get; }
Gets the list of path strings that was extracted from the mask. If the mask hasn't been parsed yet, it will be parsed now. If the returned list is still nothing, parsing failed.

Methods

EvaluatePath

#
public bool EvaluatePath(GH_ExpressionParser evaluator, ref GH_Path path, ref int index)
Evaluate the variables in this mask with the provided expression solver.
evaluator (GH_ExpressionParser)Evaluator to use. Must have all variables properly set up.
path (ref GH_Path)Path result.
index (ref int)Index result. If the lexer contains no item representation then the index remains unmolested.
True on success, false on failure.

PerformLexicalReplace<T>

#
public static void PerformLexicalReplace<T>(GH_Lexer source, GH_Lexer target, DataTree<T> tree_in, DataTree<T> tree_out)
Lexical Find..Replace operations.
source (GH_Lexer)Search mask.
target (GH_Lexer)Replace pattern.
tree_in (DataTree<T>)Source data tree.
tree_out (DataTree<T>)Target data tree.

PerformLexicalReplace<T>

#
public static void PerformLexicalReplace<T>(GH_Lexer source, GH_Lexer target, IGH_Structure structure_in, GH_Structure<T> structure_out)
Lexical Find..Replace operations.
source (GH_Lexer)Search mask.
target (GH_Lexer)Replace pattern.
structure_in (IGH_Structure)Source data tree.
structure_out (GH_Structure<T>)Target data tree.