界面库
优化调试
This commit is contained in:
@@ -142,7 +142,7 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
ct := "";
|
||||
end else
|
||||
begin
|
||||
if not(ct) then return ;
|
||||
if ct="" then return ;
|
||||
if n=TT_NUM then
|
||||
begin
|
||||
if pos(".",ct)then ct := strtofloat(ct);
|
||||
@@ -152,18 +152,6 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
r[len++]:= array(ct,n);
|
||||
ct := "";
|
||||
end
|
||||
return ;
|
||||
if ct or(n=TT_STR)then
|
||||
begin
|
||||
if n=TT_NUM then
|
||||
begin
|
||||
if pos(".",ct)then ct := strtofloat(ct);
|
||||
else ct := strtoint(ct);
|
||||
end
|
||||
if n=TT_SYM then ct := lowercase(ct);
|
||||
r[len++]:= array(ct,n);
|
||||
ct := "";
|
||||
end
|
||||
end
|
||||
function GetNumber(len);//解析数字
|
||||
begin
|
||||
@@ -263,35 +251,44 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
r := array();
|
||||
len := 0;
|
||||
ct := ""; //当前字符
|
||||
pnumber := true;
|
||||
kb := array(" ":1,"\t":1,"\r":1,"\n":1);
|
||||
fgf := array(' ':1,'\t':1,"\r":1,"\n":1,";":1,",":1);
|
||||
sns := array("=":1,":":1,"(":1,")":1,"<":1,">":1,"[":1,"]":1);
|
||||
while whileok() do
|
||||
begin
|
||||
c := cchar();
|
||||
if c="0" and pnumber and(not ct)then
|
||||
if fgf[c] then // in array(' ','\t',"\r","\n",";",",")
|
||||
begin
|
||||
if ct="0" then delct(r,ct,len,TT_NUM);
|
||||
else delct(r,ct,len,TT_SYM);
|
||||
end else
|
||||
if sns[c]then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,c,len,TT_SIG);
|
||||
end else
|
||||
if c='"' or c="'" then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,Pstring(c),len,TT_STR);
|
||||
end else
|
||||
if c="0" and (not ct)then
|
||||
begin
|
||||
tv := PHexNumber();
|
||||
if tv="d" then
|
||||
begin
|
||||
ct := c;
|
||||
end else
|
||||
delct(r,tv,len,TT_HEX);
|
||||
end else
|
||||
if c='"' or c="'" then
|
||||
delct(r,tv,len,TT_HEX);
|
||||
end else
|
||||
if(FNumbers[c]) and(not(ct))then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,Pstring(c),len,TT_STR);
|
||||
end else
|
||||
if fgf[c] then // in array(' ','\t',"\r","\n",";",",")
|
||||
begin
|
||||
if ct="0" and pnumber then delct(r,ct,len,TT_NUM);
|
||||
else delct(r,ct,len,TT_SYM);
|
||||
//delct(r,ct,len,TT_SYM);
|
||||
v := c+Pnumber();
|
||||
delct(r,v,len,TT_NUM);
|
||||
end else
|
||||
if c="{" then
|
||||
begin
|
||||
//pnumber := false;
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,c,len,TT_SIG);
|
||||
ct:="";
|
||||
@@ -309,34 +306,12 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
ct+=c;
|
||||
end
|
||||
end
|
||||
end else
|
||||
// if c="}" then
|
||||
// begin
|
||||
// delct(r,ct,len,TT_SYM);
|
||||
// delct(r,c,len,TT_SIG);
|
||||
// pnumber := true;
|
||||
// end else
|
||||
if sns[c]then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,c,len,TT_SIG);
|
||||
end else
|
||||
{if c ="." then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,c,len,TT_POI);
|
||||
end else }
|
||||
end else
|
||||
if c="-" then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,c+Pnumber(),len,TT_NUM);
|
||||
end else
|
||||
if(FNumbers[c])and pnumber and(not(ct)) {(not(ct)) and (r[len][0]="=")}then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
v := c+Pnumber();
|
||||
delct(r,v,len,TT_NUM);
|
||||
end else
|
||||
begin
|
||||
ct += c;
|
||||
end
|
||||
@@ -380,6 +355,34 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
c := lowercase(c);
|
||||
//its := inttostr(0 -> 9)union array("a","b","c","d","e","f");
|
||||
r := "";
|
||||
case c of
|
||||
"x":
|
||||
begin
|
||||
while whileok() do
|
||||
begin
|
||||
c := cchar();
|
||||
if not(FHexnumbers[c])then
|
||||
begin
|
||||
cback();
|
||||
break;
|
||||
end
|
||||
r += c;
|
||||
end
|
||||
if r then return eval(&("0x"+r));
|
||||
return 0;
|
||||
end
|
||||
"l":
|
||||
begin
|
||||
return 0;
|
||||
end
|
||||
else
|
||||
begin
|
||||
cback();
|
||||
return "d";
|
||||
end
|
||||
|
||||
|
||||
end;
|
||||
if c="x" then
|
||||
begin
|
||||
while whileok() do
|
||||
@@ -483,11 +486,14 @@ type TTmfParser = class(TTmfParserbase)
|
||||
if (fs <> s) and ifstring(s) then
|
||||
begin
|
||||
FParsers.Script := s;
|
||||
//setprofiler(1+2+4+8);
|
||||
FTokens := FParsers.gettokens();
|
||||
FTokenlen := length(FTokens);
|
||||
FCurrent := 0;
|
||||
FTree := nil;
|
||||
ftreeobj := nil;
|
||||
//d := getprofilerinfo();
|
||||
//exportfile(ftstream(),"","d:\\tst\\abc.stm",d);
|
||||
end
|
||||
end
|
||||
public
|
||||
|
||||
Reference in New Issue
Block a user