public override object VisitPrint(FaParser.PrintContext context) { object toPrint = Visit(context.expression()); if (toPrint is bool) { // Console.WriteLine((bool)toPrint?"verdadero":"falso"); // Debug.Log( ((bool)toPrint)?"verdadero":"falso"); MyConsole.main.AppendText("" + (((bool)toPrint)?"verdadero":"falso")); } else { // Console.WriteLine(toPrint); // Debug.Log( toPrint); MyConsole.main.AppendText("" + toPrint); } return(null); }
/// <summary> /// Visit a parse tree produced by <see cref="FaParser.print"/>. /// <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 VisitPrint([NotNull] FaParser.PrintContext context) { return(VisitChildren(context)); }