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