"Rhs" stands for "right-hand side" and is an acronym familiar to mathematicians. However, it is not descriptive or CS-ish enough for the parser. "Input" would be better, "inputStream" better still. On that note, let us change "output" to "outputStream," too.
There are countless two- and three-line code snippets that serve to advance the inputStream by a foreknown number of bytes. Let's hide the details in a helper function and clean up the driver loop of the parser.
"Rhs" stands for "right-hand side" and is an acronym familiar to mathematicians. However, it is not descriptive or CS-ish enough for the parser. "Input" would be better, "inputStream" better still. On that note, let us change "output" to "outputStream," too.
There are countless two- and three-line code snippets that serve to advance the inputStream by a foreknown number of bytes. Let's hide the details in a helper function and clean up the driver loop of the parser.