Package com.facebook.swift.parser.antlr

Examples of com.facebook.swift.parser.antlr.ThriftParser


    static Tree parseTree(InputSupplier<? extends Reader> input)
            throws IOException
    {
        try (Reader reader = input.getInput()) {
            ThriftLexer lexer = new ThriftLexer(new ANTLRReaderStream(reader));
            ThriftParser parser = new ThriftParser(new CommonTokenStream(lexer));
            try {
                Tree tree = (Tree) parser.document().getTree();
                if (parser.getNumberOfSyntaxErrors() > 0) {
                    throw new IllegalArgumentException("syntax error");
                }
                return tree;
            }
            catch (RecognitionException e) {
View Full Code Here

TOP

Related Classes of com.facebook.swift.parser.antlr.ThriftParser

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.