| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946 |
- Listing:
- 1 (* Release 3.10 *)
- 2 (*-------------------------------------------------------------------------*
- 3 * *
- 4 * SCANNER.MOD - COMMS Toolkit script file scanner *
- 5 * *
- 6 * COPYRIGHT (C) 1988..1992 Clarion Software Corporation. *
- 7 * All Rights Reserved *
- 8 * *
- 9 *--------------------------------------------------------------------------*)
- 10
- 11 (*# check(range=>off,overflow=>off,index=>off)*)
- 12 IMPLEMENTATION MODULE Scanner;
- 13 IMPORT Lib,Str,IO,Window;
- 14 FROM Window IMPORT Color;
- ***** ^ duplicate identifier
- 15
- 16 CONST
- 17 MaxResWords = 70;
- 18 TAB = 11C;
- 19 ErrWin = Window.WinDef(5,5,74,19,White,Red,TRUE,FALSE,FALSE,TRUE,Window.SingleFrame,White,Red);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 20
- 21 TYPE
- 22 LineBuff = ARRAY[0..255] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 23 ResWordRec = RECORD
- 24 WordId : ARRAY[0..20] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 25 RSy : Symbols;
- ***** ^ undeclared identifier
- 26 END;
- ***** ^ not supported yet
- 27
- 28 VAR
- 29 Ch : CHAR;
- 30 FirstSymOnLine : BOOLEAN;
- 31 Stdwords,Lnth,Max : CARDINAL;
- 32 TokenPos,LineLength,
- 33 LineIndex,LineNumber: CARDINAL;
- 34 History : ARRAY[0..3] OF LineBuff;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 35 CurrentLine : LineBuff;
- ***** ^ not supported yet
- 36 Reswords : ARRAY[0..MaxResWords-1] OF ResWordRec;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 37
- 38 (*................................................*)
- 39
- 40 PROCEDURE ShowTokenPos;
- 41 VAR
- 42 i : CARDINAL;
- 43 Blank : LineBuff;
- ***** ^ not supported yet
- 44 BEGIN
- 45 FOR i:=0 TO 3 DO
- 46 IO.WrStr(History[i]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 47 IO.WrLn;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 48 END;
- 49 IF TokenPos<=80 THEN
- 50 CurrentLine[LineLength] := 0C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 51 IO.WrStr(CurrentLine);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 52 IO.WrLn;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 53 IF TokenPos>0 THEN
- 54 Lib.Fill(ADR(Blank),TokenPos,' ');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 55 END;
- 56 Blank[TokenPos]:='^';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 57 Blank[TokenPos+1]:=0C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 58 IO.WrStr(Blank);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 59 IO.WrLn;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 60 END;
- 61 END ShowTokenPos;
- ***** ^ not supported yet
- 62
- 63 (*................................................*)
- 64
- 65 PROCEDURE WriteCard(c:CARDINAL);
- 66 BEGIN
- 67 IF c>9 THEN
- 68 WriteCard(c DIV 10);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 69 END;
- 70 IO.WrChar(CHR((c MOD 10)+48));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 71 END WriteCard;
- ***** ^ not supported yet
- 72
- 73 (*................................................*)
- 74
- 75 PROCEDURE Error(Errnum:CARDINAL);
- 76 VAR
- 77 Ch : CHAR;
- 78 Err : Window.WinType;
- ***** ^ not supported yet
- 79 s : ARRAY[0..79] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 80 BEGIN
- 81 IF GotError THEN
- ***** ^ undeclared identifier
- 82 RETURN;
- 83 END;
- 84 Err := Window.Open(ErrWin);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 85 Window.GotoXY(1,2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 86 ShowTokenPos;
- ***** ^ not supported yet
- 87 IO.WrLn;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 88 IO.WrStr('Error ');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 89 WriteCard(Errnum);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 90 IO.WrStr(': ');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 91 CASE Errnum OF
- 92 1 : s:='String constant must not exceed source line';|
- ***** ^ not supported yet
- ***** ^ not supported yet
- 93 2 : s:='Illegal char in text'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 94 3 : s:='This Symbol not expected here'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 95 4 : s:='Value too large! (max 255)'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 96 5 : s:='String variable expected'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 97 6 : s:='String or String variable expected'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 98 7 : s:='Value out of range'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 99 8 : s:='Parameter Missing'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 100 9 : s:='DIAL command not supported.'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 101 10 : s:='Unknown File Protocol'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 102 11 : s:='Label already defined!'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 103 12 : s:='Label or Statement expected'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 104 13 : s:='Label name expected'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 105 14 : s:='Switch statement must have only one default!';|
- ***** ^ not supported yet
- ***** ^ not supported yet
- 106 15 : s:='Could not open Script file.'; |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 107 ELSE
- 108 s:='Unknown error (program bug)';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 109 END;
- 110 IO.WrStr(s);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 111 IO.WrLn;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 112 IO.WrLn;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 113 IO.WrStr('Press any key...');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 114 Ch:=IO.RdKey();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 115 Window.Close(Err);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 116 GotError := TRUE;
- ***** ^ undeclared identifier
- 117 END Error;
- ***** ^ not supported yet
- 118
- 119 (*................................................*)
- 120
- 121 PROCEDURE StrCompare(VAR S1,S2:ARRAY OF CHAR):INTEGER;
- ***** ^ not supported yet
- 122 VAR
- 123 i,Chrs,Lnth1,Lnth2,
- 124 diff : INTEGER;
- 125 Ch1,Ch2 : CHAR;
- 126 BEGIN
- 127 Lnth1:=Str.Length(S1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 128 Lnth2:=Str.Length(S2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 129 IF Lnth1>8 THEN
- 130 Lnth1:=8;
- 131 END;
- 132 IF Lnth2>8 THEN
- 133 Lnth2:=8;
- 134 END;
- 135 diff := Lnth1-Lnth2;
- 136 IF Lnth1<Lnth2 THEN
- 137 Chrs:=Lnth1;
- 138 ELSE
- 139 Chrs:=Lnth2;
- 140 END;
- 141 i:=0;
- 142 WHILE i<Chrs DO
- 143 Ch1:=CAP(S1[i]);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 144 Ch2:=CAP(S2[i]);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 145 IF Ch1<>Ch2 THEN
- 146 RETURN INTEGER(ORD(Ch1))-INTEGER(ORD(Ch2));
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 147 END;
- 148 INC(i);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 149 END;
- 150 RETURN diff;
- 151 END StrCompare;
- ***** ^ not supported yet
- 152
- 153 (*.................................................*)
- 154
- 155 PROCEDURE InitSymbolTable;
- 156
- 157 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 158
- 159 PROCEDURE Symbol(Tipe:Symbols; Name:ARRAY OF CHAR);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 160 BEGIN
- 161 WITH Reswords[Stdwords] DO
- ***** ^ not supported yet
- ***** ^ not supported yet
- 162 Lib.Move(ADR(Name),ADR(WordId),Str.Length(Name)+1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 163 RSy:=Tipe;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 164 END;
- ***** ^ not supported yet
- 165 INC(Stdwords);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 166 END Symbol;
- ***** ^ not supported yet
- 167
- 168 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 169
- 170 BEGIN (* InitSymbolTable *)
- 171 Stdwords := 0;
- 172 (* NOTE: because I was too lazy to include a sort procedure to be *)
- 173 (* used once only, the words in this reserved word table have been *)
- 174 (* manually entered in alphabetical order. Be careful when adding *)
- 175 (* new words! *)
- 176 Symbol(AlarmSy,'ALARM');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 177 Symbol(FTAscii,'ASCII');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 178 Symbol(AssignSy,'ASSIGN');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 179 Symbol(BreakSy,'BREAK');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 180 Symbol(FTBYmodem,'BYMODEM');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 181 Symbol(CaseSy,'CASE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 182 Symbol(ChDirSy,'CHDIR');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 183 Symbol(ClearSy,'CLEAR');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 184 Symbol(CloseSy,'CLOSE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 185 Symbol(ConnectSy,'CONNECTED');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 186 Symbol(CWhenSy,'CWHEN');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 187 Symbol(DefaultSy,'DEFAULT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 188 Symbol(DialSy,'DIAL');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 189 Symbol(DosSy,'DOS');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 190 Symbol(ElseSy,'ELSE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 191 Symbol(EmulateSy,'EMULATE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 192 Symbol(EndCaseSy,'ENDCASE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 193 Symbol(EndifSy,'ENDIF');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 194 Symbol(EndSwitchSy,'ENDSWITCH');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 195 Symbol(ExecuteSy,'EXECUTE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 196 Symbol(ExitSy,'EXIT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 197 Symbol(FailureSy,'FAILURE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 198 Symbol(FindSy,'FIND');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 199 Symbol(FoundSy,'FOUND');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 200 Symbol(GetSy,'GET');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 201 Symbol(GetFileSy,'GETFILE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 202 Symbol(GosubSy,'GOSUB');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 203 Symbol(GotoSy,'GOTO');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 204 Symbol(HangupSy,'HANGUP');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 205 Symbol(HostSy,'HOST');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 206 Symbol(IfSy,'IF');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 207 Symbol(IsFileSy,'ISFILE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 208 Symbol(FTKermit,'KERMIT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 209 Symbol(KermServSy,'KERMSERV');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 210 Symbol(KFlushSy,'KFLUSH');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 211 Symbol(LinkedSy,'LINKED');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 212 Symbol(LocateSy,'LOCATE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 213 Symbol(LogSy,'LOG');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 214 Symbol(MacroSy,'MACRO');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 215 Symbol(MessageSy,'MESSAGE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 216 Symbol(MGetSy,'MGET');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 217 Symbol(MLoadSy,'MLOAD');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 218 Symbol(NotSy,'NOT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 219 Symbol(OffSy,'OFF');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 220 Symbol(OnSy,'ON');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 221 Symbol(OpenSy,'OPEN');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 222 Symbol(PauseSy,'PAUSE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 223 Symbol(PrinterSy,'PRINTER');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 224 Symbol(QuitSy,'QUIT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 225 Symbol(ResumeSy,'RESUME');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 226 Symbol(ReturnSy,'RETURN');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 227 Symbol(RFlushSy,'RFLUSH');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 228 Symbol(RGetSy,'RGET');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 229 Symbol(RunSy,'RUN');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 230 Symbol(SendFileSy,'SENDFILE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 231 Symbol(SetSy,'SET');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 232 Symbol(SnapshotSy,'SNAPSHOT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 233 Symbol(SuccessSy,'SUCCESS');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 234 Symbol(SuspendSy,'SUSPEND');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 235 Symbol(SwitchSy,'SWITCH');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 236 Symbol(TraceSy,'TRACE');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 237 Symbol(TransmitSy,'TRANSMIT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 238 Symbol(WaitSy,'WAIT');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 239 Symbol(WaitForSy,'WAITFOR');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 240 Symbol(WhenSy,'WHEN');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 241 Symbol(FTWXmodem,'WXMODEM');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 242 Symbol(FTXmodem,'XMODEM');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 243 Symbol(FTYmodem,'YMODEM');
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 244 END InitSymbolTable;
- ***** ^ not supported yet
- 245
- 246 (*.................................................*)
- 247
- 248 PROCEDURE InitScanner;
- 249 VAR
- 250 i : CARDINAL;
- 251 BEGIN
- 252 FOR i:=0 TO 3 DO
- 253 History[i,0] := 0C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 254 END;
- 255 CurrentLine[0] := 0C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 256 Stdwords := 0;
- 257 InitSymbolTable;
- ***** ^ not supported yet
- 258 LineLength := 0;
- 259 LineNumber := 0;
- 260 LineIndex := 0FFFFH;
- 261 FirstSymOnLine := TRUE;
- 262 GotError := FALSE;
- ***** ^ undeclared identifier
- 263 END InitScanner;
- ***** ^ not supported yet
- 264
- 265 (*................................................*)
- 266
- 267 PROCEDURE GetChar(VAR Ch:CHAR);
- 268 VAR
- 269 i : CARDINAL;
- 270 BEGIN
- 271 IF LineIndex>LineLength THEN
- 272 IF FIO.EOF THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 273 Ch:=0C;
- 274 LineIndex:=0FFFFH;
- 275 LineLength:=0;
- 276 RETURN
- 277 END;
- 278 FOR i:=0 TO 2 DO
- 279 History[i] := History[i+1];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 280 END;
- 281 History[3] := CurrentLine;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 282 History[3,LineLength] := 0C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 283 FIO.RdStr(infile,CurrentLine);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 284 IF FIO.EOF THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 285 Ch := 0C;
- 286 RETURN;
- 287 END; (*IF*)
- 288 INC(LineNumber);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 289 LineLength := Str.Length(CurrentLine);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 290 CurrentLine[LineLength] := CHR(13);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 291 LineIndex := Lib.ScanNeR(ADR(CurrentLine),LineLength,' ');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 292 FirstSymOnLine := TRUE;
- 293 END;
- 294 Ch := CurrentLine[LineIndex];
- ***** ^ not supported yet
- ***** ^ not supported yet
- 295 INC(LineIndex);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 296 END GetChar;
- ***** ^ not supported yet
- 297
- 298 (*................................................*)
- 299
- 300 PROCEDURE PushBack;
- 301 BEGIN
- 302 IF LineIndex>0 THEN
- 303 DEC(LineIndex);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 304 END;
- 305 END PushBack;
- ***** ^ not supported yet
- 306
- 307 (*................................................*)
- 308
- 309 PROCEDURE GetSym;
- 310 VAR
- 311 GotSym : BOOLEAN;
- 312
- 313 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 314
- 315 PROCEDURE AddChar(VAR S:ARRAY OF CHAR; Ch:CHAR);
- ***** ^ not supported yet
- 316 BEGIN
- 317 IF Lnth<Max THEN
- 318 S[Lnth]:=Ch;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 319 INC(Lnth);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 320 S[Lnth]:=0C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 321 END;
- 322 END AddChar;
- ***** ^ not supported yet
- 323
- 324 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 325
- 326 PROCEDURE CopyString;
- 327 VAR
- 328 QuoteChar : CHAR;
- 329 BEGIN
- 330 QuoteChar:=Ch;
- 331 Lnth:=0;
- 332 Max:=255;
- 333 Sy:=StringConst;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 334 REPEAT
- 335 GetChar(Ch);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 336 IF (Ch=0C) OR (Ch=CHR(13)) THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 337 Error(1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 338 END;
- 339 IF Ch<>QuoteChar THEN
- 340 AddChar(LastStringConst,Ch);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 341 END;
- 342 UNTIL Ch=QuoteChar;
- 343 END CopyString;
- ***** ^ not supported yet
- 344
- 345 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 346
- 347 PROCEDURE Number;
- 348 BEGIN
- 349 LastNumConst:='';
- ***** ^ undeclared identifier
- 350 Lnth:=0;
- 351 Max:=MaxSymLnth;
- ***** ^ undeclared identifier
- 352 Sy:=IntConst;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 353 REPEAT
- 354 AddChar(LastNumConst,Ch);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 355 GetChar(Ch);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 356 UNTIL (Ch<'0') OR (Ch>'9');
- 357 PushBack;
- ***** ^ not supported yet
- 358 END Number;
- ***** ^ not supported yet
- 359
- 360 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 361
- 362 PROCEDURE Identifier;
- 363
- 364 (*. . . . . . . . . . . . . . . . .*)
- 365
- 366 PROCEDURE CheckResWords;
- 367 VAR
- 368 Result,K,L,R : INTEGER;
- 369 BEGIN
- 370 L:=0;
- 371 R:=Stdwords-1;
- 372 REPEAT
- 373 K := (L+R) DIV 2;
- 374 Result := StrCompare(Id,Reswords[K].WordId);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 375 IF Result<=0 THEN
- 376 R:=K-1;
- 377 END;
- 378 IF Result>=0 THEN
- 379 L:=K+1;
- 380 END;
- 381 UNTIL R<L;
- 382 IF L-R>1 THEN
- 383 Sy := Reswords[K].RSy;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 384 END;
- 385 END CheckResWords;
- ***** ^ not supported yet
- 386
- 387 (*. . . . . . . . . . . . . . . . .*)
- 388
- 389 BEGIN (* Identifier *)
- 390 Sy:=Ident;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 391 Lnth:=0;
- 392 Max:=MaxSymLnth;
- ***** ^ undeclared identifier
- 393 LOOP
- 394 CASE Ch OF
- 395 '_',
- 396 'a'..'z',
- 397 '0'..'9',
- 398 'A'..'Z' : AddChar(Id,CAP(Ch));
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 399 GetChar(Ch) |
- ***** ^ not supported yet
- ***** ^ not supported yet
- 400 ELSE
- 401 EXIT;
- 402 END;
- 403 END;
- 404 PushBack;
- ***** ^ not supported yet
- 405 CheckResWords;
- ***** ^ not supported yet
- 406 END Identifier;
- ***** ^ not supported yet
- 407
- 408 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 409
- 410 PROCEDURE Comment;
- 411 BEGIN
- 412 (* Throw away remainder of line *)
- 413 LineIndex := LineLength+1;
- 414 END Comment;
- ***** ^ not supported yet
- 415
- 416 (*. . . . . . . . . . . . . . . . . . . . . . . . .*)
- 417
- 418 BEGIN (* GetSym *)
- 419 REPEAT
- 420 Sy:=Other;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 421 GotSym:=TRUE;
- 422 REPEAT
- 423 GetChar(Ch);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 424 UNTIL (Ch=0C) OR ((Ch>' ') AND (Ch<=CHR(126)));
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 425 TokenPos := LineIndex-1;
- 426 CASE Ch OF
- 427 0C : Sy:=EndOfFile; |
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 428 '"' : CopyString; |
- ***** ^ not supported yet
- 429 '0'..'9' : Number; |
- ***** ^ not supported yet
- 430 'A'..'Z',
- 431 'a'..'z' : Identifier; |
- ***** ^ not supported yet
- 432 ';' : Comment;
- ***** ^ not supported yet
- 433 GotSym := FALSE; |
- 434 ',' : Sy := Comma;
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 435 GotSym := FALSE; |
- 436 ':' : Sy := Colon; |
- ***** ^ undeclared identifier
- ***** ^ undeclared identifier
- 437 ELSE
- 438 Error(2)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 439 END; (* cases *)
- 440 FirstSymOnLine := FALSE;
- 441 UNTIL GotSym;
- 442 END GetSym;
- ***** ^ not supported yet
- 443
- 444 (*................................................*)
- 445
- 446 END Scanner.
- ***** ^ not supported yet
- 447
- 493 errors
|