internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); _condition.Accept(visitor); _ifTrue.Accept(visitor); _ifFalse.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); Target?.Accept(visitor); _upperBound?.Accept(visitor); _lowerBound?.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); foreach (var arg in Arguments) { arg.Accept(visitor); } }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); foreach (var projection in _projections) { projection.Accept(visitor); } }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); foreach (var expr in _exprs) { expr.Accept(visitor); } }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); _leftHandSide.Accept(visitor); foreach (var arg in _arguments.Values) { arg.Accept(visitor); } }
public override IStatementObject VisitCalculateStatement(SuperReadableParser.CalculateStatementContext context) { var expr = context.GetRuleContext <SuperReadableParser.ExprContext>(0); var visitor = new ExprVisitor(); var exprObj = visitor.Visit(expr); return(new CalculateStatementObject(exprObj)); }
public Expr Parse(string expression) { var input = new AntlrInputStream(expression); var lexer = new ExprLexer(input); var tokens = new CommonTokenStream(lexer); var parser = new ExprParser(tokens); var visitor = new ExprVisitor(); return(visitor.Visit(parser.expr())); }
public override IStatementObject VisitIfStatement(SuperReadableParser.IfStatementContext context) { var flag = context.GetRuleContext <SuperReadableParser.ExprContext>(0); var visitor = new ExprVisitor(); var flagObj = visitor.Visit(flag); var ifStatementObj = new IfStatementObject(flagObj); var statements = context.GetRuleContexts <SuperReadableParser.StatementContext>(); foreach (var statement in statements) { var statementObj = Visit(statement); ifStatementObj.Children.Add(statementObj); } return(ifStatementObj); }
public override Tree <Binding> VisitVariable(gramParser.VariableContext context) { var name = context.IDENTIFIER().GetText(); if (context.expr() != null) { var type = interpreter.Visit(context.expr()); if (type.Type.Check(ValueType.TYPE)) { return(new Tree <Binding>(new Binding(name, type.Get <IType>()))); } else if (type.Type.Check(ValueType.LIST)) { return(new Tree <Binding>(new Binding(name, new ListType(type.Get <IEnumerable <IValue> >(), context.expr().GetText())))); } } return(new Tree <Binding>(new Binding(name))); }
protected internal virtual ExprAST VisitChildren(ExprVisitor visitor) { return visitor.Visit(this); }
protected internal virtual ExprAST VisitChildren(ExprVisitor visitor) { return(visitor.Visit(this)); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); _innerExpression.Accept(visitor); }
public override R Accept <R>(ExprVisitor <R> visitor) { return(visitor.Visit(this)); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); Target.Accept(visitor); Condition.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); SpreadObject.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); _message.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); LeftHandSide.Accept(visitor); RightHandSide.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); _obj.Accept(visitor); _ifIsError.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); Target?.Accept(visitor); _index.Accept(visitor); }
//public static void Accept(this ConnectiveExpr visitee, ExprVisitor visitor) => visitor.Visit(visitee); public static Result Accept <Result>(this Expr visitee, ExprVisitor <Result> visitor) { var result = default(Result); var visited = TryVisitConcreteExpr <ConnectiveExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <PowerExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <MultiplicativeExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <DivisiveExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <ModuloExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <AdditiveExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <SubtractiveExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <FloatLiteral, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <TrackSetLiteral, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <AssocArrayLiteral, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <IdentifierExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <LambdaExpr, Result>(visitee, ref result, c => visitor.Visit(c)) || TryVisitConcreteExpr <ModuleParamExpr, Result>(visitee, ref result, c => visitor.Visit(c)) ; if (!visited) { throw new Exception($"unknown Command type: {visitee.GetType()}"); } return(result); }
public IValue Execute(string code) { var parser = getParser(code); return(interpreter.Visit(parser.prog())); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); Value.Accept(visitor); _pipedInto.Accept(visitor); }
internal override void Accept(ExprVisitor visitor) { visitor.Visit(this); First.Accept(visitor); Next.Accept(visitor); }