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 ClassesModifier and TypeInterfaceDescriptionstatic final class
Parameters passed to a parsing task. -
Method Summary
Modifier and TypeMethodDescriptionparse
(Parser.ParserTask task) Parses an entire tree for this language.
-
Method Details
-
parse
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
-