Package net.sourceforge.pmd.lang.ast
Interface Parser
-
- All Known Implementing Classes:
AntlrBaseParser
,JjtreeParserAdapter
public interface Parser
Produces an AST from a source file. Instances of this interface must be stateless (which makes them trivially threadsafe).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Parser.ParserTask
Parameters passed to a parsing task.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RootNode
parse(Parser.ParserTask task)
Parses an entire tree for this language.
-
-
-
Method Detail
-
parse
RootNode parse(Parser.ParserTask task) throws FileAnalysisException
Parses an entire tree for this language. This may perform some semantic analysis, like name resolution.- Parameters:
task
- Description of the parsing task- Returns:
- The root of the tree corresponding to the source code.
- Throws:
IllegalArgumentException
- If the language version of the parsing task is for an incorrect languageFileAnalysisException
- If any error occurs
-
-