de.hunsicker.jalopy.language
Interface Parser

All Known Implementing Classes:
JavadocParser, JavaParser

public interface Parser

Common interface for ANTLR parsers.

Version:
$Revision: 1.3.2.1 $
Author:
Marco Hunsicker

Method Summary
 antlr.ASTFactory getASTFactory()
          Sets the factory used to create the nodes of the parse tree.
 java.lang.String getFilename()
          Returns the name of the file.
 antlr.collections.AST getParseTree()
          Returns the root node of the generated parse tree.
 java.lang.String[] getTokenNames()
          Returns the token names of the parser.
 void parse()
          Start parsing.
 void reset()
          Resets the parser state.
 void setASTFactory(antlr.ASTFactory factory)
          Sets the factory used to create tree nodes.
 void setFilename(java.lang.String filename)
          Sets the filename we parse.
 void setTokenBuffer(antlr.TokenBuffer buffer)
          Sets the token buffer of the parser.
 

Method Detail

setASTFactory

public void setASTFactory(antlr.ASTFactory factory)
Sets the factory used to create tree nodes.

Parameters:
factory - factory to use.

getASTFactory

public antlr.ASTFactory getASTFactory()
Sets the factory used to create the nodes of the parse tree.

Returns:
the used node factory.

setFilename

public void setFilename(java.lang.String filename)
Sets the filename we parse.

Parameters:
filename - filename to parse.

getFilename

public java.lang.String getFilename()
Returns the name of the file.

Returns:
The currently processed filename.

getParseTree

public antlr.collections.AST getParseTree()
Returns the root node of the generated parse tree.

Returns:
root node of the generated parse tree.

setTokenBuffer

public void setTokenBuffer(antlr.TokenBuffer buffer)
Sets the token buffer of the parser.

Parameters:
buffer - buffer to use.

getTokenNames

public java.lang.String[] getTokenNames()
Returns the token names of the parser.

Returns:
The token names of the parser.

parse

public void parse()
           throws antlr.RecognitionException,
                  antlr.TokenStreamException
Start parsing.

Throws:
antlr.RecognitionException - if a problem with the input occured.
antlr.TokenStreamException - if something went wrong while generating the stream of tokens.

reset

public void reset()
Resets the parser state.



Copyright © 1997-2005 Jalopy. All Rights Reserved.