1: /* $Header: cmd.h,v 1.0 87/12/18 13:04:59 root Exp $
   2:  *
   3:  * $Log:	cmd.h,v $
   4:  * Revision 1.0  87/12/18  13:04:59  root
   5:  * Initial revision
   6:  *
   7:  */
   8: 
   9: #define C_NULL 0
  10: #define C_IF 1
  11: #define C_WHILE 2
  12: #define C_EXPR 3
  13: #define C_BLOCK 4
  14: 
  15: #ifndef DOINIT
  16: extern char *cmdname[];
  17: #else
  18: char *cmdname[] = {
  19:     "NULL",
  20:     "IF",
  21:     "WHILE",
  22:     "EXPR",
  23:     "BLOCK",
  24:     "5",
  25:     "6",
  26:     "7",
  27:     "8",
  28:     "9",
  29:     "10",
  30:     "11",
  31:     "12",
  32:     "13",
  33:     "14",
  34:     "15",
  35:     "16"
  36: };
  37: #endif
  38: 
  39: #define CF_OPTIMIZE 077 /* type of optimization */
  40: #define CF_FIRSTNEG 0100/* conditional is ($register NE 'string') */
  41: #define CF_NESURE 0200  /* if first doesn't match we're sure */
  42: #define CF_EQSURE 0400  /* if first does match we're sure */
  43: #define CF_COND 01000   /* test c_expr as conditional first, if not null. */
  44:             /* Set for everything except do {} while currently */
  45: #define CF_LOOP 02000   /* loop on the c_expr conditional (loop modifiers) */
  46: #define CF_INVERT 04000 /* it's an "unless" or an "until" */
  47: #define CF_ONCE 010000  /* we've already pushed the label on the stack */
  48: #define CF_FLIP 020000  /* on a match do flipflop */
  49: 
  50: #define CFT_FALSE 0 /* c_expr is always false */
  51: #define CFT_TRUE 1  /* c_expr is always true */
  52: #define CFT_REG 2   /* c_expr is a simple register */
  53: #define CFT_ANCHOR 3    /* c_expr is an anchored search /^.../ */
  54: #define CFT_STROP 4 /* c_expr is a string comparison */
  55: #define CFT_SCAN 5  /* c_expr is an unanchored search /.../ */
  56: #define CFT_GETS 6  /* c_expr is $reg = <filehandle> */
  57: #define CFT_EVAL 7  /* c_expr is not optimized, so call eval() */
  58: #define CFT_UNFLIP 8    /* 2nd half of range not optimized */
  59: #define CFT_CHOP 9  /* c_expr is a chop on a register */
  60: 
  61: #ifndef DOINIT
  62: extern char *cmdopt[];
  63: #else
  64: char *cmdopt[] = {
  65:     "FALSE",
  66:     "TRUE",
  67:     "REG",
  68:     "ANCHOR",
  69:     "STROP",
  70:     "SCAN",
  71:     "GETS",
  72:     "EVAL",
  73:     "UNFLIP",
  74:     "CHOP",
  75:     "10"
  76: };
  77: #endif
  78: 
  79: struct acmd {
  80:     STAB    *ac_stab;   /* a symbol table entry */
  81:     ARG     *ac_expr;   /* any associated expression */
  82: };
  83: 
  84: struct ccmd {
  85:     CMD     *cc_true;   /* normal code to do on if and while */
  86:     CMD     *cc_alt;    /* else code or continue code */
  87: };
  88: 
  89: struct cmd {
  90:     CMD     *c_next;    /* the next command at this level */
  91:     ARG     *c_expr;    /* conditional expression */
  92:     CMD     *c_head;    /* head of this command list */
  93:     STR     *c_first;   /* head of string to match as shortcut */
  94:     STAB    *c_stab;    /* a symbol table entry, mostly for fp */
  95:     SPAT    *c_spat;    /* pattern used by optimization */
  96:     char    *c_label;   /* label for this construct */
  97:     union ucmd {
  98:     struct acmd acmd;   /* normal command */
  99:     struct ccmd ccmd;   /* compound command */
 100:     } ucmd;
 101:     short   c_flen;     /* len of c_first, if not null */
 102:     short   c_flags;    /* optimization flags--see above */
 103:     char    c_type;     /* what this command does */
 104: };
 105: 
 106: #define Nullcmd Null(CMD*)
 107: 
 108: EXT CMD *main_root INIT(Nullcmd);
 109: 
 110: EXT struct compcmd {
 111:     CMD *comp_true;
 112:     CMD *comp_alt;
 113: };
 114: 
 115: #ifndef DOINIT
 116: extern struct compcmd Nullccmd;
 117: #else
 118: struct compcmd Nullccmd = {Nullcmd, Nullcmd};
 119: #endif
 120: void opt_arg();
 121: void evalstatic();
 122: STR *cmd_exec();

Defined variables

Nullccmd declared in line 116; defined in line 118; never used
cmdname declared in line 16; defined in line 18; used 3 times
cmdopt declared in line 62; defined in line 64; used 1 times

Defined struct's

acmd defined in line 79; used 2 times
  • in line 98(2)
ccmd defined in line 84; used 2 times
  • in line 99(2)
cmd defined in line 89; used 2 times
compcmd defined in line 110; used 6 times

Defined union's

ucmd defined in line 97; never used

Defined macros

CFT_ANCHOR defined in line 53; never used
CFT_CHOP defined in line 59; never used
CFT_EVAL defined in line 57; never used
CFT_FALSE defined in line 50; never used
CFT_GETS defined in line 56; never used
CFT_REG defined in line 52; never used
CFT_SCAN defined in line 55; never used
CFT_STROP defined in line 54; never used
CFT_TRUE defined in line 51; never used
CFT_UNFLIP defined in line 58; never used
CF_ONCE defined in line 47; used 6 times
C_EXPR defined in line 12; used 4 times
C_NULL defined in line 9; used 1 times
C_WHILE defined in line 11; used 5 times

Usage of this include

Last modified: 1988-01-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1071
Valid CSS Valid XHTML 1.0 Strict