[XML-SIG] parsers and XML

tpassin@home.com tpassin@home.com
Thu, 10 Aug 2000 17:29:39 -0400

travish <travish@realtime.net> said -

> > | a) most of the XML "parsers" act appear to be lexers
> >
> > You mean, since they don't build complete document trees?
> I mean since they appear to be lexers:
> http://nightflight.com/cgi-bin/foldoc.cgi?lexical+analysis
> lexical analysis
> <programming> (Or "linear analysis", "scanning") The first stage
> of processing a language. The stream of characters making up the
> source program or other input is read one at a time and grouped
> into lexemes (or "tokens") - word-like pieces such as keywords,
> identifiers, literals and punctutation. The lexemes are then passed
> to the parser.
> ["Compilers - Principles, Techniques and Tools", by Alfred V. Aho,
> Ravi Sethi and Jeffrey D. Ullman, pp. 4-5]
"Parser" seems to be the right idea.  Although the xml "parsers" also
perform the lexical analysis.  If you look at the Dragon Book (that you
referenced), or at lex + yacc, you see that a parser (yacc-generated, for
example) won't build a syntax tree for you unless you add additional coding
to tell it to do so.  The parser, at bottom, is responsible for handling the
syntax, and possibly doing something with the syntactical elements.  A
processor that checks for correct syntax and stops there is still a
"parser", as is a tree-builder or a event-stream generator.


Tom Passin