For each production, an EncodeFrom and DecodeTo method is generated within the generated class structure. These are standard methods that initialize context information and then call the generated C-like encode or decode function. If the generation of print functions was specified (by including –print on the compiler command line), a Print method is also generated that calls the C print function.
For XER, additional methods are generated to implement a SAX content handler interface to an XML parser. This includes a startElement, characters, and endElement method. An init and finalize method may also be generated to initialize a variable prior to parsing and to complete population of a variable with decoded data.