diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala b/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala new file mode 100644 index 0000000000..b4a3b507b3 --- /dev/null +++ b/src/compiler/scala/tools/nsc/ast/parser/SyntaxAnalyzer.scala @@ -0,0 +1,25 @@ +/* NSC -- new scala compiler + * Copyright 2005 LAMP/EPFL + * @author Martin Odersky + */ +// $Id$ +package scala.tools.nsc.ast.parser; + +/** An nsc sub-component. + */ +abstract class SyntaxAnalyzer extends SubComponent with Parsers with MarkupParsers with Scanners { + val phaseName = "parser"; + def newPhase(prev: Phase): StdPhase = new ParserPhase(prev); + class ParserPhase(prev: scala.tools.nsc.Phase) extends StdPhase(prev) { + def apply(unit: global.CompilationUnit): unit = { + global.informProgress("parsing " + unit); + unit.body = new Parser(unit).parse(); + } + } + //Moez addition. I wished not to add/modify here, but the fact that Parsers + // are NOT accessible (because of Parsers' self type) except in SyntaxAnalyzer + // had bitten me, and thus I had to add the following code here. + def interpreterParse(unit: global.CompilationUnit): List[global.Tree] = + new Parser(unit).templateStatSeq() +} + |