Package com.asakusafw.runtime.directio

Examples of com.asakusafw.runtime.directio.FilePattern$Token


    }

    void irSiguienteLinea() {
        boolean encontrado = false;
        while ((this.listaTokens.size() > posicion) && !encontrado) {
            if ((this.listaTokens.get(posicion).equals(new Token("TK_FIN_SENT", "$")))) {
                encontrado = true;
                leerSiguienteToken();
                break;
            }
            else {
                posicion++;
            }
        }
        if (!encontrado) {
            tokenActual = new Token("TK_SALIDA", finFichero);
        }
    }
View Full Code Here


            if (posicion != listaTokens.size() - 1) {
                leerSiguienteToken();
                return;
            }
            else {
                tokenActual = new Token("TK_SALIDA", finFichero);
                return;
            }
        }
        throw new InterpreterException("Esperaba " + "'" + devolverErrorMatch(v.getV().substring(3)) + "'" + ", encontrado " + "'" + devolverErrorMatch((String)tokenActual.getContenido()) + "'.");
    }
View Full Code Here

                    estado = 0;
                    break;
                }
            }//END switch.
        }//END while.
        listaTokens.add(new Token("TK_SALIDA", "$EOF$")); //Añado el fin de fichero
        for(Token tt: listaTokens){
            System.out.println(tt);
        }
        return listaTokens;
    }
View Full Code Here

    private void RetrocesoPuntero() {
        puntero--;
    }

    private Token DaToken(String lexema, String contenido) {
        Token t = new Token(lexema, contenido);
        listaTokens.add(t);
        return t;
    }
View Full Code Here

        listaTokens.add(t);
        return t;
    }

    private Token DaToken(String lexema, int valor) {
        Token t = new Token(lexema, valor);
        listaTokens.add(t);
        return t;
    }
View Full Code Here

     *
     * @param lexema
     * @return true si es palabra reservada, false si es un identificador
     */
    private void DiferPRId(String lexema) {
        listaTokens.add(palabrasReservadas.contains(lexema) ? new Token("TK_" + DaLexema().toUpperCase(), lexema) : new Token("TK_ID", lexema));
    }
View Full Code Here

            if (posicion != listaTokens.size() - 1) {
                leerSiguienteToken();
                return;
            }
            else {
                tokenActual = new Token("TK_SALIDA", "$#$");
                return;
            }
        }
        throw new SyntaxException ("Línea " + nLinea + ": Esperaba " + "'" + devolverErrorMatch(v.getV().substring(3)) + "'" + ", encontrado " + "'"
                + (!tokenActual.contenidosIguales("TK_FIN_SENT")? tokenActual.getContenido() : File.separator + "r" + File.separator + "n") + "'.");
View Full Code Here

    }

    private boolean checkBasePath(Class<?> theClass, String basePath, String name) {
        boolean valid = true;
        try {
            FilePattern pattern = FilePattern.compile(basePath);
            if (pattern.containsTraverse()) {
                getEnvironment().error(
                        "{0}にワイルドカード (**) を利用できません: {1}",
                        name,
                        theClass.getName());
                valid = false;
            }
            Set<PatternElementKind> kinds = pattern.getPatternElementKinds();
            for (PatternElementKind kind : kinds) {
                if (INVALID_BASE_PATH_KIND.contains(kind)) {
                    getEnvironment().error(
                            "{0}に \"{1}\" を利用できません: {2}",
                            name,
View Full Code Here

        }
        DataFormat<T> format = createFormat(dataType, description.getFormat());
        final DataDefinition<T> definition = SimpleDataDefinition.newInstance(dataType, format);
        final Counter counter = new Counter();
        try {
            FilePattern pattern = toInputPattern(description.getResourcePattern());
            LOG.info("Opening {}/{} for output (id={}, description={})", new Object[] {
                    fullPath,
                    pattern,
                    id,
                    description.getClass().getName(),
View Full Code Here

    }

    private String toOutputName(String inputResourcePattern) throws IOException {
        assert inputResourcePattern != null;
        String patternString = resolve(inputResourcePattern);
        FilePattern pattern = FilePattern.compile(patternString);
        if (pattern.containsVariables()) {
            throw new IOException(MessageFormat.format(
                    "Input resource pattern contains variables (original=[{0}], expanded=[{1}])",
                    inputResourcePattern,
                    patternString));
        }
        StringBuilder buf = new StringBuilder();
        for (Segment segment : pattern.getSegments()) {
            if (buf.length() != 0) {
                buf.append('/');
            }
            if (segment.isTraverse()) {
                buf.append(WILDCARD_REPLACEMENT);
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.directio.FilePattern$Token

Copyright © 2018 www.massapicom. 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.