diff options
Diffstat (limited to 'v4.0/src/CMD/MEM/PARSE.H')
| -rw-r--r-- | v4.0/src/CMD/MEM/PARSE.H | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/v4.0/src/CMD/MEM/PARSE.H b/v4.0/src/CMD/MEM/PARSE.H new file mode 100644 index 0000000..ec4f4eb --- /dev/null +++ b/v4.0/src/CMD/MEM/PARSE.H | |||
| @@ -0,0 +1,144 @@ | |||
| 1 | /* */ | ||
| 2 | /*----------------------------------------------------------------------+ | ||
| 3 | | | | ||
| 4 | | This file contains the structures and defines that are needed to use | | ||
| 5 | | the parser from a C program. | | ||
| 6 | | | | ||
| 7 | | | | ||
| 8 | | Date: 5-21-87 | | ||
| 9 | | | | ||
| 10 | +----------------------------------------------------------------------*/ | ||
| 11 | |||
| 12 | |||
| 13 | #define p_len_parms 4 /* length of p_parms */ | ||
| 14 | #define p_i_use_default 0 /* no extra stuff specified */ | ||
| 15 | #define p_i_have_delim 1 /* extra delimiter specified */ | ||
| 16 | #define p_i_have_eol 2 /* extra EOL specified */ | ||
| 17 | |||
| 18 | struct p_parms | ||
| 19 | { | ||
| 20 | struct p_parmsx *p_parmsx_address; /* address of p_parmsx */ | ||
| 21 | unsigned char p_num_extra; /* number of extra stuff */ | ||
| 22 | unsigned char p_len_extra_delim; /* length of extra delimiter */ | ||
| 23 | char p_extra_delim[30]; /* extra delimiters */ | ||
| 24 | }; | ||
| 25 | |||
| 26 | struct p_parmsx | ||
| 27 | { | ||
| 28 | unsigned char p_minp; /* Minimum positional number */ | ||
| 29 | unsigned char p_maxp; /* Maximum positional number */ | ||
| 30 | unsigned char p_maxswitch; /* Maximum switches */ | ||
| 31 | struct p_control_blk *p_control[2]; /* Address of the 1st CONTROL block */ | ||
| 32 | unsigned char p_keyword; /* Keyword count */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | |||
| 36 | struct p_control_blk | ||
| 37 | { | ||
| 38 | unsigned int p_match_flag; /* Controls type matched */ | ||
| 39 | unsigned int p_function_flag; /* Function should be taken */ | ||
| 40 | unsigned int p_result_buf; /* Result buffer address */ | ||
| 41 | unsigned int p_value_list; /* Value list address */ | ||
| 42 | unsigned char p_nid; /* # of keyword/SW synonyms */ | ||
| 43 | char p_keyorsw[64]; /* keyword or sw */ | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* Match_Flags */ | ||
| 47 | |||
| 48 | #define p_num_val 0x8000 /* Numeric Value */ | ||
| 49 | #define p_snum_val 0x4000 /* Signed numeric value */ | ||
| 50 | #define p_simple_s 0x2000 /* Simple string */ | ||
| 51 | #define p_date_s 0x1000 /* Date string */ | ||
| 52 | #define p_time_s 0x0800 /* Time string */ | ||
| 53 | #define p_cmpx_s 0x0400 /* Complex string */ | ||
| 54 | #define p_file_spc 0x0200 /* File Spec */ | ||
| 55 | #define p_drv_only 0x0100 /* Drive Only */ | ||
| 56 | #define p_qu_string 0x0080 /* Quoted string */ | ||
| 57 | #define p_ig_colon 0x0010 /* Ignore colon at end in match */ | ||
| 58 | #define p_repeat 0x0002 /* Repeat allowed */ | ||
| 59 | #define p_optional 0x0001 /* Optional */ | ||
| 60 | #define p_none 0x0000 | ||
| 61 | |||
| 62 | /*----------------------------------------------------------------------+ | ||
| 63 | | | | ||
| 64 | | Function flags | | ||
| 65 | | | | ||
| 66 | +----------------------------------------------------------------------*/ | ||
| 67 | |||
| 68 | #define p_cap_file 0x0001 /* CAP result by file table */ | ||
| 69 | #define p_cap_char 0x0002 /* CAP result by character table */ | ||
| 70 | #define p_rm_colon 0x0010 /* Remove ":" at the end */ | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | #define p_nval_none 0 /* no value list ID */ | ||
| 75 | #define p_nval_range 1 /* range list ID */ | ||
| 76 | #define p_nval_value 2 /* value list ID */ | ||
| 77 | #define p_nval_string 3 /* string list ID */ | ||
| 78 | #define p_len_range 9 /* Length of a range choice(two DD plus one DB) */ | ||
| 79 | #define p_len_value 5 /* Length of a value choice(one DD plus one DB) */ | ||
| 80 | #define p_len_string 3 /* Length of a string choice(one DW plus one DB) */ | ||
| 81 | |||
| 82 | /*----------------------------------------------------------------------+ | ||
| 83 | | | | ||
| 84 | | Value block structure | | ||
| 85 | | | | ||
| 86 | +----------------------------------------------------------------------*/ | ||
| 87 | |||
| 88 | struct p_value_blk | ||
| 89 | { | ||
| 90 | unsigned char p_val_num; | ||
| 91 | }; | ||
| 92 | |||
| 93 | |||
| 94 | /*----------------------------------------------------------------------+ | ||
| 95 | | | | ||
| 96 | | Result block structure | | ||
| 97 | | | | ||
| 98 | +----------------------------------------------------------------------*/ | ||
| 99 | |||
| 100 | struct p_result_blk | ||
| 101 | { | ||
| 102 | unsigned char P_Type; /* Type returned */ | ||
| 103 | unsigned char P_Item_Tag; /* Matched item tag */ | ||
| 104 | unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */ | ||
| 105 | unsigned long int p_result_buff; /* result value */ | ||
| 106 | }; | ||
| 107 | |||
| 108 | /*----------------------------------------------------------------------+ | ||
| 109 | | | | ||
| 110 | | type | | ||
| 111 | | | | ||
| 112 | +----------------------------------------------------------------------*/ | ||
| 113 | |||
| 114 | #define p_eol 0 /* End of line */ | ||
| 115 | #define p_number 1 /* Number */ | ||
| 116 | #define p_list_idx 2 /* List Index */ | ||
| 117 | #define p_string 3 /* String */ | ||
| 118 | #define p_complex 4 /* Complex */ | ||
| 119 | #define p_file_spec 5 /* File Spec */ | ||
| 120 | #define p_drive 6 /* Drive */ | ||
| 121 | #define p_date_f 7 /* Date */ | ||
| 122 | #define p_time_f 8 /* Time */ | ||
| 123 | #define p_quoted_string 9 /* Quoted String */ | ||
| 124 | |||
| 125 | #define p_no_tag 0x0FF /* No ITEM_TAG found */ | ||
| 126 | |||
| 127 | /*----------------------------------------------------------------------+ | ||
| 128 | | | | ||
| 129 | | following return code will be returned in the AX register. | | ||
| 130 | | | | ||
| 131 | +----------------------------------------------------------------------*/ | ||
| 132 | |||
| 133 | #define p_no_error 0 /* No error */ | ||
| 134 | #define p_too_many 1 /* Too many operands */ | ||
| 135 | #define p_op_missing 2 /* Required operand missing */ | ||
| 136 | #define p_not_in_sw 3 /* Not in switch list provided */ | ||
| 137 | #define p_not_in_key 4 /* Not in keyword list provided */ | ||
| 138 | #define p_out_of_range 6 /* Out of range specified */ | ||
| 139 | #define p_not_in_val 7 /* Not in value list provided */ | ||
| 140 | #define p_not_in_str 8 /* Not in string list provided */ | ||
| 141 | #define p_syntax 9 /* Syntax error */ | ||
| 142 | #define p_rc_eol 0x0ffff /* End of command line */ | ||
| 143 | |||
| 144 | |||