What is the opposite word "parser"?

Possible duplicate:
What is the opposite of parsing?

I am writing a library that converts a string to some memory objects using some syntax. To do this, I created a class called "Parser". Now I want to create a class that does exactly the opposite, i.e. Print a syntax string from an object in memory. Any suggestions for good names for this class? I thought about "Unparser", "Writer", "ToStringer", but for me it does not make much sense.

[EDIT] I should clarify the current structure of my library:

class XXXObject - object in XXX format, constructor new XXXObject (string syntax)
class YYYObject - an object in the YYY format, constructor of the new YYYObject (string syntax)
class ZZZObject - an object in the ZZZ format, the constructor of the new ZZZObject (string syntax)
class Parser is a Parse function (string syntax) that returns either XXXObject, YYYObject, or ZZZObject
[? class] - function [? name] (object o), which takes either an XXXObject, YYYObject, or ZZZObject and returns the syntax version of the string
A serializer is a Serialize (T data) function that accepts any type of data and converts it to XXX, YYY or ZZZ
Deserializer - Deserialize function (object o), which takes either XXX, YYY, or ZZZ and returns any type T

+4
source share
2 answers

In a sense, it's a serializer.

However, quite often it is called a printer.

+8
source

In .Net BCL, the general name translation is as follows:

  • Classes that support both serializations in both directions are suffixed using the Serializer and expose methods called Serialize and Deserialize , i.e. XmlSerializer
  • Classes that support serialization in only one direction are narrowed using Reader or Writer , i.e. StringReader , StringWriter .
+2
source

Source: https://habr.com/ru/post/1413296/


All Articles