tcl.lang.cmd
Class InterpAliasCmd

java.lang.Object
  extended by tcl.lang.cmd.InterpAliasCmd
All Implemented Interfaces:
Command, CommandWithDispose

public class InterpAliasCmd
extends Object
implements CommandWithDispose

This class implements the alias commands, which are created in response to the built-in "interp alias" command in Tcl.


Field Summary
 TclObject name
          Name of alias command in slave interp.
 
Constructor Summary
InterpAliasCmd()
           
 
Method Summary
 void cmdProc(Interp interp, TclObject[] argv)
          This is the procedure that services invocations of aliases in a slave interpreter.
 void disposeCmd()
          Is invoked when an alias command is deleted in a slave.
 WrappedCommand getTargetCmd(Interp interp)
          helper function, that returns the WrappedCommand of the target command (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public TclObject name
Name of alias command in slave interp.

Constructor Detail

InterpAliasCmd

public InterpAliasCmd()
Method Detail

cmdProc

public void cmdProc(Interp interp,
                    TclObject[] argv)
             throws TclException
This is the procedure that services invocations of aliases in a slave interpreter. One such command exists for each alias. When invoked, this procedure redirects the invocation to the target command in the master interpreter as designated by the Alias record associated with this command. Results: A standard Tcl result. Side effects: Causes forwarding of the invocation; all possible side effects may occur as a result of invoking the command to which the invocation is forwarded.

Specified by:
cmdProc in interface Command
Parameters:
interp - The interpreter for setting the results and which contains the context
argv - the argument list for the command; objv[0[ is the command name itself
Throws:
TclException - on any errors

disposeCmd

public void disposeCmd()
Is invoked when an alias command is deleted in a slave. Cleans up all storage associated with this alias. Results: None. Side effects: Deletes the alias record and its entry in the alias table for the interpreter.

Specified by:
disposeCmd in interface CommandWithDispose

getTargetCmd

public WrappedCommand getTargetCmd(Interp interp)
                            throws TclException
helper function, that returns the WrappedCommand of the target command (i.e. the command which is called in the master interpreter). Results: The wrapped command. Side effects: None.

Parameters:
interp - interp for error reporting
Returns:
the wrapped command
Throws:
TclException


Copyright © 2015. All rights reserved.