Package org.python.antlr

Examples of org.python.antlr.NoCloseReaderStream


                                CompilerFlags cflags) throws Throwable {
        reader.mark(MARK_LIMIT); // We need the ability to move back on the
                                 // reader, for the benefit of fixParseError and
                                 // validPartialSentence
        if (kind != null) {
            CharStream cs = new NoCloseReaderStream(reader);
            BaseParser parser = new BaseParser(cs, filename, cflags.encoding);
            return kind.dispatch(parser);
        } else {
            throw Py.ValueError("parse kind must be eval, exec, or single");
        }
View Full Code Here


    private static boolean validPartialSentence(BufferedReader bufreader, CompileMode kind, String filename) {
        PythonPartialLexer lexer = null;
        try {
            bufreader.reset();
            CharStream cs = new NoCloseReaderStream(bufreader);
            lexer = new PythonPartialLexer(cs);
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            PythonTokenSource indentedSource = new PythonTokenSource(tokens, filename);
            tokens = new CommonTokenStream(indentedSource);
            PythonPartialParser parser = new PythonPartialParser(tokens);
View Full Code Here

TOP

Related Classes of org.python.antlr.NoCloseReaderStream

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.