Core parsing functions.

ABNF, EBNF and PEG wrappers will be written on top of these parsing
functions.