tcl.lang.cmd
Class RegexpCmd

java.lang.Object
  extended by tcl.lang.cmd.RegexpCmd
All Implemented Interfaces:
Command

public class RegexpCmd
extends Object
implements Command

This class implements the built-in "regexp" command in Tcl.


Constructor Summary
RegexpCmd()
           
 
Method Summary
 void cmdProc(Interp interp, TclObject[] objv)
          This method implements the functionality of the command.
protected  TclObject getAboutCompileError(Interp interp)
          Returns a list for -about when a compile error occur.
static void init(Interp interp)
           
 void setAllowXFlags(boolean allow)
          Sets this instance of RegexpCmd to interpret and pass on the arguments of -xflags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexpCmd

public RegexpCmd()
Method Detail

init

public static void init(Interp interp)

setAllowXFlags

public void setAllowXFlags(boolean allow)
Sets this instance of RegexpCmd to interpret and pass on the arguments of -xflags. By default, allowXFlags is false.

Parameters:
allow - Set to true to allow -xflags processing

getAboutCompileError

protected TclObject getAboutCompileError(Interp interp)
                                  throws TclException
Returns a list for -about when a compile error occur. first element of the list is a subexpression count (0). The second element is a should be a list of property names that describe various attributes of the regular expression. Here we use just "COMPILE_ERROR"; reg.test is adjusted accordingly. Primarily intended for debugging purposes.

Parameters:
interp - current Jacl interpreter object
Returns:
A list containing information about the regular expression.
Throws:
TclException

cmdProc

public void cmdProc(Interp interp,
                    TclObject[] objv)
             throws TclException
Description copied from interface: Command
This method implements the functionality of the command. However, calling it directly in application code will bypass execution traces. Instead, commands should be called with WrappedCommand.invoke

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


Copyright © 2015. All rights reserved.