net.sf.tomp.xtcl
Class CompilerBase

java.lang.Object
  extended bynet.sf.tomp.xtcl.CompilerBase
All Implemented Interfaces:
Compiler
Direct Known Subclasses:
XTCompiler

public abstract class CompilerBase
extends java.lang.Object
implements Compiler

Author:
tomp TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Constructor Summary
CompilerBase()
           
 
Method Summary
protected  void assertWholeLineRead(java.lang.String ci, int i, java.lang.String[] cl, Command commandToReturn)
           
 Command compile(CommandLineReader clr)
          Compiles commands from a CommandLineReader into a command Sequence
 Command compile(java.io.File f)
          Compiles commands from a String
 Command compile(java.lang.String s)
          Compiles commands from a String
 Command compile(java.lang.String cl, CommandLineReader clr)
          Compiles commands from a String followed by a CommandLineReader into a command Sequence
protected  Command compileByNextCompiler(java.lang.String ci, java.lang.String[] cl, CommandLineReader clr)
           
 Context getContext()
           
 Compiler getNextCompiler()
           
 void setContext(Context context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.tomp.xtcl.Compiler
compile
 

Constructor Detail

CompilerBase

public CompilerBase()
Method Detail

compile

public Command compile(CommandLineReader clr)
                throws java.lang.Exception
Compiles commands from a CommandLineReader into a command Sequence

Specified by:
compile in interface Compiler
Parameters:
clr - CommandLineReader - the source for compilation
Returns:
DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!

compile

public Command compile(java.io.File f)
                throws java.lang.Exception
Compiles commands from a String

Parameters:
f - String - the source from which it compiles
Returns:
DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!

compile

public Command compile(java.lang.String s)
                throws java.lang.Exception
Compiles commands from a String

Specified by:
compile in interface Compiler
Parameters:
s - String - the source from which it compiles
Returns:
DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!

compile

public Command compile(java.lang.String cl,
                       CommandLineReader clr)
                throws java.lang.Exception
Compiles commands from a String followed by a CommandLineReader into a command Sequence

Specified by:
compile in interface Compiler
Parameters:
cl - String - will be tokenized and passed further to compile(String[], CommandLineReader)
clr - CommandLineReader - the sources for compilation first the String, then the CLR
Returns:
DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!

assertWholeLineRead

protected void assertWholeLineRead(java.lang.String ci,
                                   int i,
                                   java.lang.String[] cl,
                                   Command commandToReturn)
Parameters:
ci -
i -
cl -
commandToReturn -

compileByNextCompiler

protected Command compileByNextCompiler(java.lang.String ci,
                                        java.lang.String[] cl,
                                        CommandLineReader clr)
                                 throws java.lang.Exception
Parameters:
ci -
cl -
clr -
Returns:
@throws Exception
Throws:
java.lang.Exception

getContext

public Context getContext()
Specified by:
getContext in interface Compiler
Returns:
Returns the context.

getNextCompiler

public Compiler getNextCompiler()
Specified by:
getNextCompiler in interface Compiler
Returns:
Returns the parent.

setContext

public void setContext(Context context)
Specified by:
setContext in interface Compiler
Parameters:
context - The context to set.


Copyright © 2004 Masaryk University in Brno, Faculty of Informatics, Czech Republic. All Rights Reserved.