View Javadoc

    1   package net.sourceforge.pmd.parsers;
    2
    3   import net.sourceforge.pmd.ast.JavaCharStream;
    4   import net.sourceforge.pmd.ast.JavaParser;
    5   import net.sourceforge.pmd.ast.ParseException;
    6
    7   import java.io.Reader;
    8
    9   /***
    10   * Adapter for the JavaParser, using Java 1.5 grammar.
    11   *
    12   * @author Pieter_Van_Raemdonck - Application Engineers NV/SA - www.ae.be
    13   */
    14  public class Java15Parser implements Parser {
    15
    16      public Object parse(Reader source) throws ParseException {
    17          JavaParser parser = new JavaParser(new JavaCharStream(source));
    18          parser.setJDK15();
    19          return parser.CompilationUnit();
    20      }
    21
    22  }