Package edu.isi.pegasus.planner.parser
Class SiteCatalogTextScanner
- java.lang.Object
-
- edu.isi.pegasus.planner.parser.SiteCatalogTextScanner
-
class SiteCatalogTextScanner extends java.lang.ObjectImplements the scanner for reserved words and other tokens that are generated from the input stream. This class is module-local on purpose.- Author:
- Jens Vöckler
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.LineNumberReaderm_inStores the stream from which we are currently scanning.private intm_lookAheadCaptures the look-ahead character.
-
Constructor Summary
Constructors Constructor Description SiteCatalogTextScanner(java.io.Reader reader)Starts to scan the given stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetLineNumber()Obtains the current line number in the input stream from the outside.booleanhasMoreTokens()Checks for the availability of more input.TokennextToken()Obtains the next token from the input stream.private voidskipWhitespace()Skips any white space and comments in the input.
-
-
-
Method Detail
-
getLineNumber
public int getLineNumber()
Obtains the current line number in the input stream from the outside.- Returns:
- the current line number.
-
skipWhitespace
private void skipWhitespace() throws java.io.IOExceptionSkips any white space and comments in the input. This method stops either at the end of file, or at any non-whitespace input character.- Throws:
java.io.IOException
-
hasMoreTokens
public boolean hasMoreTokens() throws java.io.IOExceptionChecks for the availability of more input.- Returns:
- true, if there is more to read, false for EOF.
- Throws:
java.io.IOException
-
nextToken
public Token nextToken() throws java.io.IOException, ScannerException
Obtains the next token from the input stream.- Returns:
- an instance conforming to the token interface, or null for eof.
- Throws:
java.io.IOException- if something went wrong while readingjava.lang.Exception- if a lexical error was encountered.ScannerException
-
-