About a 1000 years ago (November 1982), the late great Chauncy Lively had a clever tie for them in the fly tying feature he used to write for the Pennsylvania Angler Magazine.
His pattern was a bound cylindrical extended body made of bunched deer hair with an over-wrap of ostrich herl to simulate the legs.
I tied a bunch back then and had some success, however they are fragile.
Here is the link to that issue of the Pennsylvania Angler. The Gypsy Moth Caterpillar pattern is on page 18.
If I was inclined to bother with a Gypsy Moth or Tent Caterpillar pattern these days, I'd wrap a size 16 or 18 hook with black thread from the head to the bend, tie in a length of 3/32" or 1/8" of
black cylindrical foam, wrap back up to the head and tie off the foam cylinder at the head leaving a slight hump in the middle. No extended body required.
Like this (taken from a package of Bill Skilton's foam cylinders):
This is my pattern for Green Inchworms which float great, work great and you can tie a zillion in no time.
If you felt compelled to add legs, tie in ostrich herl like Chauncey did 40 years ago, omit the hump in middle of the fly and wrap the herl to the head and tie off. I would also suggest tying in a length of thread with the herl to wrap over the herl for durability.
Good luck!