tribble.net.ftp.shell
Class ExecFrame

java.lang.Object
  extended by tribble.net.ftp.shell.ExecFrame
All Implemented Interfaces:
CommandCodes

 class ExecFrame
extends java.lang.Object
implements CommandCodes

FTP command execution context frame.

Since:
API 1.0, 2007-03-15
Version:
$Revision: 1.14 $ $Date: 2007/08/04 14:59:11 $
Author:
David R. Tribble (david@tribble.com).

Copyright ©2007 by David R. Tribble, all rights reserved.
Permission is granted to any person or entity except those designated by by the United States Department of State as a terrorist, or terrorist government or agency, to use and distribute this source code provided that the original copyright notice remains present and unaltered.

See Also:
Interp, BlockDef

Field Summary
(package private)  int m_depth
          Scope nesting depth.
(package private)  java.lang.String m_dir
          Remote directory name ('foreach' loop).
(package private)  java.lang.Object m_expr
          Conditional ('while' loop) expression.
(package private)  int m_fileCnt
          Next file in the m_files[] list.
(package private)  java.util.ArrayList m_files
          File list of Strings ('foreach' loop).
(package private)  java.lang.String m_host
          Remote host name ('foreach' loop).
(package private)  CommandNode m_pc
          Next command to execute.
(package private)  BlockDef m_scope
          Begin/end block or func defining the scope for this frame.
(package private)  int m_sess
          Session number (for a 'foreach' loop).
(package private) static java.lang.String REV
          Revision information.
 
Fields inherited from interface tribble.net.ftp.shell.CommandCodes
CMD__UNDEF, CMD_ADD, CMD_AND, CMD_APPEND, CMD_BINARY, CMD_BLOCK, CMD_BREAK, CMD_BUILTIN, CMD_CALL, CMD_CDUP, CMD_CHDIR, CMD_CLOSE, CMD_CONCAT, CMD_COND, CMD_CONNECT, CMD_CONTINUE, CMD_DEBUG, CMD_DECR, CMD_DELETE, CMD_DIR, CMD_DIV, CMD_ECHO, CMD_EQ, CMD_EXEC, CMD_EXIT, CMD_FALSE, CMD_FILENAME, CMD_FOR, CMD_FOREACH, CMD_FUNC, CMD_FUNC_FORMAT, CMD_FUNC_INDEX, CMD_FUNC_LCASE, CMD_FUNC_LEN, CMD_FUNC_NORM, CMD_FUNC_REPL, CMD_FUNC_RINDEX, CMD_FUNC_SUB, CMD_FUNC_TRIM, CMD_FUNC_UCASE, CMD_GE, CMD_GET, CMD_GLOB, CMD_GOTO, CMD_GT, CMD_HELP, CMD_IF, CMD_INCR, CMD_LABEL, CMD_LCHDIR, CMD_LE, CMD_LOCAL, CMD_LT, CMD_MATCH, CMD_MGET, CMD_MKDIR, CMD_MOD, CMD_MPUT, CMD_MUL, CMD_NE, CMD_NEG, CMD_NMATCH, CMD_NO_N, CMD_NOP, CMD_NOT, CMD_OPEN, CMD_OR, CMD_POS, CMD_PRINT, CMD_PUT, CMD_PWD, CMD_READ, CMD_REMOTE, CMD_RENAME, CMD_REPEAT, CMD_RETURN, CMD_RMDIR, CMD_SET, CMD_SHELL, CMD_SLEEP, CMD_STATUS, CMD_STREQ, CMD_SUB, CMD_SUBSCR, CMD_SYSTEM, CMD_TEST, CMD_TEST_DIR, CMD_TEST_EXEC, CMD_TEST_EXISTS, CMD_TEST_FILE, CMD_TEST_MODTIME, CMD_TEST_READ, CMD_TEST_SIZE, CMD_TEST_WRITE, CMD_TEXT, CMD_TIMEOUT, CMD_TOK, CMD_TRUE, CMD_USER, CMD_VAR, CMD_WAITFOR, CMD_WHILE, CMD_WRITE, CMD_X_INTERRUPT, CMD_X_SESSIONS, CMD_X_STACK, CMD_X_STOP, CMD_X_VARS, CMD_X_VERBOSE, VAL_EMPTY, VAL_FALSE, VAL_FALSE_WD, VAL_ONE, VAL_TRUE, VAL_TRUE_WD, VAL_ZERO
 
Constructor Summary
ExecFrame(BlockDef scope, CommandNode cmds, ExecFrame prev)
          Constructor.
 
Method Summary
(package private)  void defVar(java.lang.String name, java.lang.String val)
          Define a local var value in this frame.
(package private)  void dumpStack(java.io.PrintWriter out)
          Print the currently active stack frames.
(package private) static void dumpString(java.lang.String s, java.io.PrintWriter out)
          Print a string value in printable (source) form.
(package private)  void dumpVars(java.io.PrintWriter out)
          Print the current vars and their values.
(package private)  java.lang.String findVar(java.lang.String name, java.lang.String elem)
          Find a local var value in this frame.
(package private)  ExecFrame pop()
          Terminate this execution frame.
(package private)  void reset()
          Reset this execution frame so that it begins executing at its first command.
(package private)  boolean setVar(java.lang.String name, int nest, java.lang.String elem, java.lang.String val)
          Set the value of a local var value in this frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REV

static final java.lang.String REV
Revision information.

See Also:
Constant Field Values

m_scope

BlockDef m_scope
Begin/end block or func defining the scope for this frame.


m_depth

int m_depth
Scope nesting depth.


m_pc

CommandNode m_pc
Next command to execute.


m_expr

java.lang.Object m_expr
Conditional ('while' loop) expression.


m_sess

int m_sess
Session number (for a 'foreach' loop).


m_host

java.lang.String m_host
Remote host name ('foreach' loop).


m_dir

java.lang.String m_dir
Remote directory name ('foreach' loop).


m_files

java.util.ArrayList m_files
File list of Strings ('foreach' loop).


m_fileCnt

int m_fileCnt
Next file in the m_files[] list.

Constructor Detail

ExecFrame

ExecFrame(BlockDef scope,
          CommandNode cmds,
          ExecFrame prev)
Constructor.

Parameters:
scope - Begin/end block or func definition that defines the context and scope for this frame. The initial (file) frame is the outermost scope for all execution frames.
cmds - Commands to execute within this frame. This is the first statement of the begin/end block or func for this frame, or null if there are no commands.
prev - Execution frame that is calling (nesting) this new frame. It is the frame where execution will resume when the new frame finishes its execution. The outermost (initial) execution frame has a null calling frame.
Since:
1.2, 2007-03-16
Method Detail

dumpString

static void dumpString(java.lang.String s,
                       java.io.PrintWriter out)
Print a string value in printable (source) form.

Since:
1.7, 2007-04-11

reset

void reset()
Reset this execution frame so that it begins executing at its first command.

Since:
1.6, 2007-03-24

pop

ExecFrame pop()
Terminate this execution frame.

Returns:
Execution frame that called (nested) this frame, where execution should resume. This is null for the initial (outermost) frame.
Since:
1.2, 2007-03-16

defVar

void defVar(java.lang.String name,
            java.lang.String val)
Define a local var value in this frame.

Parameters:
name - Var name.
val - The initial value of the var.
Since:
1.2, 2007-03-16

findVar

java.lang.String findVar(java.lang.String name,
                         java.lang.String elem)
Find a local var value in this frame.

Parameters:
name - Var name.
elem - Array element name, for a subscripted array name. This can be null, in which case the var to be located is not an array element.
Returns:
The current value of the var, or null if no such var exists in this frame.
Since:
1.13, 2007-05-31 (1.2, 2007-03-16)

setVar

boolean setVar(java.lang.String name,
               int nest,
               java.lang.String elem,
               java.lang.String val)
Set the value of a local var value in this frame.

Parameters:
name - Var name.
nest - Nesting depth, specifying the number of level of block scope nesting that the var is defined at.
elem - Array element name, for a subscripted array name. This can be null, in which case the var to be modified is not an array element.
val - Value to set the var to.
Returns:
True if the var value was successfully set, otherwise false if no such var exists in this frame.
Since:
1.13, 2007-05-31 (1.4, 2007-03-17)

dumpVars

void dumpVars(java.io.PrintWriter out)
Print the current vars and their values.

Since:
1.7, 2007-04-11

dumpStack

void dumpStack(java.io.PrintWriter out)
Print the currently active stack frames.

Since:
1.11, 2007-04-18