org.cli4j
Class Parser

java.lang.Object
  |
  +--org.cli4j.Parser

public final class Parser
extends java.lang.Object

The Parser class is responsible for creating the command hierarchy parse tree.

Version:
@(#) $Id: Parser.html,v 1.2 2001/12/16 05:14:50 gmcallister Exp $
Author:
Glenn McAllister

Constructor Summary
Parser()
          Construct a parser without a default input file.
Parser(java.io.File inputFile)
          Create a parser with a default input file.
 
Method Summary
 void addParseTree(ParseTree ptree)
          This method is here solely for the sake of parsing the descriptor file; it should never be called directly.
 ParseTree parse()
          Parse the default input file to create a ParseTree representation of the command hierarchy.
 ParseTree parse(java.io.File inputFile)
          Parse the inputFile to create the ParseTree representation of the command hierarchy.
 void setDebug(boolean enableDebug)
          Enable debugging messages while parsing the XML command hierarchy descriptor.
 void setDebugWriter(java.io.PrintWriter writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser(java.io.File inputFile)
Create a parser with a default input file.
Parameters:
inputFile - The command hierarchy descriptor file.

Parser

public Parser()
Construct a parser without a default input file. The parse( File ) must be used to create the parse tree.
Method Detail

parse

public ParseTree parse()
                throws ParseException
Parse the default input file to create a ParseTree representation of the command hierarchy.
Throws:
ParseException - if an error is encountered while parsing the XML input file.

parse

public ParseTree parse(java.io.File inputFile)
                throws ParseException
Parse the inputFile to create the ParseTree representation of the command hierarchy.
Parameters:
inputFile - the XML file describing the command hierarchy

addParseTree

public void addParseTree(ParseTree ptree)
This method is here solely for the sake of parsing the descriptor file; it should never be called directly.

setDebug

public void setDebug(boolean enableDebug)
Enable debugging messages while parsing the XML command hierarchy descriptor. Messages go to System.out unless you use setDebugWriter to redirect the messages to a different PrintWriter.

setDebugWriter

public void setDebugWriter(java.io.PrintWriter writer)