Class FortranParser

  • All Implemented Interfaces:
    Parser

    public final class FortranParser
    extends AbstractParser
    implements Parser
    A parser that extracts INCLUDE statements from a Reader.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Vector<java.lang.String> includes
      List of included filenames.
      private AbstractParserState newLineState
      State that starts consuming content at the beginning of a line.
    • Constructor Summary

      Constructors 
      Constructor Description
      FortranParser()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFilename​(java.lang.String include)
      Called by FilenameState at completion of file name production.
      java.lang.String[] getIncludes()
      Gets collection of include file names encountered in parse.
      AbstractParserState getNewLineState()
      Get the state for the beginning of a new line.
      void parse​(java.io.Reader reader)
      Collects all included files from the content of the reader.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • includes

        private final java.util.Vector<java.lang.String> includes
        List of included filenames.
      • newLineState

        private final AbstractParserState newLineState
        State that starts consuming content at the beginning of a line.
    • Constructor Detail

      • FortranParser

        public FortranParser()
        Default constructor.
    • Method Detail

      • addFilename

        public void addFilename​(java.lang.String include)
        Called by FilenameState at completion of file name production.
        Specified by:
        addFilename in class AbstractParser
        Parameters:
        include - include file name
      • getIncludes

        public java.lang.String[] getIncludes()
        Gets collection of include file names encountered in parse.
        Specified by:
        getIncludes in interface Parser
        Returns:
        include file names
      • parse

        public void parse​(java.io.Reader reader)
                   throws java.io.IOException
        Collects all included files from the content of the reader.
        Specified by:
        parse in interface Parser
        Overrides:
        parse in class AbstractParser
        Parameters:
        reader - character reader containing a FORTRAN source module
        Throws:
        java.io.IOException - throw if I/O error during parse