public static FormulaNodeRound CreateRoundNode(FormulaTree child) { return(new FormulaNodeRound { Child = child }); }
public static FormulaNodeNegativeSign CreateNegativeSignNode(FormulaTree child) { return new FormulaNodeNegativeSign { Child = child }; }
public static FormulaNodeLog CreateLogNode(FormulaTree child) { return(new FormulaNodeLog { Child = child }); }
internal void CloneMember(ref FormulaTree member, CloneSpriteContext context) { if (member != null) { member = member.Clone(context); } }
internal void CloneMember(ref FormulaTree member) { if (member != null) { member = member.Clone(); } }
private void ViewModelOnPropertyChanged(object sender, PropertyChangedEventArgs arg) { if (arg.PropertyName == "Formula") { Formula = ((FormulaEditorViewModel)sender).Formula; } }
public static FormulaNodeNegativeSign CreateNegativeSignNode(FormulaTree child) { return(new FormulaNodeNegativeSign { Child = child }); }
public static FormulaNodeParentheses CreateParenthesesNode(FormulaTree child) { return(new FormulaNodeParentheses { Child = child }); }
public static FormulaNodeExp CreateExpNode(FormulaTree child) { return(new FormulaNodeExp { Child = child }); }
public static FormulaNodeAbs CreateAbsNode(FormulaTree child) { return(new FormulaNodeAbs { Child = child }); }
public static FormulaNodeSqrt CreateSqrtNode(FormulaTree child) { return(new FormulaNodeSqrt { Child = child }); }
public static FormulaNodeArctan CreateArctanNode(FormulaTree child) { return(new FormulaNodeArctan { Child = child }); }
public static FormulaNodeSin CreateSinNode(FormulaTree child) { return(new FormulaNodeSin { Child = child }); }
public static FormulaNodeModulo CreateModuloNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeModulo { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeEquals CreateEqualsNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeEquals { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodePower CreatePowerNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodePower { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeDivide CreateDivideNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeDivide { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeMultiply CreateMultiplyNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeMultiply { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeSubtract CreateSubtractNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeSubtract { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeAdd CreateAddNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeAdd { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeMax CreateMaxNode(FormulaTree firstChild, FormulaTree secondChild) { return(new FormulaNodeMax { FirstChild = firstChild, SecondChild = secondChild }); }
public static FormulaNodeRandom CreateRandomNode(FormulaTree firstChild, FormulaTree secondChild) { return(new FormulaNodeRandom { FirstChild = firstChild, SecondChild = secondChild }); }
public static FormulaNodePower CreatePowerNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodePower { LeftChild = leftChild, RightChild = rightChild }; }
public static string Serialize(FormulaTree formula) { if (formula == null) return string.Empty; var sb = new StringBuilder(); formula.Append(sb); return sb.ToString(); }
public static FormulaNodeAdd CreateAddNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeAdd { LeftChild = leftChild, RightChild = rightChild }; }
public static FormulaNodeGreaterEqual CreateGreaterEqualNode(FormulaTree leftChild, FormulaTree rightChild) { return(new FormulaNodeGreaterEqual { LeftChild = leftChild, RightChild = rightChild }); }
public static FormulaNodeDivide CreateDivideNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeDivide { LeftChild = leftChild, RightChild = rightChild }; }
public static FormulaNodeSubtract CreateSubtractNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeSubtract { LeftChild = leftChild, RightChild = rightChild }; }
public static FormulaNodeMultiply CreateMultiplyNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeMultiply { LeftChild = leftChild, RightChild = rightChild }; }
private void InterpretTokens() { var interpretedFormula = FormulaInterpreter.Interpret(Tokens, out _parsingError); if (interpretedFormula != null) { _formula = interpretedFormula; RaisePropertyChanged(() => Formula); } RaisePropertyChanged(() => ParsingError); RaisePropertyChanged(() => HasError); }
protected abstract bool TestEquals(FormulaTree other);
public static FormulaNodeParentheses CreateParenthesesNode(FormulaTree child) { return new FormulaNodeParentheses { Child = child }; }
public static object Evaluate(FormulaTree formula) { if (formula == null) return null; return formula.IsNumber() ? (object)formula.EvaluateNumber() : formula.EvaluateLogic(); }
public static FormulaNodeRound CreateRoundNode(FormulaTree child) { return new FormulaNodeRound { Child = child }; }
public static FormulaNodeRandom CreateRandomNode(FormulaTree firstChild, FormulaTree secondChild) { return new FormulaNodeRandom { FirstChild = firstChild, SecondChild = secondChild }; }
public static FormulaNodeLess CreateLessNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeLess { LeftChild = leftChild, RightChild = rightChild }; }
public static FormulaNodeAbs CreateAbsNode(FormulaTree child) { return new FormulaNodeAbs { Child = child }; }
public static FormulaNodeNotEquals CreateNotEqualsNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeNotEquals { LeftChild = leftChild, RightChild = rightChild }; }
public static FormulaNodeArctan CreateArctanNode(FormulaTree child) { return new FormulaNodeArctan { Child = child }; }
public static FormulaNodeLog CreateLogNode(FormulaTree child) { return new FormulaNodeLog { Child = child }; }
public static double EvaluateNumber(FormulaTree formula) { return formula == null ? 0 : formula.EvaluateNumber(); }
public static FormulaNodeExp CreateExpNode(FormulaTree child) { return new FormulaNodeExp { Child = child }; }
public static FormulaNodeModulo CreateModuloNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeModulo { LeftChild = leftChild, RightChild = rightChild }; }
public static FormulaNodeGreaterEqual CreateGreaterEqualNode(FormulaTree leftChild, FormulaTree rightChild) { return new FormulaNodeGreaterEqual { LeftChild = leftChild, RightChild = rightChild }; }
protected override bool TestEquals(FormulaTree other) { return TestEquals((UnaryFormulaTree) other); }
public static FormulaNodeSqrt CreateSqrtNode(FormulaTree child) { return new FormulaNodeSqrt { Child = child }; }
public static FormulaNodeMax CreateMaxNode(FormulaTree firstChild, FormulaTree secondChild) { return new FormulaNodeMax { FirstChild = firstChild, SecondChild = secondChild }; }
protected override bool TestEquals(FormulaTree other) { return(TestEquals((BinaryFormulaTree)other)); }
public SemanticsErrorException(FormulaTree node, string message) : base(message) { Node = node; }
public static FormulaNodeSin CreateSinNode(FormulaTree child) { return new FormulaNodeSin { Child = child }; }
private static FormulaTree RemoveParentheses(FormulaTree node) { while (true) { var parenthesesNode = node as FormulaNodeParentheses; if (parenthesesNode == null) return node; node = parenthesesNode.Child; } }
protected override bool TestEquals(FormulaTree other) { return(TestEquals((ConstantFormulaTree)other)); }
public static IEnumerable<IFormulaToken> Tokenize(FormulaTree formula) { if (formula == null) return null; return formula.Tokenize(); }
public static bool EvaluateLogic(FormulaTree formula) { return formula != null && formula.EvaluateLogic(); }