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:
net.sourceforge.pmd.lang.Parser
public class ScalaParser extends net.sourceforge.pmd.lang.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.
-
-
Constructor Summary
Constructors Constructor Description ScalaParser(scala.meta.Dialect scalaDialect, net.sourceforge.pmd.lang.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 net.sourceforge.pmd.lang.TokenManager
createTokenManager(Reader source)
Map<Integer,String>
getSuppressMap()
ASTSource
parse(String fileName, Reader source)
-
-
-
Constructor Detail
-
ScalaParser
public ScalaParser(scala.meta.Dialect scalaDialect, net.sourceforge.pmd.lang.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 net.sourceforge.pmd.lang.ast.ParseException
- Throws:
net.sourceforge.pmd.lang.ast.ParseException
-
createTokenManager
protected net.sourceforge.pmd.lang.TokenManager createTokenManager(Reader source)
- Specified by:
createTokenManager
in classnet.sourceforge.pmd.lang.AbstractParser
-
-