Exemple #1
0
 public Clase(String idclase, String padre, Boolean hereda, CuerpoClase AST, Principal main, String Archivo)
 {
     this.idClase       = idclase;
     this.Padre         = padre;
     this.Hereda        = hereda;
     this.ArchivoOrigen = Archivo;
     this.AST           = AST;
     tieneMain          = false;
     if (main != null)
     {
         this.Main = main;
         tieneMain = true;
     }
 }
Exemple #2
0
        /*
         * EL METODO SIGUIENTE ME VA  A SERVIR PARA CONSTRUIR EL AST PERSONALIZADO Y DEVOLVERME UNA CLASE EN SI
         */
        public Clase obtenerClase()
        {
            ///ESTE SE ECARGA DE CONSTRUIR EL AST PARA EJECUTAR
            this.constructor            = new ASTTreeConstructor(this.cuerpoClase, id, archivoOringen);
            this.constructor.pordefecto = this.vibililidad;
            arbolClase = (CuerpoClase)constructor.ConstruyerAST();
            Principal p = constructor.main;//SETEO EL MAIN

            if (this.Hereda && !constructor.llamaASuper)
            {
                TError error = new TError("Semantico", "Clase: \"" + this.id + "\" hereda de: \"" + this.padre + "\" pero no se hace referencia a su constructor padre 'Super' | Clase: " + this.id + " | Archivo: " + this.archivoOringen, linea, col + 6, false);
                Estatico.errores.Add(error);
            }

            Clase clase = new Clase(this.id, this.padre, this.Hereda, arbolClase, p, this.archivoOringen);

            clase.visibilidad = this.vibililidad;
            return(clase);
        }