Browse Source

* PChar -> PAnsichar

Michaël Van Canneyt 2 years ago
parent
commit
d6e9c5e18a
1 changed files with 15 additions and 15 deletions
  1. 15 15
      packages/tplylib/src/lexlib.pas

+ 15 - 15
packages/tplylib/src/lexlib.pas

@@ -42,9 +42,9 @@ interface
 var
 var
 
 
 yyinput, yyoutput : Text;        (* input and output file *)
 yyinput, yyoutput : Text;        (* input and output file *)
-yyline            : String;      (* current input line *)
+yyline            : ShortString;      (* current input line *)
 yylineno, yycolno : Integer;     (* current input position *)
 yylineno, yycolno : Integer;     (* current input position *)
-yytext            : String;      (* matched text (should be considered r/o) *)
+yytext            : ShortString;      (* matched text (should be considered r/o) *)
 yyleng            : Byte         (* length of matched text *)
 yyleng            : Byte         (* length of matched text *)
   absolute yytext;
   absolute yytext;
 
 
@@ -70,15 +70,15 @@ yyleng            : Byte         (* length of matched text *)
    put_char by another suitable set of routines, e.g. if you want to read
    put_char by another suitable set of routines, e.g. if you want to read
    from/write to memory, etc. *)
    from/write to memory, etc. *)
 
 
-var get_char: function  : Char;
+var get_char: function  : AnsiChar;
   (* obtain one character from the input file (null character at end-of-
   (* obtain one character from the input file (null character at end-of-
      file) *)
      file) *)
 
 
-var unget_char : procedure ( c : Char );
+var unget_char : procedure ( c : AnsiChar );
   (* return one character to the input file to be reread in subsequent calls
   (* return one character to the input file to be reread in subsequent calls
      to get_char *)
      to get_char *)
 
 
-var put_char: procedure ( c : Char );
+var put_char: procedure ( c : AnsiChar );
   (* write one character to the output file *)
   (* write one character to the output file *)
 
 
 (* Utility routines: *)
 (* Utility routines: *)
@@ -102,7 +102,7 @@ procedure reject;
      when rejecting a match. *)
      when rejecting a match. *)
 
 
 procedure return ( n : Integer );
 procedure return ( n : Integer );
-procedure returnc ( c : Char );
+procedure returnc ( c : AnsiChar );
   (* sets the return value of yylex *)
   (* sets the return value of yylex *)
 
 
 procedure start ( state : Integer );
 procedure start ( state : Integer );
@@ -130,8 +130,8 @@ var
 var
 var
 
 
 yystate    : Integer; (* current state of lexical analyzer *)
 yystate    : Integer; (* current state of lexical analyzer *)
-yyactchar  : Char;    (* current character *)
-yylastchar : Char;    (* last matched character (#0 if none) *)
+yyactchar  : AnsiChar;    (* current character *)
+yylastchar : AnsiChar;    (* last matched character (#0 if none) *)
 yyrule     : Integer; (* matched rule *)
 yyrule     : Integer; (* matched rule *)
 yyreject   : Boolean; (* current match rejected? *)
 yyreject   : Boolean; (* current match rejected? *)
 yydone     : Boolean; (* yylex return value set? *)
 yydone     : Boolean; (* yylex return value set? *)
@@ -167,7 +167,7 @@ procedure yyclear;
 
 
 implementation
 implementation
 
 
-procedure fatal ( msg : String );
+procedure fatal ( msg : ShortString );
   (* writes a fatal error message and halts program *)
   (* writes a fatal error message and halts program *)
   begin
   begin
     writeln('LexLib: ', msg);
     writeln('LexLib: ', msg);
@@ -183,9 +183,9 @@ const max_chars = 2048;
 var
 var
 
 
 bufptr : Integer;
 bufptr : Integer;
-buf    : array [1..max_chars] of Char;
+buf    : array [1..max_chars] of AnsiChar;
 
 
-function lexlib_get_char : Char;
+function lexlib_get_char : AnsiChar;
   var i : Integer;
   var i : Integer;
   begin
   begin
     if (bufptr=0) and not eof(yyinput) then
     if (bufptr=0) and not eof(yyinput) then
@@ -207,7 +207,7 @@ function lexlib_get_char : Char;
       lexlib_get_char := #0;
       lexlib_get_char := #0;
   end(*get_char*);
   end(*get_char*);
 
 
-procedure lexlib_unget_char ( c : Char );
+procedure lexlib_unget_char ( c : AnsiChar );
   begin
   begin
     if bufptr=max_chars then fatal('input buffer overflow');
     if bufptr=max_chars then fatal('input buffer overflow');
     inc(bufptr);
     inc(bufptr);
@@ -215,7 +215,7 @@ procedure lexlib_unget_char ( c : Char );
     buf[bufptr] := c;
     buf[bufptr] := c;
   end(*unget_char*);
   end(*unget_char*);
 
 
-procedure lexlib_put_char ( c : Char );
+procedure lexlib_put_char ( c : AnsiChar );
   begin
   begin
     if c=#0 then
     if c=#0 then
       { ignore }
       { ignore }
@@ -251,7 +251,7 @@ max_rules   = 256;
 
 
 var
 var
 
 
-yystext            : String;
+yystext            : ShortString;
 yysstate, yylstate : Integer;
 yysstate, yylstate : Integer;
 yymatches          : Integer;
 yymatches          : Integer;
 yystack            : array [1..max_matches] of Integer;
 yystack            : array [1..max_matches] of Integer;
@@ -295,7 +295,7 @@ procedure return ( n : Integer );
     yydone := true;
     yydone := true;
   end(*return*);
   end(*return*);
 
 
-procedure returnc ( c : Char );
+procedure returnc ( c : AnsiChar );
   begin
   begin
     yyretval := ord(c);
     yyretval := ord(c);
     yydone := true;
     yydone := true;