Discussion:
SGML DTD to pushdown automaton converter
(too old to reply)
n05W27+ (Markus Kuhn)
2005-07-04 14:10:20 UTC
Permalink
I'd be interested in implementing a very simple SGML parser
for a fixed and small number of DTDs. Since the DTDs will be
sort-of hardwired, it would be convenient to use a very low-footprint
parser that knows nothing about the syntax of human-readable
SGML DTDs, but operates on some simpler abstraction of the same
grammar.

What I have in mind in particular is a deterministic pushdown automaton
that uses as its input alphabet the union of all start tags, end tags
and PCDATA strings and as its stack alphabet the set of element
names. Purpose of this pushdown automation is to detect the start and
end of each element in the input file, so this is really about SGML
with omitted tags (and not XML).

Before I reinvent the wheel (or even do the conversion manually),
is there already a piece of free software out there that parses
an SGML DTD and converts it into something resembling the
state transition table of a deterministic push-down automaton?
It does not even have to deal with attributes, as I'm only
interested here in validating the element structure and
detecting omitted tags.

Thanks,

Markus
--
Markus Kuhn, Computer Laboratory, University of Cambridge
http://www.cl.cam.ac.uk/~mgk25/ || CB3 0FD, Great Britain
C. M. Sperberg-McQueen
2005-07-05 02:42:48 UTC
Permalink
Post by n05W27+ (Markus Kuhn)
Before I reinvent the wheel (or even do the conversion manually),
is there already a piece of free software out there that parses
an SGML DTD and converts it into something resembling the
state transition table of a deterministic push-down automaton?
It does not even have to deal with attributes, as I'm only
interested here in validating the element structure and
detecting omitted tags.
Have you looked at the Amsterdam SGML Parser? My
recollection (based, admittedly, on hearsay and not
experience with the tool) was that it generated
LL(1) parsers for fixed DTDs; it may have the transition
table you need. (Or it may generate the parser(s) you
need.)

-C. M. Sperberg-McQueen
World Wide Web Consortium

Loading...