[erlang-questions] Erlang Language Specification

Richard A. O'Keefe ok@REDACTED
Thu Nov 30 23:17:50 CET 2017



On 1/12/17 5:58 AM, Simon Thompson wrote:
> Yes, I’ve done this, but did trip up with some of the escaping
> conventions for multiple languages …

One approach goes like this.
You have two DTDs.  One includes this:

   <!ELEMENT include EMPTY>
   <!ATTLIST include
      src CDATA #REQUIRED
      in  NMTOKEN #REQUIRED>

So you do things like

   <include src="snippets/flatten.erl" in="Erlang"/>

You have a program that reads the parsed form of the
file in either a SAX-like or DOM-like manner, and
processes the <include/> elements, generating whatever
markup is appropriate, and emits the complete result
as XML, ready for formatting.

*Manual* escaping is tedious and error-prone.



More information about the erlang-questions mailing list