01: package antlr;
02:
03: import java.io.IOException;
04: import java.io.PrintWriter;
05: import java.util.Map;
06:
07: /**
08: * Defines a strategy that can be used to manage the printwriter
09: * being used to write JavaCodeGenerator output
10: *
11: * TODO generalize so all code gens could use?
12: */
13: public interface JavaCodeGeneratorPrintWriterManager {
14: public PrintWriter setupOutput(Tool tool, Grammar grammar)
15: throws IOException;
16:
17: public PrintWriter setupOutput(Tool tool, String fileName)
18: throws IOException;
19:
20: public void startMapping(int sourceLine);
21:
22: public void startSingleSourceLineMapping(int sourceLine);
23:
24: public void endMapping();
25:
26: public void finishOutput() throws IOException;
27:
28: public Map getSourceMaps();
29: }
|