[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Do I need to use a validating parser?

  • From: Lars Marius Garshol <larsga@i...>
  • To: <xml-dev@i...>
  • Date: 06 May 1999 23:36:32 +0200

validating date java

* Joshua E. Smith
|
| Nonetheless, always up for the academic discussion, you can express
| the entire syntax of the LISP programming language in less than a
| page of DTD, I bet. 

You can, but then you lose some of the really interesting things, such
as read-macros and dispatching characters. It's hard to see any valid
equivalents of those.

For good examples of read-macros, see

<URL: ftp://ftp.netcom.com/pub/hb/hbaker/Prag-Parse.html>

* Steve Oldmeadow
| 
| I don't know LISP but how would you express scoping rules such as a
| locally defined variable can only be accessed within the block it is
| defined such as in Java?

Like type-checking this is generally considered to be semantics and so
one wouldn't normally expect a grammar to be able to express this. (In
fact, I don't think it's possible using a context-free grammar.)

| I came to the conclusion that XML added very little and that you
| were better off just using the traditional tools to generate a
| parser for your language. 

I certainly have to agree here. I think I prefer the approach taken by
someone else recently: parse the language syntax into XML and then
apply stylesheets and parsers to the XML for documentation,
pretty-printing and whatever.

| One thing I toyed with was whether a yacc like tool would be useful
| for XML-ish languages, in other words it would help you generate
| parsers for languages that are marked up using XML. 

This is probably possible, and I think this is what some of the
alphaWorks tools do. Also, I already have an unreleased Python package
which can turn some kinds of XML documents into sets of elements using
some simple rules.

This completely does away with the entire application-specific parser
notion and just lets you use the objects. It doesn't work for all
kinds of documents, though, but I think it might be possible to extend
it to do so.

--Lars M.


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.