anchor.diff:            not (assigned(NodeA) or assigned(NodeB)));
   end;
   
  +// More infos to this see: Xing2004 "A Simple Way to Construct NFA with Fewer States and Transitions"
  +function TFLRE.IsStarNullable(Node:PFLRENode):boolean;
  +begin
  + if assigned(Node) then begin
  +  case Node^.NodeType of
  +   ntSTAR:begin
  +    result:=Node^.Value=qkGREEDY;
  +   end;
  +   ntALT:begin
  +    result:=(IsStarNullable(Node^.Left) or IsStarNullable(Node^.Right)) or not (assigned(Node^.Left) and assigned(Node^.Right));
  +   end;
  +   ntCAT:begin
  +    result:=IsStarNullable(Node^.Left) and IsStarNullable(Node^.Right);
  +   end;
  +   else begin
  +    result:=false;
  +   end;
  +  end;
  + end else begin
  +  result:=false;
  + end;
  +end;
  +
  +// More infos to this see: Xing2004 "A Simple Way to Construct NFA with Fewer States and Transitions"
  +function TFLRE.StarDenull(Node:PFLRENode):PFLRENode;
  +begin
  + result:=Node;
  + if IsStarNullable(result) then begin
  +  case result^.NodeType of
  +   ntSTAR:begin
  +    result:=result^.Left;
  +   end;
  +   ntCAT:begin
  +    result^.NodeType:=ntALT;
  +    result^.Left:=StarDenull(result^.Left);
  +    result^.Right:=StarDenull(result^.Right);
  +   end;
  +   ntALT:begin
  +    result^.Left:=StarDenull(result^.Left);
  +    result^.Right:=StarDenull(result^.Right);
  +   end;
  +  end;
  + end;
  +end;
  +
   function TFLRE.Concat(NodeLeft,NodeRight:PFLRENode):PFLRENode;
   var NodeTemp:PFLRENode;
   begin                                                    
  
positive.code:        function AreNodesEqual(NodeA,NodeB:PFLRENode):boolean;
         function AreNodesEqualSafe(NodeA,NodeB:PFLRENode):boolean;
  
         function Concat(NodeLeft,NodeRight:PFLRENode):PFLRENode;
  
         function NewAlt(NodeLeft,NodeRight:PFLRENode):PFLRENode;
         function NewPlus(Node:PFLRENode;Kind:longint):PFLRENode;
         function NewStar(Node:PFLRENode;Kind:longint):PFLRENode;
         function NewQuest(Node:PFLRENode;Kind:longint):PFLRENode;
  
         function IsStarNullable(Node:PFLRENode):boolean;
         function StarDenull(Node:PFLRENode):PFLRENode;
  
         function OptimizeNode(NodeEx:PPFLRENode):boolean;
  
  
negative.code:   result^.NodeType:=ntSTAR;
   end else begin
    result:=NewNode(ntQUEST,Node,nil,nil,Kind);
   end;
  end;
  
  