Package com.pogofish.jadt.ast

Examples of com.pogofish.jadt.ast.ParseResult


    /**
     * Test that when given an IOException occurs it is handled properly
     */
    @Test
    public void testIOException() {
        final ParseResult testResult = new ParseResult(new Doc("some source", EMPTY_PKG, NO_IMPORTS,Collections.<DataType>emptyList()), Util.<SyntaxError>list());

        final Parser parser = new DummyParser(testResult, "some source", "some string");
        try {
            final ParseResult resultDoc = parser.parse(new Source() {

                @Override
                public BufferedReader createReader() {
                    return new BufferedReader(new Reader() {

View Full Code Here


    
        final List<? extends Source> sources = sourceFactory.createSources(srcPath);
        for (Source source : sources) {
            final List<UserError> errors = new ArrayList<UserError>();
                
            final ParseResult result = parser.parse(source);
            for (SyntaxError error : result.errors) {
                errors.add(UserError._Syntactic(error));
            }              
            final List<SemanticError> semanticErrors = checker.check(result.doc);
            for (SemanticError error : semanticErrors) {
View Full Code Here

     * Useful for testing
     */
    public static JADT createDummyJADT(List<SyntaxError> syntaxErrors, List<SemanticError> semanticErrors, String testSrcInfo, SinkFactoryFactory factory) {
        final SourceFactory sourceFactory = new StringSourceFactory(TEST_STRING);
        final Doc doc = new Doc(TEST_SRC_INFO, Pkg._Pkg(NO_COMMENTS, "pkg"), Util.<Imprt> list(), Util.<DataType> list());
        final ParseResult parseResult = new ParseResult(doc, syntaxErrors);
        final DocEmitter docEmitter = new DummyDocEmitter(doc,  TEST_CLASS_NAME);
        final Parser parser = new DummyParser(parseResult, testSrcInfo, TEST_STRING);
        final Checker checker = new DummyChecker(semanticErrors);
        final JADT jadt = new JADT(sourceFactory, parser, checker, docEmitter, factory);
        return jadt;
View Full Code Here

                final BufferedReader reader = source.createReader();
                try {
                    final ParserImpl impl = factory.create(source.getSrcInfo(),
                            reader);
                    final Doc doc = impl.doc();
                    return new ParseResult(doc, impl.errors());
                } finally {
                    reader.close();
                }
            }
        });
View Full Code Here

TOP

Related Classes of com.pogofish.jadt.ast.ParseResult

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.