Examples of VN


Examples of Dependencies.PR1.Symbols.VN

            aux = br.readLine(); //Línea de VN.
            String fragmento_VN = aux.substring(6, aux.length() - 1);
            split = fragmento_VN.split(", ");
            for (String s : split) {
                listaVN.add(new VN(s));
            }

            //Tratamos VT.

            aux = br.readLine(); //Línea de VT.
            String linea_VT = aux.substring(6, aux.length() - 1);
            split = linea_VT.split(", ");
            for (String s : split) {
                listaVT.add(new VT(s));
            }

            //Tratamos P.

            aux = br.readLine(); //Línea de P.

            while ((aux = br.readLine()).compareTo("}") != 0) {
                if (!aux.startsWith("//") && aux.length() != 0) {
                    split = aux.split(" -> ");
                    VN antecedente = new VN(split[0]);
                    List<V> consecuentes = analizarConsecuentes(split[1], listaVN, listaVT);
                    producciones.add(new Production(antecedente, consecuentes));
                }
            }
View Full Code Here

Examples of Dependencies.PR1.Symbols.VN

            if (esTerminal(c, listaVN, listaVT)) {
                VT consecuente = new VT(c + "");
                toReturn.add(consecuente);
            }
            else {
                toReturn.add(new VN(c + ""));
            }
        }
        return toReturn;
    }
View Full Code Here

Examples of Dependencies.PR1.Symbols.VN

            aux = br.readLine(); //Línea de VN.
            String fragmento_VN = aux.substring(6, aux.length() - 1);
            split = fragmento_VN.split(", ");
            for (String s : split) {
                listaVN.add(new VN(s));
            }

            //Tratamos VT.

            aux = br.readLine(); //Línea de VT.
            String linea_VT = aux.substring(6, aux.length() - 1);
            split = linea_VT.split(", ");
            for (String s : split) {
                listaVT.add(new VT(s));
            }

            //Tratamos P.

            aux = br.readLine(); //Línea de P.

            while ((aux = br.readLine()).compareTo("}") != 0) {
                if (!aux.startsWith("//") && aux.length() != 0) {
                    split = aux.split(" ::= ");
                    VN antecedente = new VN(split[0]);
                    List<V> consecuentes = analizarConsecuentes(split[1], listaVN, listaVT);
                    producciones.add(new Production(antecedente, consecuentes));
                }
            }
View Full Code Here

Examples of Dependencies.PR1.Symbols.VN

        this.antecedente = antecedente;
        this.consecuente = consecuente;
    }

    public Production() {
        this.antecedente = new VN("");
        this.consecuente = new ArrayList<V>();
    }
View Full Code Here

Examples of Dependencies.PR1.Symbols.VN

    public List<V> clonarConsecuentes(List<V> consecuente) {
        List<V> toReturn = new ArrayList<V>();
        for (V cons : consecuente) {
            if (cons instanceof VN) {
                VN transf = (VN) cons;
                VN copia = transf.clone();
                toReturn.add(copia);
            }
            else {
                VT transf = (VT) cons;
                VT copia = transf.clone();
View Full Code Here

Examples of Dependencies.PR1.Symbols.VN

        //Inicialización de variables.

        listaVN = new ArrayList<VN>();
        listaVT = new ArrayList<VT>();
        producciones = new ArrayList<Production>();
        simbInicial = new VN();

        //Lectura de fichero.

        FileReader lF = new FileReader(path);
        lF.analizarFichero(listaVN, listaVT, producciones, simbInicial);
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.