net.sourceforge.pmd.lang
Interface Parser

All Known Implementing Classes:
AbstractParser

public interface Parser

Common interface for calling tree-building parsers or source files.

Author:
Pieter_Van_Raemdonck - Application Engineers NV/SA - www.ae.be

Method Summary
 boolean canParse()
          Indicates if this parser can actual parse, or if it can only tokenize.
 ParserOptions getParserOptions()
          Get the ParserOptions used by this Parser.
 Map<Integer,String> getSuppressMap()
           
 TokenManager getTokenManager(String fileName, Reader source)
          Get a TokenManager for the given source.
 Node parse(String fileName, Reader source)
          Parse source code and return the root node of the AST.
 

Method Detail

getParserOptions

ParserOptions getParserOptions()
Get the ParserOptions used by this Parser.


getTokenManager

TokenManager getTokenManager(String fileName,
                             Reader source)
Get a TokenManager for the given source.

Parameters:
fileName - The file name being parsed (may be null).
source - Reader that provides the source code to tokenize.
Returns:
A TokenManager for reading token.

canParse

boolean canParse()
Indicates if this parser can actual parse, or if it can only tokenize.


parse

Node parse(String fileName,
           Reader source)
           throws ParseException
Parse source code and return the root node of the AST.

Parameters:
fileName - The file name being parsed (may be null).
source - Reader that provides the source code of a compilation unit
Returns:
the root node of the AST that is built from the source code
Throws:
ParseException - In case the source code could not be parsed, probably due to syntactical errors.

getSuppressMap

Map<Integer,String> getSuppressMap()


Copyright © 2002-2015 InfoEther. All Rights Reserved.