All Packages Class Hierarchy This Package Previous Next Index
Class att.grappa.Lexer
java.lang.Object
|
+----att.grappa.Lexer
- public class Lexer
- extends Object
A class for doing lexical analysis of dot formatted input.
- Version:
- 1.1, 30 Sep 1999; Copyright 1996 - 1999 by AT&T Corp.
- Author:
- John Mocenigo, Research @ AT&T Labs
-
Lexer(Reader, PrintWriter)
- Create an instance of
Lexer
that reads from input
and
sends error messages to error
.
-
advance()
- Advance the scanner one character in the input stream.
-
getLocation()
- Get the current location in the form "[line_number(character_offser)]".
-
init()
- Initialize internal tables and read two characters of input for
look-ahead purposes.
-
next_token(int)
- Return one Symbol.
Lexer
public Lexer(Reader input,
PrintWriter error) throws IllegalArgumentException
- Create an instance of
Lexer
that reads from input
and
sends error messages to error
.
- Parameters:
- input - input
Reader
object
- error - error output
Writer
object
- Throws: IllegalArgumentException
- whenever
input
is null
init
public void init() throws IOException
- Initialize internal tables and read two characters of input for
look-ahead purposes.
- Throws: IOException
- if
advance()
does
- See Also:
- advance
advance
public void advance() throws IOException
- Advance the scanner one character in the input stream. This moves
next_char2 to next_char and then reads a new next_char2.
- Throws: IOException
- whenever a problem reading from
input
is encountered
getLocation
public String getLocation()
- Get the current location in the form "[line_number(character_offser)]".
- Returns:
- info about the current position in the input
next_token
public Symbol next_token(int debugLevel) throws IOException
- Return one Symbol. This method is the main external interface to
the scanner.
It consumes sufficient characters to determine the next input Symbol
and returns it.
- Throws: IOException
- if
advance()
does
All Packages Class Hierarchy This Package Previous Next Index