Class GrammarImporter


  • public class GrammarImporter
    extends java.lang.Object
    The grammar importer reads an exported grammar and reconstructs a ParserGrammar from it.
    • Constructor Detail

      • GrammarImporter

        public GrammarImporter()
    • Method Detail

      • importGrammar

        public ParserGrammar importGrammar​(ParserOptions options,
                                           java.lang.String filename)
                                    throws java.io.IOException
        Import a grammar.
        Parameters:
        options - The parser options.
        filename - The name of a file containing an exported grammar.
        Returns:
        The grammar.
        Throws:
        java.io.IOException - if the file cannot be read
      • importGrammar

        public ParserGrammar importGrammar​(ParserOptions options,
                                           java.io.InputStream stream)
                                    throws java.io.IOException
        Import a grammar.
        Parameters:
        options - The parser options.
        stream - An input stream to read the exported grammar.
        Returns:
        The grammar.
        Throws:
        java.io.IOException - if the file cannot be read