Jalopy 1.0b10

de.hunsicker.jalopy.language
Interface Parser

All Known Implementing Classes:
JavaParser, JavadocParser

public interface Parser

Common interface for ANTLR parsers.

Version:
$Revision: 1.3 $
Author:
Marco Hunsicker

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

Method Detail

setASTFactory

public void setASTFactory(ASTFactory factory)
Sets the factory used to create tree nodes.
Parameters:
factory - factory to use.

getASTFactory

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

setFilename

public void setFilename(String filename)
Sets the filename we parse.
Parameters:
filename - filename to parse.

getFilename

public String getFilename()
Returns the name of the file.
Returns:
The currently processed filename.

getParseTree

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

setTokenBuffer

public void setTokenBuffer(TokenBuffer buffer)
Sets the token buffer of the parser.
Parameters:
buffer - buffer to use.

getTokenNames

public String[] getTokenNames()
Returns the token names of the parser.
Returns:
The token names of the parser.

parse

public void parse()
           throws RecognitionException,
                  TokenStreamException
Start parsing.
Throws:
RecognitionException - if a problem with the input occured.
TokenStreamException - if something went wrong while generating the stream of tokens.

reset

public void reset()
Resets the parser state.

Jalopy 1.0b10

Submit a bug or feature.

For further information and documentation, visit the official Jalopy website.
This page generated: November 14 2002