Exemple #1
0
        public override String VisitExeCommandQueryCreate([NotNull] NewGrammarParser.ExeCommandQueryCreateContext context)
        {//moze tu byt dane meno atributu pri vytvarani objektu ? potom asi treba tiez pozerat ci to meno je atribut dat self.afssd
         //mame
         //mozno by sme chceli doplnit do gramatiky aj parametre pre inicializaciu atributov

            if (context.GetChild(1).GetType().Name.Equals("InstanceHandleContext"))
            {
                String instanceName = Visit(context.GetChild(1));

                /*if (this.attributesList.Contains(instanceName))
                 * {
                 *  instanceName = "self." + instanceName;
                 * }*/

                return(instanceName + "=" + context.GetChild(3).GetText() + "()");
            }
            else if (context.GetChild(1).GetType().Name.Equals("KeyLetterContext"))
            {
                return(context.GetChild(1).GetText() + "()");
            }

            return(null);
            //return base.VisitQueryCreateClass(context);
        }
 /// <summary>
 /// Exit a parse tree produced by <see cref="NewGrammarParser.exeCommandQueryCreate"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitExeCommandQueryCreate([NotNull] NewGrammarParser.ExeCommandQueryCreateContext context)
 {
 }
 /// <summary>
 /// Visit a parse tree produced by <see cref="NewGrammarParser.exeCommandQueryCreate"/>.
 /// <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 VisitExeCommandQueryCreate([NotNull] NewGrammarParser.ExeCommandQueryCreateContext context)
 {
     return(VisitChildren(context));
 }