|
@@ -29,7 +29,8 @@ interface
|
|
uses
|
|
uses
|
|
globtype,constexp,
|
|
globtype,constexp,
|
|
symtype,symsym,symbase,symtable,
|
|
symtype,symsym,symbase,symtable,
|
|
- node,compinnr;
|
|
|
|
|
|
+ node,compinnr,
|
|
|
|
+ nbas;
|
|
|
|
|
|
const
|
|
const
|
|
NODE_COMPLEXITY_INF = 255;
|
|
NODE_COMPLEXITY_INF = 255;
|
|
@@ -175,6 +176,10 @@ interface
|
|
{ returns true if the node is an inline node of type i }
|
|
{ returns true if the node is an inline node of type i }
|
|
function is_inlinefunction(p : tnode;i : tinlinenumber) : Boolean;
|
|
function is_inlinefunction(p : tnode;i : tinlinenumber) : Boolean;
|
|
|
|
|
|
|
|
+ { checks if p is a series of length(a) statments, if yes, they are returned
|
|
|
|
+ in a and the function returns true }
|
|
|
|
+ function GetStatements(p : tnode;var a : array of tstatementnode) : Boolean;
|
|
|
|
+
|
|
type
|
|
type
|
|
TMatchProc2 = function(n1,n2 : tnode) : Boolean is nested;
|
|
TMatchProc2 = function(n1,n2 : tnode) : Boolean is nested;
|
|
TTransformProc2 = function(n1,n2 : tnode) : tnode is nested;
|
|
TTransformProc2 = function(n1,n2 : tnode) : tnode is nested;
|
|
@@ -189,7 +194,7 @@ implementation
|
|
cutils,verbose,globals,
|
|
cutils,verbose,globals,
|
|
symconst,symdef,
|
|
symconst,symdef,
|
|
defcmp,defutil,
|
|
defcmp,defutil,
|
|
- nbas,ncon,ncnv,nld,nflw,nset,ncal,nadd,nmem,ninl,
|
|
|
|
|
|
+ ncon,ncnv,nld,nflw,nset,ncal,nadd,nmem,ninl,
|
|
cpubase,cgbase,procinfo,
|
|
cpubase,cgbase,procinfo,
|
|
pass_1;
|
|
pass_1;
|
|
|
|
|
|
@@ -1583,6 +1588,24 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ { checks if p is a series of length(a) statments, if yes, they are returned
|
|
|
|
+ in a and the function returns true }
|
|
|
|
+ function GetStatements(p : tnode;var a : array of tstatementnode) : Boolean;
|
|
|
|
+ var
|
|
|
|
+ i: Integer;
|
|
|
|
+ begin
|
|
|
|
+ Result:=false;
|
|
|
|
+ for i:=0 to high(a) do
|
|
|
|
+ begin
|
|
|
|
+ if not(assigned(p)) or not(p.nodetype=statementn) then
|
|
|
|
+ exit;
|
|
|
|
+ a[i]:=tstatementnode(p);
|
|
|
|
+ p:=tstatementnode(p).right;
|
|
|
|
+ end;
|
|
|
|
+ Result:=true;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
function MatchAndTransformNodesCommutative(n1,n2 : tnode;matchproc : TMatchProc2;transformproc : TTransformProc2;var res : tnode) : Boolean;
|
|
function MatchAndTransformNodesCommutative(n1,n2 : tnode;matchproc : TMatchProc2;transformproc : TTransformProc2;var res : tnode) : Boolean;
|
|
begin
|
|
begin
|
|
res:=nil;
|
|
res:=nil;
|