Package net.sourceforge.chaperon.process

Examples of net.sourceforge.chaperon.process.ParserProcessor


    // Build a automaton from the grammar model
    ParserAutomaton parserautomaton =
      (new ParserAutomatonBuilder(grammar, log)).getParserAutomaton();

    // Create a processor for the grammar
    ParserProcessor parser = new ParserProcessor();
    parser.setLog(log);
    parser.setParserAutomaton(parserautomaton);

    // Create factory for SAX transformer
    SAXTransformerFactory transformerFactoryImpl =
      (SAXTransformerFactory)SAXTransformerFactory.newInstance();

    // Create serializer to write the SAX stream into a file
    TransformerHandler serializer = transformerFactoryImpl.newTransformerHandler();
    serializer.setResult(new StreamResult(outFile));

    // Connect components into a pipeline
    lexer.setContentHandler(parser);
    parser.setContentHandler(serializer);

    // Push text into this pipeline
    // Create locator, which help to find possible syntax errors
    LocatorImpl locator = new LocatorImpl();
    locator.setSystemId(inFile.toURL().toString());
View Full Code Here


                                 this.grammarSource.getURI()+"'");
                this.automaton = entry.getParserAutomaton();
            }

            if (getParserProcessor()==null) {
                ParserProcessor processor = new ParserProcessor();

                processor.setParserHandler(this.adapter);
                processor.setLogger(this.logger);
                processor.setRecovery(recovery);
                setParserProcessor(processor);
            }

            getParserProcessor().setParserAutomaton(this.automaton);
View Full Code Here

                                 this.grammarSource.getURI()+"'");
                this.automaton = entry.getParserAutomaton();
            }

            if (getParserProcessor()==null) {
                ParserProcessor processor = new ParserProcessor();

                processor.setParserHandler(this.adapter);
                processor.setLogger(this.logger);
                processor.setRecovery(recovery);
                setParserProcessor(processor);
            }

            getParserProcessor().setParserAutomaton(this.automaton);
View Full Code Here

                                 this.grammarSource.getURI()+"'");
                this.automaton = entry.getParserAutomaton();
            }

            if (getParserProcessor()==null) {
                ParserProcessor processor = new ParserProcessor();

                processor.setParserHandler(this.adapter);
                processor.setLogger(this.logger);
                processor.setRecovery(recovery);
                setParserProcessor(processor);
            }

            getParserProcessor().setParserAutomaton(this.automaton);
View Full Code Here

TOP

Related Classes of net.sourceforge.chaperon.process.ParserProcessor

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.