anchor.diff:      NodeStack:=TList.Create;
       try
        if Reversed then begin
  -      Emit(AnchoredRootNode);
  +      Emit(AnchoredRootNode,nil);
        end else begin
  -      Emit(UnanchoredRootNode);
  +      Emit(UnanchoredRootNode,nil);
        end;
       finally
        NodeStack.Free;
  
positive.code:    Instructions[result].Next:=pointer(ptrint(-1));
     Instructions[result].OtherNext:=pointer(ptrint(-1));
    end;
    procedure Emit(Node:PFLRENode;const BackreferenceParentNode:PFLRENode=nil);
    var i0,i1,i2,Counter,Count,Index{$ifndef UseOpcodeJMP},FromIndex,ToIndex,OutIndex{$endif},Flags:longint;
        Last:array of longint;
        CurrentChar,SingleChar:ansichar;
        DoIgnoreCase:boolean;
    begin
     while assigned(Node) and (NodeStack.IndexOf(Node)<0) do begin
      case Node^.NodeType of
       ntALT:begin
        i0:=NewInstruction(opSPLIT);
        Instructions[i0].Value:=skALT;
        Instructions[i0].Next:=pointer(ptrint(CountInstructions));
  {$ifndef UseOpcodeJMP}
        FromIndex:=CountInstructions;
  {$endif}
        Emit(Node^.Left);
  {$ifndef UseOpcodeJMP}
        ToIndex:=CountInstructions-1;
        OutIndex:=CountInstructions;
  {$endif}
  {$ifdef UseOpcodeJMP}
        i1:=NewInstruction(opJMP);
  {$endif}
        Instructions[i0].OtherNext:=pointer(ptrint(CountInstructions));
        Emit(Node^.Right);
  {$ifdef UseOpcodeJMP}
        Instructions[i1].Next:=pointer(ptrint(CountInstructions));
  {$else}
        for Index:=FromIndex to ToIndex do begin
         if ptrint(Instructions[Index].Next)=OutIndex then begin
          Instructions[Index].Next:=pointer(ptrint(CountInstructions));
         end;
         if ptrint(Instructions[Index].OtherNext)=OutIndex then begin
          Instructions[Index].OtherNext:=pointer(ptrint(CountInstructions));
         end;
        end;
  {$endif}
       end;
       ntCAT:begin
        if Reversed then begin
         Emit(Node^.Right);
         Node:=Node^.Left;
        end else begin
         Emit(Node^.Left);
         Node:=Node^.Right;
        end;
        continue;
       end;
       ntCHAR:begin
        CharClass:=GetCharClass(Node^.Value);
        if CharClass=AllCharClass then begin
         i0:=NewInstruction(opANY);
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        end else begin
         SingleChar:=#0;
         Count:=0;
         for CurrentChar:=#0 to #255 do begin
          if CurrentChar in CharClass then begin
           if Count=0 then begin
            SingleChar:=CurrentChar;
            inc(Count);
           end else begin
            inc(Count);
            break;
           end;
          end;
         end;
         if Count=1 then begin
          i0:=NewInstruction(opSINGLECHAR);
          Instructions[i0].Value:=byte(ansichar(SingleChar));
         end else begin
          i0:=NewInstruction(opCHAR);
          Instructions[i0].Value:=ptruint(pointer(CharClasses[Node^.Value]));
         end;
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        end;
       end;
       ntPAREN:begin
        if assigned(BackreferenceParentNode) then begin
         Emit(Node^.Left);
        end else begin
         i0:=NewInstruction(opSAVE);
         Instructions[i0].Value:=Node^.Value shl 1;
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
         Emit(Node^.Left);
         i0:=NewInstruction(opSAVE);
         Instructions[i0].Value:=(Node^.Value shl 1) or 1;
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        end;
       end;
       ntQUEST:begin
        i0:=NewInstruction(opSPLIT);
        Instructions[i0].Value:=skQUEST;
        if Node^.Value<>0 then begin
         // Non-greedy
         Instructions[i0].OtherNext:=pointer(ptrint(CountInstructions));
         Emit(Node^.Left);
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        end else begin
         // Greedy
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
         Emit(Node^.Left);
         Instructions[i0].OtherNext:=pointer(ptrint(CountInstructions));
        end;
       end;
       ntSTAR:begin
        i0:=NewInstruction(opSPLIT);
        Instructions[i0].Value:=skSTAR;
        if Node^.Value<>0 then begin
         // Non-greedy
         Instructions[i0].OtherNext:=pointer(ptrint(CountInstructions));
  {$ifndef UseOpcodeJMP}
         FromIndex:=CountInstructions;
  {$endif}
         Emit(Node^.Left);
  {$ifndef UseOpcodeJMP}
         ToIndex:=CountInstructions-1;
         OutIndex:=CountInstructions;
  {$endif}
  {$ifdef UseOpcodeJMP}
         i1:=NewInstruction(opJMP);
         Instructions[i1].Next:=pointer(ptrint(i0));
  {$endif}
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
  {$ifndef UseOpcodeJMP}
         for Index:=FromIndex to ToIndex do begin
          if ptrint(Instructions[Index].Next)=OutIndex then begin
           Instructions[Index].Next:=pointer(ptrint(i0));
          end;
          if ptrint(Instructions[Index].OtherNext)=OutIndex then begin
           Instructions[Index].OtherNext:=pointer(ptrint(i0));
          end;
         end;
  {$endif}
        end else begin
         // Greedy
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
  {$ifndef UseOpcodeJMP}
         FromIndex:=CountInstructions;
  {$endif}
         Emit(Node^.Left);
  {$ifndef UseOpcodeJMP}
         ToIndex:=CountInstructions-1;
         OutIndex:=CountInstructions;
  {$endif}
  {$ifdef UseOpcodeJMP}
         i1:=NewInstruction(opJMP);
         Instructions[i1].Next:=pointer(ptrint(i0));
  {$endif}
         Instructions[i0].OtherNext:=pointer(ptrint(CountInstructions));
  {$ifndef UseOpcodeJMP}
         for Index:=FromIndex to ToIndex do begin
          if ptrint(Instructions[Index].Next)=OutIndex then begin
           Instructions[Index].Next:=pointer(ptrint(i0));
          end;
          if ptrint(Instructions[Index].OtherNext)=OutIndex then begin
           Instructions[Index].OtherNext:=pointer(ptrint(i0));
          end;
         end;
  {$endif}
        end;
       end;
       ntPLUS:begin
        i0:=CountInstructions;
        Emit(Node^.Left);
        i1:=NewInstruction(opSPLIT);
        Instructions[i1].Value:=skPLUS;
        if Node^.Value<>0 then begin
         // Non-greedy
         Instructions[i1].OtherNext:=pointer(ptrint(i0));
         Instructions[i1].Next:=pointer(ptrint(CountInstructions));
        end else begin
         // Greedy
         Instructions[i1].Next:=pointer(ptrint(i0));
         Instructions[i1].OtherNext:=pointer(ptrint(CountInstructions));
        end;
       end;
       ntMULTIMATCH:begin
        Emit(Node^.Left);
        if not assigned(BackreferenceParentNode) then begin
         i0:=NewInstruction(opMATCH);
         Instructions[i0].Value:=Node^.Value;
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        end;
       end;
       ntZEROWIDTH:begin
        if Reversed then begin
         Flags:=Node^.Value and (sfEmptyWordBoundary or sfEmptyNonWordBoundary);
         if (Node^.Value and sfEmptyBeginLine)<>0 then begin
          Flags:=Flags or sfEmptyEndLine;
         end;
         if (Node^.Value and sfEmptyEndLine)<>0 then begin
          Flags:=Flags or sfEmptyBeginLine;
         end;
         if (Node^.Value and sfEmptyBeginText)<>0 then begin
          Flags:=Flags or sfEmptyEndText;
         end;
         if (Node^.Value and sfEmptyEndText)<>0 then begin
          Flags:=Flags or sfEmptyBeginText;
         end;
        end else begin
         Flags:=Node^.Value;
        end;
        i0:=NewInstruction(opZEROWIDTH);
        Instructions[i0].Value:=Flags;
        Instructions[i0].Next:=pointer(ptrint(CountInstructions));
       end;
       ntLOOKBEHINDNEGATIVE:begin
        i0:=NewInstruction(opLOOKBEHINDNEGATIVE);
        Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        Instructions[i0].Value:=Node^.Value;
       end;
       ntLOOKBEHINDPOSITIVE:begin
        i0:=NewInstruction(opLOOKBEHINDPOSITIVE);
        Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        Instructions[i0].Value:=Node^.Value;
       end;
       ntLOOKAHEADNEGATIVE:begin
        i0:=NewInstruction(opLOOKAHEADNEGATIVE);
        Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        Instructions[i0].Value:=Node^.Value;
       end;
       ntLOOKAHEADPOSITIVE:begin
        i0:=NewInstruction(opLOOKAHEADPOSITIVE);
        Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        Instructions[i0].Value:=Node^.Value;
       end;
       ntBACKREFERENCE,ntBACKREFERENCEIGNORECASE:begin
        DoIgnoreCase:=Node^.NodeType=ntBACKREFERENCEIGNORECASE;
        if not Reversed then begin
         i0:=NewInstruction(opSAVE);
         Instructions[i0].Value:=Node^.Value shl 1;
         Instructions[i0].Next:=pointer(ptrint(CountInstructions));
        end else begin
         i0:=0;
        end;
        begin
         NodeStack.Add(Node);
         if assigned(Node^.Left) then begin
          if assigned(BackreferenceParentNode) then begin
           Emit(Node^.Left,BackreferenceParentNode);
          end else begin
           Emit(Node^.Left,Node);
          end;
         end;
         NodeStack.Delete(NodeStack.Count-1);
        end;
        if not Reversed then begin
         i1:=NewInstruction(opSAVE);
         Instructions[i1].Value:=(Node^.Value shl 1) or 1;
         Instructions[i1].Next:=pointer(ptrint(CountInstructions));
         if DoIgnoreCase then begin
          i1:=NewInstruction(opBACKREFERENCEIGNORECASE);
         end else begin
          i1:=NewInstruction(opBACKREFERENCE);
         end;
         Instructions[i1].Value:=CapturesToSubMatchesMap[Node^.Group] shl 1;
         Instructions[i1].Next:=pointer(ptrint(CountInstructions));
         Instructions[i1].OtherNext:=pointer(ptrint(i0));
        end;
       end;
       else begin
        raise EFLRE.Create('Internal error');
       end;
      end;
      break;
     end;
    end;
   var Counter:longint;
  
negative.code: procedure TFLRE.Compile;
   procedure GenerateInstructions(var Instructions:TFLREInstructions;var CountInstructions:longint;const Reversed:boolean);
   var NodeStack:TList;
    function NewInstruction(Opcode:longword):longint;
    begin
     result:=CountInstructions;
  