Emphasis Mine. If that's the case, you want to have +20 BAB by level 20. Or having one of those crazy Monk builds. Which isn't happening if you take any levels of rogue. Since that's not happening, we can try for +16.
You can way more attacks as a melee build...Just saying.
Ranger 2, as I've said, gives you Favoured Enemy (Dragons), free Track (which you need for Dragonstalker), and free Rapid Shot. Rogue 5 then gives you the +5 BAB you need for Dragonstalker, as well as 3d6 SA. Enter DS at level 8.
(Taking 0 levels of rogue - and therefore no sneak attack - will get you there at level 6)
By Level 18; Ranger 2 / Rogue 5 / DS 10. You'll have BAB +15. Round out your two last levels with two levels of Shadowdancer (make sure you have Perform ranks) for HiPs. For Improved Uncanny Dodge and free Darkvision.
IIRC; Halflings don't have Darkvision. And viola! BAB +16.
I can't find the 'Ranged Sneak Attack' feat. I know there's a bunch of PrC abilities that let you do it, but, since you want Full Dragonstalker, it's kind of hard to get them, since they're all upper-end abilities.
Remember, again, Halfling Rogue sub-levels, their 'Ranged Sneak Attacks' only work on thrown weapons.
Crossbow Sniper lets you SA at 60ft range. But you have to use a Crossbow. In that case, Exotic Weapon Proficiency (Repeater Crossbow), and Rapid Reload (depending on how your DM rules) is what you want. By now, you should've ditched both Ranger levels and all Rogue Levels, going Straight Fighter => Dragonstalker. Otherwise you're just not going to have the feats to pull it off, since you also have to burn on Track and Blind Fighting. Ditching all your Rogue-ness. You said 'grab Dragonstalker as early as possible'. You could go for it at level 11...But that changes the build entirely.
Deadeye Shot also works. Sort off. You get as many Sneak Attacks as your enemy has attacks. If the Dragon spends his round casting a spell, or flying, or just 'not attacking', you get no Sneak Attacks at all, and all your Readied Actions are wasted. Yeah. zero Sneak Attacks per round. Sweet.
Manyshot and Greater Manyshot are a must. As soon as you can, get them.
Deadly Precision is awesome. Get it. ASAP.
Foe Specialist, is also totally awesome. Especially for this kind of character.
Craven, I don't really like for this kind of character, since it also has that nice screw-you-over-ness of giving you penalties to your Fear Saves, which Dragons give out like marshmellows.
Getting this feat means you can never take any levels at all in Dragonslayer. Since Dragonslayer 1, gives immunity to fear. Which I would advise be your last two levels.