1 /* $Header: cmd.h,v 1.0.1.1 88/01/28 10:23:07 root Exp $
4 * Revision 1.0.1.1 88/01/28 10:23:07 root
5 * patch8: added eval_root for eval operator.
7 * Revision 1.0 87/12/18 13:04:59 root
19 extern char *cmdname[];
42 #define CF_OPTIMIZE 077 /* type of optimization */
43 #define CF_FIRSTNEG 0100/* conditional is ($register NE 'string') */
44 #define CF_NESURE 0200 /* if first doesn't match we're sure */
45 #define CF_EQSURE 0400 /* if first does match we're sure */
46 #define CF_COND 01000 /* test c_expr as conditional first, if not null. */
47 /* Set for everything except do {} while currently */
48 #define CF_LOOP 02000 /* loop on the c_expr conditional (loop modifiers) */
49 #define CF_INVERT 04000 /* it's an "unless" or an "until" */
50 #define CF_ONCE 010000 /* we've already pushed the label on the stack */
51 #define CF_FLIP 020000 /* on a match do flipflop */
53 #define CFT_FALSE 0 /* c_expr is always false */
54 #define CFT_TRUE 1 /* c_expr is always true */
55 #define CFT_REG 2 /* c_expr is a simple register */
56 #define CFT_ANCHOR 3 /* c_expr is an anchored search /^.../ */
57 #define CFT_STROP 4 /* c_expr is a string comparison */
58 #define CFT_SCAN 5 /* c_expr is an unanchored search /.../ */
59 #define CFT_GETS 6 /* c_expr is $reg = <filehandle> */
60 #define CFT_EVAL 7 /* c_expr is not optimized, so call eval() */
61 #define CFT_UNFLIP 8 /* 2nd half of range not optimized */
62 #define CFT_CHOP 9 /* c_expr is a chop on a register */
65 extern char *cmdopt[];
83 STAB *ac_stab; /* a symbol table entry */
84 ARG *ac_expr; /* any associated expression */
88 CMD *cc_true; /* normal code to do on if and while */
89 CMD *cc_alt; /* else code or continue code */
93 CMD *c_next; /* the next command at this level */
94 ARG *c_expr; /* conditional expression */
95 CMD *c_head; /* head of this command list */
96 STR *c_first; /* head of string to match as shortcut */
97 STAB *c_stab; /* a symbol table entry, mostly for fp */
98 SPAT *c_spat; /* pattern used by optimization */
99 char *c_label; /* label for this construct */
101 struct acmd acmd; /* normal command */
102 struct ccmd ccmd; /* compound command */
104 short c_flen; /* len of c_first, if not null */
105 short c_flags; /* optimization flags--see above */
106 char c_type; /* what this command does */
109 #define Nullcmd Null(CMD*)
111 EXT CMD *main_root INIT(Nullcmd);
112 EXT CMD *eval_root INIT(Nullcmd);
120 extern struct compcmd Nullccmd;
122 struct compcmd Nullccmd = {Nullcmd, Nullcmd};