Ejemplo n.º 1
0
        public ReferenceNode(LeafParser.ValueContext ctx)
        {
            if (ctx.Ref() == null)
            {
                throw new ArgumentException("Context does not define a reference value.");
            }

            Line  = ctx.Start.Line;
            Value = Create(ctx.value(0));
        }
Ejemplo n.º 2
0
        public FunctionCallNode(LeafParser.ValueContext ctx)
        {
            if (ctx.call == null)
            {
                throw new ArgumentException("Context does not define a function call.");
            }

            var values = ctx.value();

            Line   = ctx.Start.Line;
            LValue = Create(values[0]);

            var parameters = new ValueNode[values.Length - 1];

            for (var i = 0; i < parameters.Length; i++)
            {
                parameters[i] = Create(values[i + 1]);
            }

            Parameters = parameters;
        }
Ejemplo n.º 3
0
 public CastNode(LeafParser.ValueContext v, LeafParser.TypeContext t)
 {
     Line  = v.Start.Line;
     Value = Create(v);
     Type  = TypeNode.Create(t);
 }
Ejemplo n.º 4
0
 public static Value GetOp(LeafParser.ValueContext v0, LeafParser.ValueContext v1, Operator op,
                           in LocalCompilationContext ctx, in ValueRetrievalOptions options)
Ejemplo n.º 5
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="LeafParser.value"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitValue([NotNull] LeafParser.ValueContext context)
 {
     return(VisitChildren(context));
 }
Ejemplo n.º 6
0
 public OperationNode(Operator op, LeafParser.ValueContext v0, LeafParser.ValueContext v1)
 {
     Operator = op;
     Value0   = Create(v0);
     Value1   = Create(v1);
 }
Ejemplo n.º 7
0
 public static Value Get(LeafParser.ValueContext v, in LocalCompilationContext ctx, in ValueRetrievalOptions options = default)