[AgRule("LLookup", "Question")] static Ast QuestionLLookup(Ast n, string name) { if (n.GetName() == name) { return(n); } return(null); }
static Racr.AstNode QuestionLLookup(Racr.AstNode n, string name) { if (n.GetName() == name) { return(n); } return(null); }
[AgRule("Value", "Use")] static object UseValue(Ast n) { if (n.Type() == Types.ErrorType) { return(ErrorValue); } var active = n.FindActive(n.GetName()); return(active.Type() == n.Type() ? active.Value() : ErrorValue); }
static bool QuestionIsLValid(Racr.AstNode n) { if (n.Type() == ValueTypes.ErrorType) { return(false); } var prev = n.GLookup(n.GetName()); return(prev.IsErrorQuestion() || n.Type() == prev.Type()); }
[AgRule("IsLValid", "Question")] static bool QuestionIsLValid(Ast n) { if (n.Type() == Types.ErrorType) { return(false); } var prev = n.GLookup(n.GetName()); return(prev.IsErrorQuestion() || n.Type() == prev.Type()); }
private static double EvalConst(Racr.AstNode node) { return(node.Lookup(node.GetName()).GetValue()); }
[AgRule("IsActive", "Question")] static bool QuestionIsActive(Ast n) { return(n.IsErrorQuestion() || ( n.Parent().IsActive() && n.FindActive(n.GetName()).IsErrorQuestion())); }
[AgRule("SExpr", "Use")] static string UseSExpr(Ast n) { return("(~> '" + n.GetName() + ")"); }
[AgRule("SExpr", "ComputedQuestion")] static string ComputedQuestionSExpr(Ast n) { return("(~? '" + n.GetName() + " " + Lexer.EscapeString(n.GetLabel()) + " " + n.GetExpression().SExpr() + ")"); }
[AgRule("SExpr", "OrdinaryQuestion")] static string OrdinaryQuestionSExpr(Ast n) { return("(?? '" + n.GetName() + " " + Lexer.EscapeString(n.GetLabel()) + " " + n.Type() + " " + (n.GetValue() == ErrorValue ? "" : Lexer.EscapeValue(n.GetValue())) + ")"); }
[AgRule("Type", "Use")] static Types UseType(Ast n) { return(n.GLookup(n.GetName()).Type()); }
static string UseSExpr(Racr.AstNode n) { return("(~> '" + n.GetName() + ")"); }
static string ComputedQuestionSExpr(Racr.AstNode n) { return("(~? '" + n.GetName() + " " + Lexer.EscapeString(n.GetLabel()) + " " + n.GetExpression().SExpr() + ")"); }
static string OrdinaryQuestionSExpr(Racr.AstNode n) { return("(?? '" + n.GetName() + " " + Lexer.EscapeString(n.GetLabel()) + " " + n.Type() + " " + Lexer.EscapeValue(n.Value()) + ")"); }
static object UseValue(Racr.AstNode n) { return(n.FindActive(n.GetName()).Value()); }
static ValueTypes UseType(Racr.AstNode n) { return(n.GLookup(n.GetName()).Type()); }
static bool QuestionIsActive(Racr.AstNode n) { return(n.IsErrorQuestion() || (n.Parent().IsActive() && n.FindActive(n.GetName()).IsErrorQuestion())); }