3 ms·
Well, the language of class patterns can be read naturally in either direction--parser or formatter--much like a grammar can be read as a recognizer or a genera
by david-gudeman 12y ago
Well, the language of class patterns can be read naturally in either direction--parser or formatter--much like a grammar can be read as a recognizer or a generator. And in fact there are features in the class patterns that really only apply when parsing and are ignored when formatting. You could, with some justice, describe it as a reversible notation rather than as a formatting language that can be inverted. However, constructing a formatter from class patterns is a fairly trivial one-to-one conversion to C++ while constructing a parser requires some complex analysis and restructuring.