1
2
3
4
5 package net.sf.tomp.xtcl;
6
7 /***
8 * Compiler for compiling XTCL script from various sources.
9 *
10 * @author tomp
11 */
12 public interface Compiler {
13 /***
14 * Compiles commands from a CommandLineReader into a command Sequence
15 *
16 * @param clr CommandLineReader - the source for compilation
17 * @return the compiled Command
18 * @throws Exception if something bad occurs
19 */
20 Command compile(CommandLineReader clr) throws Exception;
21
22 /***
23 * @param cl Current (first) command lines (already split to String[])
24 * @param clr CommandLineReader for further reading
25 * @return compiled Command
26 * @throws Exception if something bad occurs
27 */
28 Command compile(String[] cl, CommandLineReader clr) throws Exception;
29
30 /***
31 * @param cl Current (first) command lines (not yet split to String[])
32 * @return compiled Command
33 * @throws Exception if something bad occurs
34 */
35 Command compile(String cl, CommandLineReader clr) throws Exception;
36
37 /***
38 * @param script
39 * @return compiled Command
40 * @throws Exception if something bad occurs
41 */
42 Command compile(String script) throws Exception;
43
44 /***
45 * @return Returns the context.
46 */
47 Context getContext();
48
49 /***
50 * @return Returns this Compiler's parent.
51 */
52 Compiler getNextCompiler();
53
54 /***
55 * @param context The context to set.
56 */
57 void setContext(Context context);
58 }