Package net.sourceforge.pmd.lang.scala
Class ScalaParser
- java.lang.Object
-
- net.sourceforge.pmd.lang.AbstractParser
-
- net.sourceforge.pmd.lang.scala.ScalaParser
-
- All Implemented Interfaces:
Parser
public class ScalaParser extends AbstractParser
Scala's Parser implementation. Defers parsing to the scala compiler via Scalameta. This parser then wraps all of ScalaMeta's Nodes in Java versions for compatibility.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.pmd.lang.AbstractParser
parserOptions
-
-
Constructor Summary
Constructors Constructor Description ScalaParser(scala.meta.Dialect scalaDialect, ParserOptions parserOptions)
Create a parser using the given Scala Dialect and set of parser options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canParse()
protected TokenManager
createTokenManager(Reader source)
Map<Integer,String>
getSuppressMap()
ASTSource
parse(String fileName, Reader source)
-
Methods inherited from class net.sourceforge.pmd.lang.AbstractParser
doParse, getParserOptions, getTokenManager
-
-
-
-
Constructor Detail
-
ScalaParser
public ScalaParser(scala.meta.Dialect scalaDialect, ParserOptions parserOptions)
Create a parser using the given Scala Dialect and set of parser options.- Parameters:
scalaDialect
- the Scala Dialect for this parserparserOptions
- any additional options for this parser
-
-
Method Detail
-
canParse
public boolean canParse()
-
parse
public ASTSource parse(String fileName, Reader source) throws ParseException
- Throws:
ParseException
-
createTokenManager
protected TokenManager createTokenManager(Reader source)
- Specified by:
createTokenManager
in classAbstractParser
-
-