]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/CMD/EXE2BIN/E2BPARSE.INC

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / CMD / EXE2BIN / E2BPARSE.INC
1
2
3
4 data segment public 'DATA'
5
6
7
8 ;
9 ;***************************************************************************
10 ; Equates
11 ;***************************************************************************
12 ;
13
14 ;Match Flags
15
16 Numeric_Value equ 8000h ; ;AN000;
17 Signed_Numeric_Value equ 4000h ; ;AN000;
18 Simple_String equ 2000h ; ;AN000;
19 Date_String equ 1000h ; ;AN000;
20 Time_String equ 0800h ; ;AN000;
21 Complex_List equ 0400h ; ;AN000;
22 Filespec equ 0200h ; ;AN000;
23 Drive_Only equ 0100h ; ;AN000;
24 Quoted_String equ 0080h ; ;AN000;
25 Ignore_Colon equ 0010h ; ;AN000;
26 Repeats_Allowed equ 0002h ; ;AN000;
27 Optional equ 0001h ; ;AN000;
28
29 ;Function_Flags
30
31 File_Table_Capitalize equ 1 ; ;AN000;
32
33 ;Result buffer type returned
34 rb_Number equ 1
35 rb_List_Index equ 2
36 rb_String equ 3
37 rb_Complex equ 4
38 rb_Filespec equ 5
39 rb_Drive equ 6
40 rb_Date equ 7
41 rb_Time equ 8
42 rb_Quoted_String equ 9
43
44
45 ;Extra delimeters and EOL
46
47 Delimiters_Only equ 1 ; ;AN000;
48 EOL_Or_Delimiters equ 2 ; ;AN000;
49
50 Semi_Colon equ ";" ; ;AN000;
51 Tab equ 09h ; ;AN000;
52 Colon1 equ ":" ; ;AN000;
53 NUL equ "0"
54
55 ;Parse Errors
56
57 No_Error equ 0 ; ;AN000;
58 Too_Many_Operands equ 1 ; ;AN000;
59 Operand_Missing equ 2 ; ;AN000;
60 Not_In_Switch_List equ 3 ; ;AN000;
61 Not_In_Keyword_List equ 4 ; ;AN000;
62 Out_Of_Range equ 6 ; ;AN000;
63 Not_In_Value_List equ 7 ; ;AN000;
64 Not_In_String_List equ 8 ; ;AN000;
65 Syntax_Error equ 9 ; ;AN000;
66 End_Of_Parse equ -1 ; ;AN000;
67
68 ;Other
69
70 None equ 0 ; ;AN000;
71 No_Error equ 0 ; ;AN000;
72 Switch_Found equ 0FFFFh ; ;AN000;
73 Range_Ok equ 1 ; ;AN000;
74 Command_Line_Parms equ 81h ; ;AN000;
75
76 ;
77 ;*****************************************************************************
78 ; Parse Structures
79 ;*****************************************************************************
80 ;
81
82 Control struc
83
84 Match_Flags dw ?
85 Function_Flags dw ?
86 Result dw ?
87 Values dw ?
88 Num_Keywords db ?
89 Keyword db ?
90
91 Control ends
92
93 File_Name_Return struc ; ;AN000;
94
95 Drive_Type db 0 ; ;AN000;
96 Drive_Item_Tag db 0 ; ;AN000;
97 Synonym dw 0 ; ;AN000;
98 String_Value_ptr db 0 ;File Name ;AN000;
99
100 File_Name_Return ends ; ;AN000;
101
102
103 ;
104 ;**************************************************************************
105 ; Parse tables
106 ;**************************************************************************
107 ;
108
109 Command_Line_Table label byte ; ;AN000;
110
111 dw Command_Control ;Point to next level ;AN000;
112 db Delimiters_Only ; ;AN000;
113 db 1 ; ;AN000;
114 db Semi_Colon ; ;AN000;
115
116
117 ;
118 ;**************************************************************************
119 ; Define Positionals, Switches and Keywords
120 ;**************************************************************************
121 ;
122
123 Command_Control label byte ; ;AN000;
124
125 db 1,2 ;File names Positional (1 required) ;AN000;
126 dw Positional_Control1 ;Pointer to control table ;AN000;
127 dw Positional_Control2 ;Pointer to control table ;AN000;
128 db None ;no switches ;AN000;
129 db None ;No Keywords (maxk) ;AN000;
130
131 ;
132 ;**************************************************************************
133 ;Control Tables
134 ;**************************************************************************
135 ;
136
137 Positional_Control1 label byte ; ;AN000;
138
139 dw Filespec ;Match_Flag ;AN000;
140 dw File_Table_Capitalize ;No function flags ;AN000;
141 dw File_Name_Buffer1 ;Where it will be returned ;AN000;
142 dw No_Value ;No value ranges defined ;AN000;
143 db None ;No defined switches/keywords ;AN000;
144
145 Positional_Control2 label byte ; ;AN000;
146
147 dw Filespec+Optional ;Match_Flag ;AN000;
148
149 dw File_Table_Capitalize ;No function flags ;AN000;
150 dw File_Name_Buffer2 ;Where it will be returned ;AN000;
151 dw No_Value ;No value ranges defined ;AN000;
152 db None ;No defined switches/keywords ;AN000;
153
154 No_Value label byte ; ;AN000;
155 db 0 ; ;AN000;
156
157 ;
158 ;************************************************************************
159 ; PARSE Return Buffers
160 ;************************************************************************
161 ;
162 File_name_Buffer1 label byte ; ;AN000;
163
164 rb_type1 db 0 ;type returned ;AN000;
165 rb_item_tag1 db 0 ;matched item tag ;AN000;
166 rb_synonym1 dw 0 ;found synonyms ;AN000;
167 rb_string1_off dw 0 ;Offset of string ;AN000;
168 rb_string1_seg dw 0 ;Offset of string ;AN000;
169
170 File_name_Buffer2 label byte ; ;AN000;
171
172 rb_type2 db 0 ;type returned ;AN000;
173 rb_item_tag2 db 0 ;matched item tag ;AN000;
174 rb_synonym2 dw 0 ;found synonyms ;AN000;
175 rb_string2_off dw 0 ;Offset of string ;AN000;
176 rb_string2_seg dw 0 ;Offset of string ;AN000;
177
178 data ends
179
180 \1a