01: /**
02: *
03: * Copyright 2004 James Strachan
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: **/package org.codehaus.groovy.control;
18:
19: import org.codehaus.groovy.syntax.Reduction;
20: import org.codehaus.groovy.syntax.ParserException;
21: import org.codehaus.groovy.syntax.SourceSummary;
22: import org.codehaus.groovy.ast.ModuleNode;
23:
24: import java.io.Reader;
25:
26: /**
27: * A simple extension point to allow us to switch between the classic Groovy parser and the new Antlr based parser
28: *
29: * @version $Revision: 2888 $
30: */
31: public interface ParserPlugin {
32:
33: public Reduction parseCST(SourceUnit sourceUnit, Reader reader)
34: throws CompilationFailedException;
35:
36: public SourceSummary getSummary();
37:
38: public ModuleNode buildAST(SourceUnit sourceUnit,
39: ClassLoader classLoader, Reduction cst)
40: throws ParserException;
41: }
|