A generic input parsing/checking mechanism
