anchor.diff:   end;
   end;
   
  -constructor TFLREDFAWorkQueue.Create(SizeOfQueue,MaxMark:longint);
  -begin
  - inherited Create(SizeOfQueue+MaxMark);
  - QueueSize:=SizeOfQueue;
  - QueueMaxMark:=MaxMark;
  - NextMark:=QueueSize;
  - LastWasMark:=true;
  +constructor TFLREDFAWorkQueue.Create(Preallocated:longint=16);
  +begin
  + inherited Create;
  + Instructions:=nil;
  + SetLength(Instructions,Preallocated);
  + CountInstructions:=0;
  + SparseToDenseIDs:=nil;
  + DenseIDs:=nil;
  + SetLength(SparseToDenseIDs,Preallocated);
  + SetLength(DenseIDs,Preallocated);
  + CountIDs:=0;
  + AllocatedIDs:=0;
  + LastWasMark:=false;
   end;
   
   destructor TFLREDFAWorkQueue.Destroy;
   begin
  + SetLength(Instructions,0);
  + SetLength(SparseToDenseIDs,0);
  + SetLength(DenseIDs,0);
    inherited Destroy;
   end;
   
   procedure TFLREDFAWorkQueue.Clear;
   begin
  - inherited Clear;
  - NextMark:=QueueSize;
  + CountInstructions:=0;
  + CountIDs:=0;
  + LastWasMark:=false;
   end;
   
   procedure TFLREDFAWorkQueue.Mark;
   begin
    if not LastWasMark then begin
     LastWasMark:=true;
  -  inherited AddNew(NextMark);
  -  inc(NextMark);
  - end;
  -end;
  -
  -function TFLREDFAWorkQueue.IsMark(const Value:longint):boolean;
  -begin
  - result:=Value>=QueueSize;
  -end;
  -
  -procedure TFLREDFAWorkQueue.AddNew(const ID:longint);
  -begin
  - LastWasMark:=false;
  - inherited AddNew(ID);
  -end;
  -
  -procedure TFLREDFAWorkQueue.Add(const ID:longint);
  -begin
  - if not Contains(ID) then begin
  -  AddNew(ID);
  +  if (CountInstructions+1)>length(Instructions) then begin
  +   SetLength(Instructions,(CountInstructions+1)*2);
  +  end;
  +  Instructions[CountInstructions]:=nil;
  +  inc(CountInstructions);
  + end;
  +end;
  +
  +function TFLREDFAWorkQueue.IsMark(const Instruction:PFLREInstruction):boolean;
  +begin
  + result:=not assigned(Instruction);
  +end;
  +
  +function TFLREDFAWorkQueue.Contains(const Instruction:PFLREInstruction):boolean;
  +var ID:longint;
  +begin
  + ID:=Instruction^.IDandOpcode shr 8;
  + result:=((ID>=0) and (ID<AllocatedIDs) and (SparseToDenseIDs[ID]<CountIDs)) and (DenseIDs[SparseToDenseIDs[ID]]=ID);
  +end;
  +
  +procedure TFLREDFAWorkQueue.AddNew(const Instruction:PFLREInstruction);
  +var ID:longint;
  +begin
  + ID:=Instruction^.IDandOpcode shr 8;
  + if (ID+1)>AllocatedIDs then begin
  +  AllocatedIDs:=ID+1;
  +  SetLength(SparseToDenseIDs,AllocatedIDs);
  +  SetLength(DenseIDs,AllocatedIDs);
  + end;
  + if (CountInstructions+1)>length(Instructions) then begin
  +  SetLength(Instructions,(CountInstructions+1)*2);
  + end;
  + Instructions[CountInstructions]:=Instruction;
  + inc(CountInstructions);
  + SparseToDenseIDs[ID]:=CountIDs;
  + DenseIDs[CountIDs]:=ID;
  + inc(CountIDs);
  +end;
  +
  +procedure TFLREDFAWorkQueue.Add(const Instruction:PFLREInstruction);
  +begin
  + if not Contains(Instruction) then begin
  +  LastWasMark:=false;
  +  AddNew(Instruction);
    end;
   end;
   
  
positive.code:  // Dead state? If yes, ...
   if NewState.CountInstructions=0 then begin
    // ... drop it and take the dead state as the next state
    result:=DefaultStates[skDead];
   end else begin
    // .. otherwise try caching it
    result:=CacheState(@NewState);
  
negative.code:   LastState:=State;
    State:=State^.NextStates[LocalByteMap[byte(ansichar(LocalInput[Position]))]];
    if not assigned(State) then begin
     State:=RunStateOnByte(LastState,Position,byte(ansichar(LocalInput[Position])),true);
     if not assigned(State) then begin
      result:=DFAError;
      exit;
  