diff options
| author | 2024-04-25 21:24:10 +0100 | |
|---|---|---|
| committer | 2024-04-25 22:32:27 +0000 | |
| commit | 2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch) | |
| tree | 80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/CMD/RECOVER/RECPARSE.INC | |
| parent | Merge pull request #430 from jpbaltazar/typoptbr (diff) | |
| download | ms-dos-main.tar.gz ms-dos-main.tar.xz ms-dos-main.zip | |
Diffstat (limited to 'v4.0/src/CMD/RECOVER/RECPARSE.INC')
| -rw-r--r-- | v4.0/src/CMD/RECOVER/RECPARSE.INC | 177 |
1 files changed, 177 insertions, 0 deletions
diff --git a/v4.0/src/CMD/RECOVER/RECPARSE.INC b/v4.0/src/CMD/RECOVER/RECPARSE.INC new file mode 100644 index 0000000..dbe4712 --- /dev/null +++ b/v4.0/src/CMD/RECOVER/RECPARSE.INC | |||
| @@ -0,0 +1,177 @@ | |||
| 1 | |||
| 2 | const segment public para 'const' ;AC000;bgb | ||
| 3 | ;*************************************************************************** | ||
| 4 | ; Equates | ||
| 5 | ;*************************************************************************** | ||
| 6 | ; | ||
| 7 | ;Match Flags | ||
| 8 | Numeric_Value equ 8000h ; AN000 | ||
| 9 | Signed_Numeric_Value equ 4000h ; AN000 | ||
| 10 | Simple_String equ 2000h ; AN000 | ||
| 11 | Date_String equ 1000h ; AN000 | ||
| 12 | Time_String equ 0800h ; AN000 | ||
| 13 | Complex_List equ 0400h ; AN000 | ||
| 14 | Filespec equ 0200h ; AN000 | ||
| 15 | Drive_Only equ 0100h ; AN000 | ||
| 16 | Quoted_String equ 0080h ; AN000 | ||
| 17 | Ignore_Colon equ 0010h ; AN000 | ||
| 18 | Repeats_Allowed equ 0002h ; AN000 | ||
| 19 | Optional equ 0001h ; AN000 | ||
| 20 | |||
| 21 | ;Function_Flags | ||
| 22 | |||
| 23 | File_Table_Capitalize equ 1 ; AN000 | ||
| 24 | Char_Table_Capitalize equ 2 ; AN000 | ||
| 25 | Remove_Colon equ 10h ; AN000 | ||
| 26 | |||
| 27 | ;Extra delimeters and EOL | ||
| 28 | |||
| 29 | No_Extra_Delimiters equ 00h ; AN000;SM | ||
| 30 | Delimiters_Only equ 1 ; AN000 | ||
| 31 | EOL_Or_Delimiters equ 2 ; AN000 | ||
| 32 | |||
| 33 | Semi_Colon equ ";" ; AN000 | ||
| 34 | Tab equ 09h ; AN000 | ||
| 35 | Colon equ ":" ; AN000 | ||
| 36 | |||
| 37 | |||
| 38 | ;Parse Errors | ||
| 39 | |||
| 40 | No_Error equ 0 ; AN000 | ||
| 41 | Too_Many_Operands equ 1 ; AN000 | ||
| 42 | Operand_Missing equ 2 ; AN000 | ||
| 43 | Not_In_Switch_List equ 3 ; AN000 | ||
| 44 | Not_In_Keyword_List equ 4 ; AN000 | ||
| 45 | Out_Of_Range equ 6 ; AN000 | ||
| 46 | Not_In_Value_List equ 7 ; AN000 | ||
| 47 | Not_In_String_List equ 8 ; AN000 | ||
| 48 | Syntax_Error equ 9 ; AN000 | ||
| 49 | End_Of_Parse equ -1 ; AN000 | ||
| 50 | |||
| 51 | ;Return types | ||
| 52 | |||
| 53 | Type_Reserved equ 0 ; ;AN000; | ||
| 54 | Type_Number equ 1 ; ;AN000; | ||
| 55 | Type_List_Index equ 2 ; ;AN000; | ||
| 56 | Type_String equ 3 ; ;AN000; | ||
| 57 | Type_Complex equ 4 ; ;AN000; | ||
| 58 | Type_Filespec equ 5 ; ;AN000; | ||
| 59 | Type_Drive equ 6 ; ;AN000; | ||
| 60 | Type_Date equ 7 ; ;AN000; | ||
| 61 | Type_Time equ 8 ; ;AN000; | ||
| 62 | Type_Quoted_String equ 9 ; ;AN000; | ||
| 63 | |||
| 64 | |||
| 65 | ;Other | ||
| 66 | |||
| 67 | None equ 0 ; AN000 | ||
| 68 | No_Error equ 0 ; AN000 | ||
| 69 | Switch_Found equ 0FFFFh ; AN000 | ||
| 70 | Range_Ok equ 1 ; AN000 | ||
| 71 | Command_Line_Parms equ 81h ; AN000 | ||
| 72 | const ends ;AC000;bgb | ||
| 73 | |||
| 74 | data segment public para 'DATA' ;AC000;bgb | ||
| 75 | ;***************************************************************************** ;AN000;bgb | ||
| 76 | ;***************************************************************************** ;AN000;bgb | ||
| 77 | ; Parse Tables ;AN000;bgb | ||
| 78 | ;***************************************************************************** ;AN000;bgb | ||
| 79 | ;***************************************************************************** ;AN000;bgb | ||
| 80 | ; ;AN000;bgb | ||
| 81 | ;The following parse control block can be used for any command which ;AN000;bgb | ||
| 82 | ;needs only one optional file specification an operand. Returns a ;AN000;bgb | ||
| 83 | ;pointer to the unverified string in PARSE1_OUTPUT. Currently used ;AN000;bgb | ||
| 84 | ;for the RECOVER command. ;AN000;bgb | ||
| 85 | ;***************************************************************************** ;AN000;bgb | ||
| 86 | ;;;;db 'PARSE TABLE AREA' ;AN000;bgb | ||
| 87 | public parms_input_block, parms_ext_block, control_block, value_list_block | ||
| 88 | public results_block, parse_type, parse_code, parse_addr, | ||
| 89 | ;AN000;bgb | ||
| 90 | ;***************************************************************************** ;AN000;bgb | ||
| 91 | ; This is the parms input block pointed to by es:di before calling sysparse. ;AN000;bgb | ||
| 92 | ; it is the top level table. ;AN000;bgb | ||
| 93 | parms_input_block LABEL BYTE ;AN000;bgb | ||
| 94 | DW dg:parms_ext_block ; addr of parms extension block ;AN000;bgb | ||
| 95 | DB 0 ; no delimiters or eol chars ;AN000;bgb | ||
| 96 | ;AN000;bgb | ||
| 97 | ;***************************************************************************** ;AN000;bgb | ||
| 98 | ; This is the parms extension block pointed to by the parms input block. ;AN000;bgb | ||
| 99 | ; it defines the number and type of parameters allowed in the command line. ;AN000;bgb | ||
| 100 | parms_ext_block LABEL BYTE ;AN000;bgb | ||
| 101 | DB 1,1 ; only one positional parm ;AN000;bgb | ||
| 102 | DW dg:control_block ; addr of positional control block ;AN000;bgb | ||
| 103 | DB 0 ; no switches ;AN000;bgb | ||
| 104 | DB 0 ; no keywords ;AN000;bgb | ||
| 105 | ; ;AN000;bgb | ||
| 106 | ;PARSE control block for an optional file specification (upper cased) ;AN000;bgb | ||
| 107 | ;or drive number ;AN000;bgb | ||
| 108 | ; ;AN000;bgb | ||
| 109 | ;***************************************************************************** ;AN000;bgb | ||
| 110 | ; This is the control block for either drive letter "c:", or filename.ext, or ;AN000;bgb | ||
| 111 | ; both "c:filename.ext" entered in the command line. it is pointed to by the ;AN000;bgb | ||
| 112 | ; parms extension block. ;AN000;bgb | ||
| 113 | control_block LABEL BYTE ;AN000;bgb | ||
| 114 | Dw $p_file_spc+$p_drv_only ; allowable return values ;AN000;bgb | ||
| 115 | ; 0200 = filespec ;AN000;bgb | ||
| 116 | ; 0100 = drive only ;AN000;bgb | ||
| 117 | DW 1 ; capitalize - file table ;AN000;bgb | ||
| 118 | DW dg:results_block ; points to reults block ;AN000;bgb | ||
| 119 | DW dg:value_list_block ; point to valu list block ;AN000;bgb | ||
| 120 | DB 0 ; no keyword synonyms ;AN000;bgb | ||
| 121 | ; ;AN000;bgb | ||
| 122 | ;Indicates no value list for PARSE. ;AN000;bgb | ||
| 123 | ;***************************************************************************** ;AN000;bgb | ||
| 124 | ; This is the value list block pointed to by the control block. This table is ;AN000;bgb | ||
| 125 | ; used to define the type of numeric or string parameters expected. Since no ;AN000;bgb | ||
| 126 | ; parameters with numerics or strings are used, this block is set to zero. ;AN000;bgb | ||
| 127 | value_list_block DW 0 ;AN000; no values ;AN000;bgb | ||
| 128 | ;AN000;bgb | ||
| 129 | ; ;AN000;bgb | ||
| 130 | ;Common output blocks for PARSE number, complex, or string values. ;AN000;bgb | ||
| 131 | ;***************************************************************************** ;AN000;bgb | ||
| 132 | ; This is the results block pointed to by the control block. ;AN000;bgb | ||
| 133 | ; both "c:filename.ext" entered in the command line. it is pointed to by the ;AN000;bgb | ||
| 134 | ; parms extension block. ;AN000;bgb | ||
| 135 | results_block LABEL BYTE ;AN000; ;AN000;bgb | ||
| 136 | PARSE_TYPE DB 0 ; type of parm returned ;AN000;bgb | ||
| 137 | PARSE_CODE DB 0 ; matched item tag / return valu ;AN000;bgb | ||
| 138 | PARSE_SYN DW 0 ; es offset of synonym ;AN000;bgb | ||
| 139 | PARSE_ADDR DD 0 ; either a numeric value, or ;AN000;bgb | ||
| 140 | dd 0 ;parser puts in too many;the offset of string value ;AN000;bgb | ||
| 141 | |||
| 142 | ;;;;DB 'PARSE AREA ENDS' | ||
| 143 | data ends ;AN000;bgb | ||
| 144 | ;AN000;bgb | ||
| 145 | ; ;AN000; | ||
| 146 | code segment PUBLIC para 'CODE' ;AC000;bgb ;AN000; | ||
| 147 | ;***************************************************************************** ;AN000; | ||
| 148 | ; SysParse Routines ;AN000; | ||
| 149 | ;***************************************************************************** ;AN000; | ||
| 150 | FarSW equ Not_Include ; ;AN000; | ||
| 151 | DateSW equ Not_Include ; ;AN000; | ||
| 152 | TimeSW equ Not_Include ; ;AN000; | ||
| 153 | FileSW equ Do_Include ; ;AN000; | ||
| 154 | CAPSW equ Not_Include ; ;AN000; | ||
| 155 | CmpxSW equ Not_Include ; ;AN000; | ||
| 156 | NumSW equ Not_Include ; ;AN000; | ||
| 157 | KeySW equ Not_Include ; ;AN000; | ||
| 158 | SwSW equ Not_Include ; ;AN000; | ||
| 159 | Val1SW equ Not_Include ; ;AN000; | ||
| 160 | Val2SW equ Not_Include ; ;AN000; | ||
| 161 | Val3SW equ Not_Include ; ;AN000; | ||
| 162 | DrvSW equ Do_Include ; ;AN000; | ||
| 163 | QusSW equ Not_Include ; | ||
| 164 | basesw equ 1 ;use ds as the default register ;an040;bgb | ||
| 165 | incsw equ 0 ;include psdata myself ;an040;bgb | ||
| 166 | code ends ;an040;bgb | ||
| 167 | ;an040;bgb | ||
| 168 | ;an040;bgb | ||
| 169 | data segment PUBLIC para 'DATA' ;an040;bgb | ||
| 170 | include psdata.inc ;an040;bgb | ||
| 171 | data ends ;an040;bgb | ||
| 172 | ;an040;bgb | ||
| 173 | code segment PUBLIC para 'CODE' ;an040;bgb | ||
| 174 | pathlabl parser ;an040;bgb | ||
| 175 | INCLUDE PARSE.ASM ;AN000; ;an040;bgb | ||
| 176 | pathlabl parser ;an040;bgb | ||
| 177 | code ends ;an040;bgb | ||