概要
コマンド手続きを定義している構造体。
Tclコマンドとコンパイル時に認識しているローカル変数から構成される。
メンバー
- struct Interp *iPtr; コマンドが定義されたインタープリタへのポインタ
- int refCount; リファレンスカウンタ
- struct Command *cmdPtr; 手続きのコマンド構造へのポインタ
- Tcl_Obj *bodyPtr; 手続きのコマンドのバイトコードへのポインタ
- int numArgs; formal parametrの数
- int numCompiledLocals; コンパイラに認識されたローカル変数の数
- CompiledLocal *firstLocalPtr; コンパイラにアロケートされた手続きのローカル変数の先頭へのポインタ。NULLの時は無し。
- CompiledLocal *lastLocalPtr; アロケートされたローカル変数の最後を指すポインタ-。NULLの時は無し。こrはframe index を持つ。 (numCompiledLocals-1).
ソース
/*
* The structure below defines a command procedure, which consists of a
* collection of Tcl commands plus information about arguments and other local
* variables recognized at compile time.
*/
typedef struct Proc {
struct [[Interp]] *iPtr; /* Interpreter for which this command is
* defined. */
int refCount; /* Reference count: 1 if still present in
* command table plus 1 for each call to the
* procedure that is currently active. This
* structure can be freed when refCount
* becomes zero. */
struct [[Command]] *cmdPtr; /* Points to the Command structure for this
* procedure. This is used to get the
* namespace in which to execute the
* procedure. */
[[Tcl_Obj]] *bodyPtr; /* Points to the ByteCode object for
* procedure's body command. */
int numArgs; /* Number of formal parameters. */
int numCompiledLocals; /* Count of local variables recognized by the
* compiler including arguments and
* temporaries. */
[[CompiledLocal]] *firstLocalPtr;
/* Pointer to first of the procedure's
* compiler-allocated local variables, or NULL
* if none. The first numArgs entries in this
* list describe the procedure's formal
* arguments. */
CompiledLocal *lastLocalPtr;/* Pointer to the last allocated local
* variable or NULL if none. This has frame
* index (numCompiledLocals-1). */
} Proc;
最終更新:2011年11月03日 13:23