TD-1090
This commit is contained in:
parent
9f3ccbb26f
commit
d50a9d153b
|
@ -98,9 +98,9 @@ struct _script_t;
|
||||||
typedef struct _cmd_t {
|
typedef struct _cmd_t {
|
||||||
int16_t cmdno;
|
int16_t cmdno;
|
||||||
int16_t nlen;
|
int16_t nlen;
|
||||||
char name[MAX_SIM_CMD_NAME_LEN];
|
char name[MAX_SIM_CMD_NAME_LEN];
|
||||||
bool (*parseCmd)(char *, struct _cmd_t *, int);
|
bool (*parseCmd)(char *, struct _cmd_t *, int);
|
||||||
bool (*executeCmd)(struct _script_t *script, char *option);
|
bool (*executeCmd)(struct _script_t *script, char *option);
|
||||||
struct _cmd_t *next;
|
struct _cmd_t *next;
|
||||||
} SCommand;
|
} SCommand;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ typedef struct _var_t {
|
||||||
} SVariable;
|
} SVariable;
|
||||||
|
|
||||||
typedef struct _script_t {
|
typedef struct _script_t {
|
||||||
int type;
|
int type;
|
||||||
bool killed;
|
bool killed;
|
||||||
|
|
||||||
void *taos;
|
void *taos;
|
||||||
|
@ -130,10 +130,10 @@ typedef struct _script_t {
|
||||||
char system_exit_code[12];
|
char system_exit_code[12];
|
||||||
char system_ret_content[MAX_SYSTEM_RESULT_LEN];
|
char system_ret_content[MAX_SYSTEM_RESULT_LEN];
|
||||||
|
|
||||||
int varLen;
|
int varLen;
|
||||||
int linePos; // current cmd position
|
int linePos; // current cmd position
|
||||||
int numOfLines; // number of lines in the script
|
int numOfLines; // number of lines in the script
|
||||||
int bgScriptLen;
|
int bgScriptLen;
|
||||||
char fileName[MAX_FILE_NAME_LEN]; // script file name
|
char fileName[MAX_FILE_NAME_LEN]; // script file name
|
||||||
char error[MAX_ERROR_LEN];
|
char error[MAX_ERROR_LEN];
|
||||||
char *optionBuffer;
|
char *optionBuffer;
|
||||||
|
|
|
@ -33,7 +33,8 @@ enum {
|
||||||
|
|
||||||
/* label stack */
|
/* label stack */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int16_t pos[MAX_NUM_LABLES]; /* the position of the label */
|
char top; /* number of labels */
|
||||||
|
int16_t pos[MAX_NUM_LABLES]; /* the position of the label */
|
||||||
char label[MAX_NUM_LABLES][MAX_LABEL_LEN]; /* name of the label */
|
char label[MAX_NUM_LABLES][MAX_LABEL_LEN]; /* name of the label */
|
||||||
} SLabel;
|
} SLabel;
|
||||||
|
|
||||||
|
@ -41,12 +42,12 @@ typedef struct {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char top; /* the number of blocks stacked */
|
char top; /* the number of blocks stacked */
|
||||||
char type[MAX_NUM_BLOCK]; /* the block type */
|
char type[MAX_NUM_BLOCK]; /* the block type */
|
||||||
int16_t *pos[MAX_NUM_BLOCK]; /* position of the jump for if/elif/case */
|
int16_t *pos[MAX_NUM_BLOCK]; /* position of the jump for if/elif/case */
|
||||||
int16_t back[MAX_NUM_BLOCK]; /* go back, endw and continue */
|
int16_t back[MAX_NUM_BLOCK]; /* go back, endw and continue */
|
||||||
char numJump[MAX_NUM_BLOCK];
|
char numJump[MAX_NUM_BLOCK];
|
||||||
int16_t *jump[MAX_NUM_BLOCK][MAX_NUM_JUMP]; /* break or elif */
|
int16_t *jump[MAX_NUM_BLOCK][MAX_NUM_JUMP]; /* break or elif */
|
||||||
char sexp[MAX_NUM_BLOCK][40]; /*switch expression */
|
char sexp[MAX_NUM_BLOCK][40]; /*switch expression */
|
||||||
char sexpLen[MAX_NUM_BLOCK]; /*switch expression length */
|
char sexpLen[MAX_NUM_BLOCK]; /*switch expression length */
|
||||||
} SBlock;
|
} SBlock;
|
||||||
|
|
||||||
bool simParseExpression(char *token, int lineNum);
|
bool simParseExpression(char *token, int lineNum);
|
||||||
|
|
Loading…
Reference in New Issue