public override GamaValueRef VisitExprAddressOf([NotNull] GamaParser.ExprAddressOfContext context) { /* Trick to getting the address of a value is to disable variable loading */ /* Function pointers are ignored since function are not first class types */ /* Loading them won't work, they are not really contant sized */ PushLoad(false); var val = Visit(context.expr()); if (val == null) { return(null); } val = new GamaValueRef(new GamaPointer(val.Type), val.Value, false); PopLoad(); return(val); }
/// <summary> /// Visit a parse tree produced by the <c>ExprAddressOf</c> /// labeled alternative in <see cref="GamaParser.expr"/>. /// <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 VisitExprAddressOf([NotNull] GamaParser.ExprAddressOfContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by the <c>ExprAddressOf</c> /// labeled alternative in <see cref="GamaParser.expr"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitExprAddressOf([NotNull] GamaParser.ExprAddressOfContext context) { }