Package edu.isi.pegasus.planner.parser
Class SiteCatalogTextParser
- java.lang.Object
-
- edu.isi.pegasus.planner.parser.SiteCatalogTextParser
-
public class SiteCatalogTextParser extends java.lang.ObjectParses the input stream and generates site configuration map as output.- Version:
- $Revision$
- Author:
- Jens Vöckler, Gaurang Mehta, Karan Vahi
- See Also:
org.griphyn.cPlanner.classes.SiteCatalogTextScanner,org.griphyn.cPlanner.classes.Token
-
-
Field Summary
Fields Modifier and Type Field Description private LogManagerm_loggerThe handle to the logger used to log messages.private Tokenm_lookAheadStores the look-ahead symbol.private SiteCatalogTextScannerm_scannerThe access to the lexical scanner is stored here.
-
Constructor Summary
Constructors Constructor Description SiteCatalogTextParser(java.io.Reader r)Initializes the parser with an input stream to read from.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetSiteHandle()Returns the site handle for a site, and moves the scanner to hold the nextSiteCatalogReservedWord.java.lang.StringniceString(java.lang.String input)Remove potential leading and trainling quotes from a string.PoolConfigparse()Parses the complete input stream, into the PoolConfig data object that holds the contents of all the sites referred to in the stream.private voidpopulate(SiteInfo site)Populates all the attributes except the handle, associated with the site in theSiteInfoobject.
-
-
-
Field Detail
-
m_scanner
private SiteCatalogTextScanner m_scanner
The access to the lexical scanner is stored here.
-
m_lookAhead
private Token m_lookAhead
Stores the look-ahead symbol.
-
m_logger
private LogManager m_logger
The handle to the logger used to log messages.
-
-
Constructor Detail
-
SiteCatalogTextParser
public SiteCatalogTextParser(java.io.Reader r) throws java.io.IOException, ScannerExceptionInitializes the parser with an input stream to read from.- Parameters:
r- is the stream opened for reading.- Throws:
java.io.IOExceptionScannerException
-
-
Method Detail
-
parse
public PoolConfig parse() throws java.io.IOException, ScannerException, java.lang.Exception
Parses the complete input stream, into the PoolConfig data object that holds the contents of all the sites referred to in the stream.- Returns:
- a map indexed by the site handle strings.
- Throws:
java.io.IOExceptionScannerExceptionjava.lang.Exception- See Also:
org.griphyn.cPlanner.classes.PoolConfig
-
niceString
public java.lang.String niceString(java.lang.String input)
Remove potential leading and trainling quotes from a string.- Parameters:
input- is a string which may have leading and trailing quotes- Returns:
- a string that is either identical to the input, or a substring thereof.
-
populate
private void populate(SiteInfo site) throws java.io.IOException, ScannerException, java.lang.Exception
Populates all the attributes except the handle, associated with the site in theSiteInfoobject.- Parameters:
site- theSiteInfoobject that is to be populated.- Throws:
even- more mysteryjava.io.IOExceptionScannerExceptionjava.lang.Exception
-
getSiteHandle
private java.lang.String getSiteHandle() throws java.io.IOException, ScannerExceptionReturns the site handle for a site, and moves the scanner to hold the nextSiteCatalogReservedWord.- Returns:
- the site handle for a site, usually the name of the site.
- Throws:
plentyjava.io.IOExceptionScannerException
-
-