OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] parser models

[ Lists Home | Date Index | Thread Index ]

John Cowan <jcowan@reutershealth.com> wrote:

| Arjun Ray scripsit:

|> I find the while( event ) { switch( type ) { } } structure, which
|> inevitably appears, more than a little clumsy.  
| 
| I don't understand what this control structure has to do with recursive
| descent: I rarely if ever see such a thing.  Can you exemplify?

Not in classic RD, of course.  The pull parser is just the same pattern,
not classic RD.  The while() part emerges in the handling of lists:

  list
   : item
   | item list
   ;

In classic RD list() looks like this

   do_list( ) {
        do_item( ) ;
        if ( next token starts an item )
           do_list( ) ;
   }

which can also be done thusly:

   do_list( ) {
      while ( next token starts an item ) 
        do_item( ) ;
   }

If you insist on the first style, you must be a Schemer at heart. ;-)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS