Package org.codehaus.mojo.natives.parser
Class FortranParser
- java.lang.Object
-
- org.codehaus.mojo.natives.parser.AbstractParser
-
- org.codehaus.mojo.natives.parser.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>includesList of included filenames.private AbstractParserStatenewLineStateState 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 voidaddFilename(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.AbstractParserStategetNewLineState()Get the state for the beginning of a new line.voidparse(java.io.Reader reader)Collects all included files from the content of the reader.
-
-
-
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.
-
-
Method Detail
-
addFilename
public void addFilename(java.lang.String include)
Called by FilenameState at completion of file name production.- Specified by:
addFilenamein classAbstractParser- Parameters:
include- include file name
-
getIncludes
public java.lang.String[] getIncludes()
Gets collection of include file names encountered in parse.- Specified by:
getIncludesin interfaceParser- Returns:
- include file names
-
getNewLineState
public AbstractParserState getNewLineState()
Get the state for the beginning of a new line.- Specified by:
getNewLineStatein classAbstractParser- Returns:
- start of line state
-
parse
public void parse(java.io.Reader reader) throws java.io.IOExceptionCollects all included files from the content of the reader.- Specified by:
parsein interfaceParser- Overrides:
parsein classAbstractParser- Parameters:
reader- character reader containing a FORTRAN source module- Throws:
java.io.IOException- throw if I/O error during parse
-
-