public LeftValueBase buildAccessThisMember(ASTool.Token matchtoken, CompileEnv env)
        {
            if (
                !(classMember.bindField is VariableBase)
                &&
                env.block.scope is ASBinCode.scopes.FunctionScope &&
                env.block.scope.parentScope is ASBinCode.scopes.ObjectInstanceScope
                &&
                ((ASBinCode.scopes.ObjectInstanceScope)env.block.scope.parentScope)._class == static_class._class
                )
            {
                return((LeftValueBase)classMember.bindField);
            }
            else
            {
                OpStep stepInitClass = new OpStep(OpCode.init_staticclass,
                                                  new SourceToken(matchtoken.line, matchtoken.ptr, matchtoken.sourceFile));
                stepInitClass.arg1 = new ASBinCode.rtData.RightValue(
                    new ASBinCode.rtData.rtInt(static_class._class.instanceClass.classid));
                stepInitClass.arg1Type = static_class._class.getRtType();
                env.block.opSteps.Add(stepInitClass);

                var _buildin_  = static_class;
                var eax_member = env.getAdditionalRegister();
                eax_member.setEAXTypeWhenCompile(classMember.valueType);

                eax_member._regMember       = classMember;
                eax_member._regMemberSrcObj = _buildin_;

                AccessBuilder.make_dotStep(env, classMember, matchtoken, eax_member, _buildin_);

                return(eax_member);
            }
        }
Beispiel #2
0
        public void Main()
        {
            Director director = new Director();

            Console.WriteLine("Cadena de conexión del SQL Server");
            SQLServerBuilder CadenaBuilder = new SQLServerBuilder();

            director.CrearConexion(CadenaBuilder);
            SQLServer sQLServer = CadenaBuilder.GetResult();

            sQLServer.Imprimir();

            Console.WriteLine("\nCadena de conexión del MySQL ");
            MySQLBuilder CadenaMySQLBuilder = new MySQLBuilder();

            director.CrearConexion(CadenaMySQLBuilder);
            MySQL mySQL = CadenaMySQLBuilder.GetResult();

            mySQL.Imprimir();

            Console.WriteLine("\n Cadena de conexión del Access");

            AccessBuilder CadenaAccessBuilder = new AccessBuilder();

            director.CrearConexion(CadenaAccessBuilder);
            Access Access = CadenaAccessBuilder.GetResult();

            Access.Imprimir();

            Console.ReadLine();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var director = new Director();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("********************************************");
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("Elige la cadena que desea generar: ");
            Console.WriteLine("1 - Access");
            Console.WriteLine("2 - MySQL");
            Console.WriteLine("3 - SQL");
            Console.ResetColor();
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("********************************************");
            Console.ResetColor();
            int iTipoCadena = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Crear Conexión:");
            switch (iTipoCadena)
            {
            case 1:
                AccessBuilder accessBuilder = new AccessBuilder();
                director.Builder = accessBuilder;
                director.AccessConection();
                Console.WriteLine(accessBuilder.GetResult().ConnectionString());
                break;

            case 2:
                MySQLBuilder mySQLBuilder = new MySQLBuilder();
                director.Builder = mySQLBuilder;
                director.MySQLConection();
                Console.WriteLine(mySQLBuilder.GetResult().ConnectionString());
                break;

            case 3:
                SQLBuilder sqlBuilder = new SQLBuilder();
                director.Builder = sqlBuilder;
                director.SQLConection();
                Console.WriteLine(sqlBuilder.GetResult().ConnectionString());
                break;
            }

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("\r\nPresione una tecla para salir.");
            Console.ReadKey();
        }