View Javadoc

    1   package net.sourceforge.pmd.parsers;
    2
    3   import net.sourceforge.pmd.ast.ParseException;
    4
    5   import java.io.Reader;
    6   import java.util.Map;
    7
    8   /**
    9    * Common interface for calling tree-building parsers or source files.
    10   *
    11   * @author Pieter_Van_Raemdonck - Application Engineers NV/SA - www.ae.be
    12   */
    13  public interface Parser {
    14
    15      /**
    16       * Parse source code and return the root node of the AST.
    17       *
    18       * @param source Reader that provides the source code of a compilation unit
    19       * @return the root node of the AST that is built from the source code
    20       * @throws ParseException In case the source code could not be parsed, probably
    21       *                        due to syntactical errors.
    22       */
    23      Object parse(Reader source) throws ParseException;
    24
    25      Map<Integer, String> getExcludeMap();
    26
    27      void setExcludeMarker(String marker);
    28
    29  }