Infantry: Anything on foot
Ranged: Anything with a range
Mounted: Anything on a horse (well, a boar if you are a boar-rider, you get the idea)
Machine: Anything with wheels
So an archer is both infantry and ranged
A catapult is both a ranged and a machine
A swordsman is just an infantry
A ram is just a machine
A lancer is just mounted