condor.classad
Class Parser

Object
  |
  +--condor.classad.Parser

class Parser
extends Object

This is the internal classad parser generated by byacc. From outside this package, it should be accessed through the wrapper class ClassAdParser.

Version:
2.0
Author:
Marvin Solomon
See Also:
ClassAdParser

Field Summary
(package private)  boolean acceptPrefix
          If true, accept when a prefix of the input matches.
static short ERROR
           
(package private)  PrintStream errs
          Place to send error messages.
static short FALSE
           
static short IDENTIFIER
           
static short INTEGER
           
static short OP_EQ
           
static short OP_GE
           
static short OP_IS
           
static short OP_ISNT
           
static short OP_LAND
           
static short OP_LE
           
static short OP_LOR
           
static short OP_NE
           
static short OP_SHL
           
static short OP_SHR
           
static short OP_SHRR
           
static short REAL
           
static short STRING
           
(package private)  boolean tracing
          Set to true if parsing actions should be traced.
static short TRUE
           
static short UNARY
           
static short UNDEFINED
           
(package private)  int verbosity
          Verbosity for error messages.
 
Constructor Summary
Parser(InputStream str)
           
Parser(Reader rdr)
           
Parser(String str)
           
 
Method Summary
 boolean enableTracing(boolean on)
          Turn debug tracing on or off.
 int getNextToken()
          Get and remove the "lookahead" token: the first token not yet consumed by the parser.
 int nextToken()
          Get the "lookahead" token: the first token not yet consumed by the parser.
 Object nextValue()
          Get the value associated with the "lookahead" token: the first token not yet consumed by the parser.
 Object parse()
          Check whether the the unconsumed input is a syntactically valid phrase according to the grammar.
 Object parse(boolean acceptPrefix)
          Check whether the the unconsumed input is a syntactically valid phrase according to the grammar.
(package private)  void printMessage(String msg)
          Print a message, decorated with the current line and column number.
 void reset(InputStream str)
           
 void reset(Reader rdr)
           
 void reset(String str)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

public static final short IDENTIFIER
See Also:
Constant Field Values

INTEGER

public static final short INTEGER
See Also:
Constant Field Values

REAL

public static final short REAL
See Also:
Constant Field Values

STRING

public static final short STRING
See Also:
Constant Field Values

TRUE

public static final short TRUE
See Also:
Constant Field Values

FALSE

public static final short FALSE
See Also:
Constant Field Values

ERROR

public static final short ERROR
See Also:
Constant Field Values

UNDEFINED

public static final short UNDEFINED
See Also:
Constant Field Values

OP_LOR

public static final short OP_LOR
See Also:
Constant Field Values

OP_LAND

public static final short OP_LAND
See Also:
Constant Field Values

OP_EQ

public static final short OP_EQ
See Also:
Constant Field Values

OP_NE

public static final short OP_NE
See Also:
Constant Field Values

OP_IS

public static final short OP_IS
See Also:
Constant Field Values

OP_ISNT

public static final short OP_ISNT
See Also:
Constant Field Values

OP_LE

public static final short OP_LE
See Also:
Constant Field Values

OP_GE

public static final short OP_GE
See Also:
Constant Field Values

OP_SHL

public static final short OP_SHL
See Also:
Constant Field Values

OP_SHR

public static final short OP_SHR
See Also:
Constant Field Values

OP_SHRR

public static final short OP_SHRR
See Also:
Constant Field Values

UNARY

public static final short UNARY
See Also:
Constant Field Values

tracing

boolean tracing
Set to true if parsing actions should be traced.


acceptPrefix

boolean acceptPrefix
If true, accept when a prefix of the input matches.


verbosity

int verbosity
Verbosity for error messages. Values are: 0 - no messages 1 - only show message and line number 2 - also echo line in question 3 - also list tokens expected


errs

PrintStream errs
Place to send error messages. Default is System.err.

Constructor Detail

Parser

public Parser(Reader rdr)

Parser

public Parser(InputStream str)

Parser

public Parser(String str)
Method Detail

parse

public Object parse(boolean acceptPrefix)
Check whether the the unconsumed input is a syntactically valid phrase according to the grammar. Parsing stops at the end of the input, or the first token that cannot be included in a prefix of a valid phrase according to the grammar. If "acceptPrefix" is false and an invalid token is encountered before the end of the input, an error occurs. An error is also signaled if "acceptPrefix" is true but the input preceding the invalid token is not a valid phrase according the the grammar.

If the input is already at end of file when this method is called, it silently returns null. If an error occurs, a message is printed by calling the user-supplied method error(String) and the result is null. On success, the return value is the "semantic value" assigned by semantic routines to the start symbol.

Parameters:
acceptPrefix - if true, the input does not to be completely consumed.
Returns:
the "semantic value" corresponding to the phrase found or null for errors or end-of-file.

parse

public Object parse()
Check whether the the unconsumed input is a syntactically valid phrase according to the grammar. This method is equivalent to parse(true).

Returns:
the "semantic value" corresponding to the phrase found or null for errors or end-of-file.

enableTracing

public boolean enableTracing(boolean on)
Turn debug tracing on or off. Debugging output goes to System.out.

Parameters:
on - if true, turn tracing on; otherwise turn it off.
Returns:
the previous value.

reset

public void reset(Reader rdr)

reset

public void reset(InputStream str)

reset

public void reset(String str)

nextToken

public int nextToken()
Get the "lookahead" token: the first token not yet consumed by the parser. The token is not removed from the input stream.

Returns:
the code for the next token.
See Also:
getNextToken()

nextValue

public Object nextValue()
Get the value associated with the "lookahead" token: the first token not yet consumed by the parser. The token is not removed from the input stream.

Returns:
the value associated with the next token.
See Also:
nextToken()

getNextToken

public int getNextToken()
Get and remove the "lookahead" token: the first token not yet consumed by the parser. The token is removed from the input stream.

Returns:
the code for the next token.
See Also:
getNextToken()

printMessage

void printMessage(String msg)
Print a message, decorated with the current line and column number.

Parameters:
msg - the message to print.