void PrintExpressionListDebug() { foreach (Expression x in theExpressionList) { ExpressionPrinter x1 = new ExpressionPrinter(x); x1.Print(); } }
public void PrintEntireExpressionList() { foreach (Expression x in theExpressionList) { ExpressionPrinter c = new ExpressionPrinter(x); c.Print(); } }
private ITableAxis <TStorage> CreateExplicitAxis(string title, Expression <Func <TItem, bool> >[] selectors) { var items = selectors.Select(i => (Name: ExpressionPrinter.Print(i), Func: i.Compile())); return(new TableAxis <TStorage>(title, items.Select(j => new TableRowOrColumn <TStorage>(j.Name, Items.Where(k => j.Func(FromStorage(k))))) )); }
void Observer() { if (Checker.isNumberDeclaration(givenExpression) && !Checker.ifContainOperations(givenExpression)) { MakeNumber(); } else if (Checker.isMatrixDeclaration(givenExpression) && !Checker.ifContainMatOperations(givenExpression) && Checker.isMinusIncludedInMatrix(givenExpression)) { MakeMatrix(); } else { if (Checker.ifContainOperations(givenExpression)) // if the expression is a mathematical one. { EquationHead.EquationWatch theEquationSolution = new EquationHead.EquationWatch(theExpressionList, givenExpression); if (theEquationSolution.isProcessed()) { theResult = new Expression(theEquationSolution.getSolution()); if (theResult.getExpType() == 1) { theResult.setEntireTag(autoMatrixNamer()); } else if (theResult.getExpType() == 2) { theResult.setEntireTag(autoNumberNamer()); } Processed = true; } else { Processed = false; } } else if (!Checker.ifPrefixExist(givenExpression) && !Checker.isConstant(givenExpression) && SearchList(givenExpression)) // for searching a quried variable { Processed = false; } else if (!Checker.ifPrefixExist(givenExpression) && Checker.isConstant(givenExpression)) { Processed = false; ExpressionPrinter p = new ExpressionPrinter(theConstantList.getConstant(givenExpression)); p.Print(); } else if (Checker.ifPrefixExist(givenExpression)) { Processed = false; ExpressionPrinter p = new ExpressionPrinter(pUnderstander.prefixList(givenExpression)); p.Print(); } else { TheMessageHandler.MessagePrinter.Print("Variable does not exist"); Processed = false; } } }
public void TestDynamicExpression() { Expression e = new AdditionExpression(new DoubleExpression(1), new AdditionExpression(new DoubleExpression(2), new DoubleExpression(3))); var ep = new ExpressionPrinter(); var sb = new StringBuilder(); ep.Print((dynamic)e, sb); Console.WriteLine(sb); }
public void Printer() // printes the expressions of the Expression List { if (printExp) { ExpressionPrinter x = new ExpressionPrinter(theExpressionList [counter]); x.Print(); counter++; } //autoDestroyer (); }
bool SearchList(string exp) // searches the list for queried variable and returns a bool if found = true and { // false if not found bool found = false; foreach (Expression x in theExpressionList) { if (x.getTag() == exp) { ExpressionPrinter p = new ExpressionPrinter(x); p.Print(); found = true; break; } } return(found); }
/// /////////////////////////////////////////////////////////////////////////// bool DoesNotAlreadyExist(Expression theResult) { bool notfound = true; foreach (Expression x in theExpressionList) { if (x.getTag() == theResult.getTag()) { theExpressionList [theExpressionList.IndexOf(x)] = theResult; notfound = false; break; } } if (notfound == false) { ExpressionPrinter exp = new ExpressionPrinter(theResult); exp.Print(); } return(notfound); }
/// /////////////////////////////////////////////////////////////////////////// bool DoesNotAlreadyExist(Expression theResult) { bool notfound = true; foreach (Expression x in theExpressionList) { if (x.getTag() == theResult.getTag()) { theExpressionList [theExpressionList.IndexOf(x)] = theResult; notfound = false; break; } } if (notfound == false) { TheMessageHandler.MessagePrinter.Print("A variable with the same name existed so I have overriden the data."); ExpressionPrinter exp = new ExpressionPrinter(theResult); exp.Print(); } return(notfound); }
internal override string PrintTree(ExpressionPrinter printer) { return printer.Print(this); }
public ITable <TItem> WithColumns <TKey>(Expression <Func <TItem, TKey> > selector) => WithColumns(ExpressionPrinter.Print(selector), selector.Compile());
internal override string PrintTree(ExpressionPrinter printer) { return(printer.Print(this)); }
public void SimplePropertyaCCESS() { Assert.Equal("Length", ExpressionPrinter.Print((string s) => s.Length)); }
public void NullCoalescing() { Assert.Equal("Reverse()", ExpressionPrinter.Print((string s) => s.Reverse() ?? "")); }
public static UnivariateSummary <T> UnivariateSummary <T>(this IEnumerable <T> data, Expression <Func <T, bool> > outcome) => new UnivariateSummary <T>(data, ExpressionPrinter.Print(outcome), outcome.Compile());
public UnivariateSummary <T> WithVariable(Expression <Func <T, object> > variable) => WithVariable(ExpressionPrinter.Print(variable), variable.Compile());
protected override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Print(Expression); }
public override void Print(ExpressionPrinter expressionPrinter) { expressionPrinter.Print(Expression); }
public TFinalType WithVariable(Expression <Func <T, bool?> > selector) => WithVariable(ExpressionPrinter.Print(selector), selector.Compile());
public TFinalType WithDummyVariable <TVariable>(Expression <Func <T, TVariable?> > selector, TVariable?referrant = null) where TVariable : struct => WithDummyVariable(ExpressionPrinter.Print(selector), selector.Compile(), referrant);
public TFinalType WithDummyVariable <TVariable>(Expression <Func <T, TVariable> > selector, TVariable referrant = null, RequireClass <TVariable> reserved = null) where TVariable : class => WithDummyVariable(ExpressionPrinter.Print(selector), selector.Compile(), referrant, reserved);