maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: Steven Eker <eker AT csl.sri.com>
- To: maude-help AT cs.uiuc.edu
- Subject: Re: [Maude-help] xml parsing
- Date: Tue, 16 Apr 2013 14:10:22 -0700
- List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help/>
- List-id: <maude-help.cs.uiuc.edu>
Unfortunately there is no user control over lexical issues such as white-space. Maude has a rather complicated definition of how to break text in to tokens, and in particular the seven characters: ( ) [ ] { } , are considered tokens in their own right, unless they are back-quoted.
User definable lexical syntax is tricky to design and even harder to implement; very few languages offer it - ASF+SDF is the only one of which I am aware - and it leads to hard-to-read programs. User definable lexical analysis of strings is another matter; many languages have external tool support for this although it can get very complicated - Maude itself uses flex states and custom crafted C++ for its lexical analyzer as its determination of whether a token is a keyword or part of user syntax is highly context dependent.
Steven
On 4/16/13 1:33 PM, Scott Christley wrote:
Hello,
I want my Maude (v2.3) program to be able to parse and manipulate XML. I can
create sorts and operators such as this:
sort xmlValue .
sort xmlKey .
op<key> _</key> : xmlValue -> xmlKey .
and it works fine, but the issue is that whitespace is required between the
tokens, so this can be parsed:
<key> name</key>
but this cannot be parsed:
<key>name</key>
Is there a way to allow this? For example, it seems other symbols like
parentheses do not require whitespace.
thanks
Scott
_______________________________________________
Maude-help mailing list
Maude-help AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/maude-help
- [Maude-help] xml parsing, Scott Christley, 04/16/2013
- Re: [Maude-help] xml parsing, Steven Eker, 04/16/2013
- Re: [Maude-help] xml parsing, Scott Christley, 04/16/2013
- Re: [Maude-help] xml parsing, Steven Eker, 04/16/2013
Archive powered by MHonArc 2.6.16.