@startuml
title Diagramme de classe Zoot1

Abstract ArbreAbstrait {
    int noLigne
    void verifier()
    String toMIPS()
}

package instructions #7700AA {

    Class Retourne #DD00DD {
        void verifier()
        String toMIPS()
    }

    Class Ecrire #DD00DD {
        Ecrire(Expression e, int n)
        void verifier()
        String toMIPS()
    }

    Class Affectation #DD00DD {
        Affectation(int n, Idf i, Expression e)
        void verifier()
        String toMIPS()
    }

    Abstract Instruction #DD00DD {}

    Ecrire -|> Instruction
    Affectation -|> Instruction
    Retourne -|> Instruction
}

package expressions #22BB99 {
    Abstract Expression #44FFAA {
        Expression(int n)
        String getType()
        String getNom()
        boolean isConstante()
        boolean isFonc()
    }

    Abstract Constante #44FFAA {
        String cste
        Constante(String texte, int n)
        void verifier()
    }

    Class ConstanteEntiere #44FFAA {
        ConstanteEntiere(String texte, int n)
        String toMIPS()
        String getType()
    }

    Class ConstanteBooleenne #44FFAA {
        ConstanteBooleenne(String val, int n)
        String toMIPS()
        String getType()
    }

    Class Idf #44FFAA {
        Idf(Entree entree, int n)
        String toMIPS()
        void verifier()
        String getType()
        boolean isConstante()
    }

    Class AppelFonc #44FFAA {
        AppelFonc(EntreeFonction entree, int n)
        String toMIPS()
        void verifier()
        String getType()
        boolean isFonc()
    }

    Idf -|> Expression
    Constante -|> Expression
    AppelFonc -|> Expression
    ConstanteEntiere -|> Constante
    ConstanteBooleenne -|> Constante
}

package declaration #FFAA55 {
    Abstract Entree #FFCC00 {
        String nom
        int noLigne
        Entree(String nom, int ligne)
        String getNom()
        int getNoLigne()
    }

    Class EntreeVariable #FFCC00 {
        EntreeVariable(String nom, int ligne)
    }

    Class EntreeFonction #FFCC00 {
        int nbParam
        String type
        EntreeFonction(String nom, int nbParam, int ligne)
        int getNbParam()
    }

    Class Fonction #FFCC00 {
        String nom
        String label
        int bloc
        Fonction(String idf, ArbreAbstrait inst, int b, int n)
        void verifier()
        String toMIPS()
    }

    Class LFCT #FFCC00 {
        boolean debut
        LFCT()
        void addFonction(Fonction f)
        Symbole identifier(Entree e)
        void stockerParams(Entree entree , Symbole sym)
        HashMap<Entree, Symbole> destockParams()
        void stockerParamsApl(Expression exp)
        ArrayList<Expression> destockParamsApl()
    }

    LFCT -- "*" Fonction
    LFCT -- "1" LFCT : "instance"
    EntreeFonction -|> Entree
    EntreeVariable -|> Entree
}

Class Symbole {
    int decalage
    String type

    int getDecalage()
    void setDecalage()
    String getType()
    void setType()
}

Class SymboleFct {
    int nbParams
    SymboleFct(String type)
}

Class TDS {
    TDS instance
    HashMap<Entree, Symbole> table

    static TDS getInstance()
    void ajouter(Entree e, Symbole s)
    Symbole identifier(Entree e)
    int getTailleVariable()
    void  entréebloc()
    void sortieBloc()
}

Class BlocDInstructions {
    ArrayList<ArbreAbstrait> programme
    void ajouter(ArbreAbstrait i)
    void verifier()
    String toMIPS()
    String toString()
}

Idf -- "1" Entree

Instruction --|> ArbreAbstrait
BlocDInstructions --|> ArbreAbstrait

Fonction -- "1" ArbreAbstrait

Affectation -- "1" Expression
Affectation -- "1" Idf
Ecrire -- "1" Expression

Idf -- "1" Entree
Idf -- "1" Symbole

AppelFonc -- "1" EntreeFonction




@enduml