@@ -0,0 +1,1530 @@
+#!/usr/bin/env python%0A%22%22%22%0ACopyright 2015 Scott Wales%0A%0Aauthor: Scott Wales %3Cscott.wales@unimelb.edu.au%3E%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A%22%22%22%0A%0Afrom Fortran03Lexer  import Fortran03Lexer%0Afrom Fortran03Parser import Fortran03Parser%0A%0Afrom antlr4 import CommonTokenStream%0Afrom antlr4.InputStream import InputStream%0Afrom antlr4.FileStream import FileStream%0A%0Aclass Parser(object):%0A    %22%22%22%0A    Manages parsing using an antlr4-based parser%0A    %22%22%22%0A%0A    def parse_file(self, filename):%0A        %22%22%22%0A        filename: A string with the file name to parse%0A        %22%22%22%0A        self.stream = InputStream(string)%0A        self._common_setup()%0A        return self%0A%0A    def parse_string(self, string):%0A        %22%22%22%0A        string: A string containing Fortran code to parse%0A        %22%22%22%0A        self.stream = InputStream(string)%0A        self._common_setup()%0A        return self%0A%0A    def _common_setup(self):%0A        self.lexer  = Fortran03Lexer(self.stream)%0A        self.tokens = CommonTokenStream(self.lexer)%0A        self.tree   = Fortran03Parser(self.tokens)%0A

Add parser file