Ejemplo n.º 1
0
    public override object VisitExpressionContentID(FaParser.ExpressionContentIDContext context)
    {
        string id  = context.ID().GetText();
        object var = ExistInLast(id);

        if (var is MyVariable)
        {
            return(((MyVariable)var).value);
        }
        if (var is MyArray)
        {
            return(((MyArray)var).ToString());
        }
        Debug.LogError("No se ha declarado esta variable o arreglo(id)");
        // Console.WriteLine("No se ha declarado esta variable o arreglo(id)");
        MyConsole.main.AppendText("No se ha declarado esta variable o arreglo(id)");
        return(null);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>expressionContentID</c>
 /// labeled alternative in <see cref="FaParser.expressionContent"/>.
 /// <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 VisitExpressionContentID([NotNull] FaParser.ExpressionContentIDContext context)
 {
     return(VisitChildren(context));
 }