|
@@ -35,7 +35,7 @@ unit scan;
|
|
version = '1.0.0';
|
|
version = '1.0.0';
|
|
|
|
|
|
type
|
|
type
|
|
- Char=system.char;
|
|
|
|
|
|
+ Char=system.ansichar;
|
|
ttyp = (
|
|
ttyp = (
|
|
t_id,
|
|
t_id,
|
|
{ p contains the string }
|
|
{ p contains the string }
|
|
@@ -126,7 +126,7 @@ unit scan;
|
|
);
|
|
);
|
|
|
|
|
|
const
|
|
const
|
|
- ttypstr: array[ttyp] of string =
|
|
|
|
|
|
+ ttypstr: array[ttyp] of ansistring =
|
|
(
|
|
(
|
|
't_id',
|
|
't_id',
|
|
't_arraydef',
|
|
't_arraydef',
|
|
@@ -170,7 +170,7 @@ type
|
|
presobject = ^tresobject;
|
|
presobject = ^tresobject;
|
|
tresobject = object
|
|
tresobject = object
|
|
typ : ttyp;
|
|
typ : ttyp;
|
|
- p : pchar;
|
|
|
|
|
|
+ p : pansichar;
|
|
next : presobject;
|
|
next : presobject;
|
|
p1,p2,p3 : presobject;
|
|
p1,p2,p3 : presobject;
|
|
{ name of int/real, then no T prefix is required }
|
|
{ name of int/real, then no T prefix is required }
|
|
@@ -179,12 +179,12 @@ type
|
|
constructor init_one(t : ttyp;_p1 : presobject);
|
|
constructor init_one(t : ttyp;_p1 : presobject);
|
|
constructor init_two(t : ttyp;_p1,_p2 : presobject);
|
|
constructor init_two(t : ttyp;_p1,_p2 : presobject);
|
|
constructor init_three(t : ttyp;_p1,_p2,_p3 : presobject);
|
|
constructor init_three(t : ttyp;_p1,_p2,_p3 : presobject);
|
|
- constructor init_id(const s : string);
|
|
|
|
- constructor init_intid(const s : string);
|
|
|
|
- constructor init_bop(const s : string;_p1,_p2 : presobject);
|
|
|
|
- constructor init_preop(const s : string;_p1 : presobject);
|
|
|
|
- procedure setstr(const s:string);
|
|
|
|
- function str : string;
|
|
|
|
|
|
+ constructor init_id(const s : ansistring);
|
|
|
|
+ constructor init_intid(const s : ansistring);
|
|
|
|
+ constructor init_bop(const s : ansistring;_p1,_p2 : presobject);
|
|
|
|
+ constructor init_preop(const s : ansistring;_p1 : presobject);
|
|
|
|
+ procedure setstr(const s:ansistring);
|
|
|
|
+ function str : ansistring;
|
|
function strlength : byte;
|
|
function strlength : byte;
|
|
function get_copy : presobject;
|
|
function get_copy : presobject;
|
|
{ can this ve considered as a constant ? }
|
|
{ can this ve considered as a constant ? }
|
|
@@ -196,12 +196,12 @@ type
|
|
|
|
|
|
|
|
|
|
var
|
|
var
|
|
- infile : string;
|
|
|
|
|
|
+ infile : AnsiString;
|
|
outfile : text;
|
|
outfile : text;
|
|
- c : char;
|
|
|
|
- aktspace : string;
|
|
|
|
|
|
+ c : ansichar;
|
|
|
|
+ aktspace : ansistring;
|
|
block_type : tblocktype;
|
|
block_type : tblocktype;
|
|
- commentstr: string;
|
|
|
|
|
|
+ commentstr: ansistring;
|
|
|
|
|
|
const
|
|
const
|
|
in_define : boolean = false;
|
|
in_define : boolean = false;
|
|
@@ -222,10 +222,10 @@ type
|
|
|
|
|
|
|
|
|
|
function yylex : integer;
|
|
function yylex : integer;
|
|
- function act_token : string;
|
|
|
|
|
|
+ function act_token : AnsiString;
|
|
procedure internalerror(i : integer);
|
|
procedure internalerror(i : integer);
|
|
|
|
|
|
- function strpnew(const s : string) : pchar;
|
|
|
|
|
|
+ function strpnew(const s : AnsiString) : PAnsiChar;
|
|
|
|
|
|
procedure writetree(p: presobject);
|
|
procedure writetree(p: presobject);
|
|
|
|
|
|
@@ -317,9 +317,9 @@ type
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- function strpnew(const s : string) : pchar;
|
|
|
|
|
|
+ function strpnew(const s : AnsiString) : PAnsiChar;
|
|
var
|
|
var
|
|
- p : pchar;
|
|
|
|
|
|
+ p : PAnsiChar;
|
|
begin
|
|
begin
|
|
getmem(p,length(s)+1);
|
|
getmem(p,length(s)+1);
|
|
strpcopy(p,s);
|
|
strpcopy(p,s);
|
|
@@ -331,7 +331,7 @@ type
|
|
NotInCPlusBlock := cplusblocklevel < 1;
|
|
NotInCPlusBlock := cplusblocklevel < 1;
|
|
end;
|
|
end;
|
|
|
|
|
|
- constructor tresobject.init_preop(const s : string;_p1 : presobject);
|
|
|
|
|
|
+ constructor tresobject.init_preop(const s : AnsiString;_p1 : presobject);
|
|
begin
|
|
begin
|
|
typ:=t_preop;
|
|
typ:=t_preop;
|
|
p:=strpnew(s);
|
|
p:=strpnew(s);
|
|
@@ -342,7 +342,7 @@ type
|
|
intname:=false;
|
|
intname:=false;
|
|
end;
|
|
end;
|
|
|
|
|
|
- constructor tresobject.init_bop(const s : string;_p1,_p2 : presobject);
|
|
|
|
|
|
+ constructor tresobject.init_bop(const s : AnsiString;_p1,_p2 : presobject);
|
|
begin
|
|
begin
|
|
typ:=t_bop;
|
|
typ:=t_bop;
|
|
p:=strpnew(s);
|
|
p:=strpnew(s);
|
|
@@ -353,7 +353,7 @@ type
|
|
intname:=false;
|
|
intname:=false;
|
|
end;
|
|
end;
|
|
|
|
|
|
- constructor tresobject.init_id(const s : string);
|
|
|
|
|
|
+ constructor tresobject.init_id(const s : AnsiString);
|
|
begin
|
|
begin
|
|
typ:=t_id;
|
|
typ:=t_id;
|
|
p:=strpnew(s);
|
|
p:=strpnew(s);
|
|
@@ -364,7 +364,7 @@ type
|
|
intname:=false;
|
|
intname:=false;
|
|
end;
|
|
end;
|
|
|
|
|
|
- constructor tresobject.init_intid(const s : string);
|
|
|
|
|
|
+ constructor tresobject.init_intid(const s : AnsiString);
|
|
begin
|
|
begin
|
|
typ:=t_id;
|
|
typ:=t_id;
|
|
p:=strpnew(s);
|
|
p:=strpnew(s);
|
|
@@ -419,14 +419,14 @@ type
|
|
intname:=false;
|
|
intname:=false;
|
|
end;
|
|
end;
|
|
|
|
|
|
- procedure tresobject.setstr(const s : string);
|
|
|
|
|
|
+ procedure tresobject.setstr(const s : AnsiString);
|
|
begin
|
|
begin
|
|
if assigned(p) then
|
|
if assigned(p) then
|
|
strdispose(p);
|
|
strdispose(p);
|
|
p:=strpnew(s);
|
|
p:=strpnew(s);
|
|
end;
|
|
end;
|
|
|
|
|
|
- function tresobject.str : string;
|
|
|
|
|
|
+ function tresobject.str : AnsiString;
|
|
begin
|
|
begin
|
|
str:=strpas(p);
|
|
str:=strpas(p);
|
|
end;
|
|
end;
|
|
@@ -1188,7 +1188,7 @@ end(*yyaction*);
|
|
(* DFA table: *)
|
|
(* DFA table: *)
|
|
|
|
|
|
type YYTRec = record
|
|
type YYTRec = record
|
|
- cc : set of Char;
|
|
|
|
|
|
+ cc : set of AnsiChar;
|
|
s : Integer;
|
|
s : Integer;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -5966,7 +5966,7 @@ end(*yylex*);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-function act_token : string;
|
|
|
|
|
|
+function act_token : AnsiString;
|
|
begin
|
|
begin
|
|
act_token:=yytext;
|
|
act_token:=yytext;
|
|
end;
|
|
end;
|