public LiteValue Visit(SyntaxClassBodyStatementNode Node, LiteEnv Env) { var Val = LiteValue.Nil; foreach (var Child in Node.GetChildren()) { Val = Child.Accept(this, Env); if (Val.IsError()) { break; } } return(Val); }
public LiteValue Visit(SyntaxProgramNode Node, LiteEnv Env) { var Val = LiteValue.Nil; foreach (var Child in Node.GetChildren()) { Val = Child.Accept(this, Env); //Logger.DInfo($"{Child} => {Val}"); if (Val.IsError()) { break; } } return(Val); }
public LiteValue Visit(SyntaxBlockStatementNode Node, LiteEnv Env) { var Val = LiteValue.Nil; foreach (var Child in Node.GetChildren()) { Val = Child.Accept(this, Env); //Logger.DInfo($"{Child} => {Val}"); if (Child.GetType() == SyntaxNodeType.ReturnStatement) { return(Val); } if (Val.IsError()) { break; } } return(Val); }
/// <summary> /// Accepts a visitor evaluating the logical expression. /// </summary> /// <param name="visitor">Evaluation visitor.</param> /// <returns>True if the expression is logically true. False otherwise.</returns> public bool Accept(IExpressionEvalVisitor visitor) { return(Child.Accept(visitor)); }
/// <summary> /// Accepts a visitor evaluating some specific property of the logical expression. /// </summary> /// <param name="visitor">Property evaluation visitor.</param> /// <returns>Result value of expression evaluation (fulfilling and non-fulfilling specified condition).</returns> public Tuple <double, double> Accept(IExpressionPropEvalVisitor visitor) { return(Child.Accept(visitor)); }
/// <summary> /// Accepts a visitor counting some specific property of the logical expression. /// </summary> /// <param name="visitor">Property counting visitor.</param> /// <returns>Number of expression nodes fulfilling and non-fulfilling specified condition.</returns> public Tuple <int, int> Accept(IExpressionPropCountVisitor visitor) { return(Child.Accept(visitor)); }