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)); }
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; }
public CastNode(LeafParser.ValueContext v, LeafParser.TypeContext t) { Line = v.Start.Line; Value = Create(v); Type = TypeNode.Create(t); }
public static Value GetOp(LeafParser.ValueContext v0, LeafParser.ValueContext v1, Operator op, in LocalCompilationContext ctx, in ValueRetrievalOptions options)
/// <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)); }
public OperationNode(Operator op, LeafParser.ValueContext v0, LeafParser.ValueContext v1) { Operator = op; Value0 = Create(v0); Value1 = Create(v1); }
public static Value Get(LeafParser.ValueContext v, in LocalCompilationContext ctx, in ValueRetrievalOptions options = default)