Examples of ZInfo


Examples of fmg.fmg8.endlAutomat.ZInfo

        ArrayList<Integer> knot1;
        Iterator<Integer> it, it1;
        Iterator<Transition> it3;
        Integer aktKnNum;
        Knoten aktKn;
        ZInfo info;
        Knoten zielKn;
        Integer zielKnNum;
        Condition aktBed;
        Condition neuBed = null;
        Condition zwischBed;
        int numOrig1, numOrig2;
        int idlBefehl;
        EndlicherAutomat[] eas = new EndlicherAutomat[endAuts.length];
        LinkedList<Transition> trans;
        Transition tran;
        String[] args = {"log 4"};
       
        if (endAuts == null
                || conds == null
                || endAuts.length != conds.length
                || endAuts.length == 0) {
            SonstMeth.log(SonstMeth.LOG_ERROR,
                          "Gesamtautomat konnte nicht erzeugt werden.",
                          new Parametersatz(args));
        }
       
        for (int i = 0; i < eas.length; i++) {
            eas[i] = new EndlicherAutomat();
            eas[i].erzeugeAusSequenz(
                    endAuts[i].erzeugeStringSeq(),
                    fmg.fmg8.endlAutomat.translator.Konstanten.STD_TRANSL_BE,
                    false);
           
            if (eas[i].istLeer()) {
                eas[i].einfuegenKnoten(Integer.MAX_VALUE,
                        SonstMeth.posSuch(
                                fmg.fmg8.umgebung2D.Konstanten.BEF,
                                "stp"),
                        1,
                        1);
               
                eas[i].setStart(eas[i].holeKnoten(Integer.MAX_VALUE));
            }
        }
       
        // Neue Knoten zuordnen.
        for (int i = 0; i < eas.length; i++) {
            knotZuord[i] = new HashMap<Integer, Integer>();
           
            knot = new ArrayList<Integer>(eas[i].holAdj().keySet());
            it = knot.iterator();

            while (it.hasNext()) {
                aktKnNum = it.next();
                aktKn = eas[i].holeKnoten(aktKnNum);
                info = aktKn.getInfo();
                neu.einfuegenKnoten(lfdNr,
                                    info.getAktion(),
                                    info.getParam(),
                                    info.getAlter());
               
                knotZuord[i].put(aktKnNum, lfdNr);
                lfdNr++;
            }
        }
View Full Code Here

Examples of fmg.fmg8.endlAutomat.ZInfo

     *          aktuellen Zustand keine Scriptinstruktion decodiert wurde.
     */
    private String naechsterZustand() {
        String inst = "";
        Knoten aktZust = this.holeKnoten(this.aktZustand);
        ZInfo info;
        LinkedList<Transition> bedingungen;
        int aktion;
        int par, parStand;
        int zusatz, zusatzStand;
        int regNumZiel;
        int regNumQuelle;
        int scrAktion;
        int k;
       
        if (this.boc || this.eoc) {
            return null;
        }
       
        if (aktZust == null) {
            aktZust = this.holeStartzustand();
           
            if (aktZust == null) {
                return null;
            }
           
            this.aktZustand = aktZust.holeName();
        }
       
        info = aktZust.getInfo();
       
        aktion = info.getAktion();
       
        // Aktion ermitteln und zusammenstellen.
        if (aktion == Konstanten.AUT_ADD_EDGE
                || aktion == Konstanten.AUT_ADD_NODE
                || aktion == Konstanten.AUT_CHANGE_ACT
                || aktion == Konstanten.AUT_CHANGE_AGE
                || aktion == Konstanten.AUT_CHANGE_PAR
                || aktion == Konstanten.AUT_EXTEND_COND_H
                || aktion == Konstanten.AUT_EXTEND_COND_C
                || aktion == Konstanten.AUT_EXTEND_COND_O) {
            // Topologische Aktionen:
           
            if (aktion == Konstanten.AUT_EXTEND_COND_H) {
                k = 255;
            } else if (aktion == Konstanten.AUT_EXTEND_COND_O) {
                k = Konstanten.autTOscript(
                        this.getH(info.getParam()))
                        - this.getH(info.getParam());
            } else {
                k = 0;
            }
           
            parStand = info.getParam();
            parStand = SonstMeth.modZwischen(
                    parStand,
                    SonstMeth.minVar(SonstMeth.MODUS_TRANSLATOR),
                    SonstMeth.maxVar(SonstMeth.MODUS_TRANSLATOR));
           
            scrAktion = Konstanten.scrBefNum(aktion);
            inst += scrAktion;
            inst += "," + (this.getH(parStand) + k);
           
            if (Const.BEF_PAR[scrAktion] == 2) {
                zusatzStand = info.getAlter();
                zusatzStand = SonstMeth.modZwischen(
                        zusatzStand,
                        SonstMeth.minVar(SonstMeth.MODUS_TRANSLATOR),
                        SonstMeth.maxVar(SonstMeth.MODUS_TRANSLATOR));

                inst += "," + this.getH(zusatzStand);

                // Speichere automatisch den Zusatzparameter in Reg2 (= H102).
                if (aktion != Konstanten.AUT_EXTEND_COND_C
                        && aktion != Konstanten.AUT_EXTEND_COND_H
                        && aktion != Konstanten.AUT_EXTEND_COND_O) {
                    this.setH(
                            Konstanten.SENS_REG_MIN + 1,
                            this.getH(zusatzStand));
                }
            }
           
            // Speichere automatisch den Parameter in Reg1 (= H101).
            if (aktion != Konstanten.AUT_EXTEND_COND_C
                    && aktion != Konstanten.AUT_EXTEND_COND_H
                    && aktion != Konstanten.AUT_EXTEND_COND_O) {
                this.setH(Konstanten.SENS_REG_MIN, this.getH(parStand));
            }
        } else if (aktion == Konstanten.AUT_REG_CONST) {
            // Register-Aktion (Konstante setzen):
           
            par = info.getParam();
            zusatz = info.getAlter();
            regNumZiel = SonstMeth.modZwischen(
                    par,
                    SonstMeth.minVar(SonstMeth.MODUS_TRANSLATOR),
                    SonstMeth.maxVar(SonstMeth.MODUS_TRANSLATOR));
            this.setH(regNumZiel, zusatz);
        } else if (aktion == Konstanten.AUT_REG_VAR) {
            // Register-Aktion (anderes Register kopieren):

            par = info.getParam();
            zusatz = info.getAlter();
            regNumQuelle = SonstMeth.modZwischen(
                    par,
                    SonstMeth.minVar(SonstMeth.MODUS_TRANSLATOR),
                    SonstMeth.maxVar(SonstMeth.MODUS_TRANSLATOR));
            regNumZiel = SonstMeth.modZwischen(
                    zusatz,
                    SonstMeth.minVar(SonstMeth.MODUS_TRANSLATOR),
                    SonstMeth.maxVar(SonstMeth.MODUS_TRANSLATOR));
           
            this.setH(regNumZiel, this.getH(regNumQuelle));
        }
       
        /*
         * IDLE-Aktion (NXT): Bedeutet, dass nur der Code-Zeiger verschoben
         * wird; wird nicht explizit behandelt.
         */

        SonstMeth.log(
                SonstMeth.LOG_STAGE1,
                "Translator: Zustand "
                    + this.aktZustand
                    + ", Token "
                    + this.getAktToken()
                    + " / "
                    + this.getLookAheadToken()
                    + ": "
                    + new Script(inst),
                this.pars);
       
        // Folgezustand festlegen, Code-Zeiger verschieben.
        bedingungen = info.getBeds();
        this.aktZustand = -1;
        for (Transition aktBed : bedingungen) {
            if (aktBed.evaluiere(this)) {
                this.aktZustand = aktBed.getFolgezustand();
                break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.