|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tribble.net.ftp.shell.CommandNode
class CommandNode
FTP command script parser.
Example
loop1: foreach remote *.tar do begin get $F if $_E != 0 continue loop1 del $F !tar -xf $F !del $F end
The example script above parses into the following command parse tree:
1 (label "loop1") 2 (foreach "remote" "*.tar") 3 (get "$F") 4 (if (!= "$_E" "0")) 5 (continue 2 "loop1") 6 (del "$F") 7 (! "tar" "-xf" "$F") 8 (! "del" "$F")
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.
CommandParser
Field Summary | |
---|---|
(package private) java.lang.Object[] |
m_args
Arguments (may be null). |
(package private) java.lang.String |
m_cmd
Command operator. |
(package private) int |
m_lineNo
Source line number. |
(package private) CommandNode |
m_next
Next command. |
(package private) static java.lang.String |
REV
Revision information. |
Constructor Summary | |
---|---|
CommandNode(java.lang.String cmd,
int line)
Constructor. |
Method Summary | |
---|---|
(package private) int |
addArg(java.lang.Object arg)
Append an argument to this command node. |
(package private) void |
print(java.io.PrintWriter out)
Pretty-print this parse tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String REV
java.lang.String m_cmd
java.lang.Object[] m_args
CommandNode m_next
int m_lineNo
Constructor Detail |
---|
CommandNode(java.lang.String cmd, int line)
cmd
- Command code, one of the CMD_XXX
constants.line
- Source line number for this command node.Method Detail |
---|
int addArg(java.lang.Object arg)
arg
- An argument (usually a String or another CommandNode
subtree).void print(java.io.PrintWriter out)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |