GH_ExpressionParser

References
public class GH_ExpressionParser
Provides a run-time evaluator for Grasshopper expressions.

Constructors

GH_ExpressionParser

#
public GH_ExpressionParser()

GH_ExpressionParser

#
public GH_ExpressionParser(
bThrowExceptions
)

Properties

ThrowExceptions

#
public bool ThrowExceptions { get; set; }

Variables

#
public SortedDictionary<string, GH_Variant> Variables { get; }

Methods

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariable

#
public void AddVariable(
name,
val
)

AddVariableEx

#
public void AddVariableEx()

AddVariableEx

#
public void AddVariableEx(
name,
val
)

BalancedCharTest

#
Test a string for balanced open and close chars. You can use this function to see if brackets or parenthesis have been properly used.
public static bool BalancedCharTest(
str,
String to parse.
char_open,
Char that indicates an opening statement.
char_close,
Char that indicates a closing statement.
ref int
error_at
The index at which the first error appears or -1 if no error was found.
)
True if the chars are balanced, false if they are not.

CachedSymbols

#
Retrieve a copy of the Queue of cached symbols. You can use the cached symbols as an uber-optimization to speed up successive calls to Evaluate() with an identical expression string
public Queue<GH_ParserSymbol> CachedSymbols()

CacheSymbols

#
Create a Symbols array from the expression. Use this method if you intend to evaluate the same expression multiple times. At this point, the expression has to be in correct syntax format. Use the GH_ExpressionSyntaxWriter.RewriteAll() method to make sure.
public bool CacheSymbols(
Expression
)

ClearSymbols

#
Destroy the Symbols cache.
public void ClearSymbols()

ClearVariables

#
Destroy the variable cache.
public void ClearVariables()

DisplayFunctionList

#
public void DisplayFunctionList(
wnd = null
)

Evaluate

#
Evaluate the expression currently loaded in the Symbols cache using the currently loaded variables.
public GH_Variant Evaluate()

Evaluate

#
Evaluate the expression queue without overriding any local caches. You can obtain an expression queue by calling CachedSymbols()
public GH_Variant Evaluate()

Evaluate

#
Store a new expression in the Symbols cache and evaluate it using the current variables
public GH_Variant Evaluate(
expression
)

IsValidVariableName

#
Tests whether a string is a valid variable name for expressions. Valid names must contain at least one character, must start with an alphabetic character, and only contain alphanumeric chars and underscores.
public static bool IsValidVariableName(
name
Name to test.
)
True if the name is valid (might still conflict with a function name though), false if not.

Op_BinaryAddition

#
protected GH_Variant Op_BinaryAddition()

Op_BinaryAmpersand

#
protected GH_Variant Op_BinaryAmpersand()

Op_BinaryAND

#
protected GH_Variant Op_BinaryAND()

Op_BinaryAngle

#
protected GH_Variant Op_BinaryAngle()

Op_BinaryCircumflex

#
protected GH_Variant Op_BinaryCircumflex()

Op_BinaryCrossProduct

#
protected GH_Variant Op_BinaryCrossProduct()

Op_BinaryDistance

#
protected GH_Variant Op_BinaryDistance()

Op_BinaryDivision

#
protected GH_Variant Op_BinaryDivision()

Op_BinaryEquality

#
protected GH_Variant Op_BinaryEquality()

Op_BinaryIntegerDivision

#
protected GH_Variant Op_BinaryIntegerDivision()

Op_BinaryLargerThan

#
protected GH_Variant Op_BinaryLargerThan()

Op_BinaryLargerThanOrEqual

#
protected GH_Variant Op_BinaryLargerThanOrEqual()

Op_BinaryModulus

#
protected GH_Variant Op_BinaryModulus()

Op_BinaryMultiplication

#
protected GH_Variant Op_BinaryMultiplication()

Op_BinaryNearEquality

#
protected GH_Variant Op_BinaryNearEquality()

Op_BinaryOR

#
protected GH_Variant Op_BinaryOR()

Op_BinaryPull

#
protected GH_Variant Op_BinaryPull()

Op_BinaryPush

#
protected GH_Variant Op_BinaryPush()

Op_BinarySmallerThan

#
protected GH_Variant Op_BinarySmallerThan()

Op_BinarySmallerThanOrEqual

#
protected GH_Variant Op_BinarySmallerThanOrEqual()

Op_BinarySubtraction

#
protected GH_Variant Op_BinarySubtraction()

Op_BinaryXOR

#
protected GH_Variant Op_BinaryXOR()

Op_UnaryBang

#
protected GH_Variant Op_UnaryBang()

Op_UnaryCube

#
protected GH_Variant Op_UnaryCube()

Op_UnaryDeg2Rad

#
protected GH_Variant Op_UnaryDeg2Rad()

Op_UnaryImaginary

#
protected GH_Variant Op_UnaryImaginary()

Op_UnaryMinus

#
protected GH_Variant Op_UnaryMinus()

Op_UnaryNOT

#
protected GH_Variant Op_UnaryNOT()

Op_UnaryOComponent

#
protected GH_Variant Op_UnaryOComponent()

Op_UnaryPlus

#
protected GH_Variant Op_UnaryPlus()

Op_UnarySquare

#
protected GH_Variant Op_UnarySquare()

Op_UnaryXComponent

#
protected GH_Variant Op_UnaryXComponent()

Op_UnaryYComponent

#
protected GH_Variant Op_UnaryYComponent()

Op_UnaryZComponent

#
protected GH_Variant Op_UnaryZComponent()