Skip to Content.
Sympa Menu

maude-help - [Maude-help] Parsing question

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

[Maude-help] Parsing question


Chronological Thread 
  • From: Todd Wilson <twilson AT csufresno.edu>
  • To: maude-help AT maude.cs.uiuc.edu
  • Subject: [Maude-help] Parsing question
  • Date: Mon, 31 Oct 2005 11:53:08 -0800
  • List-archive: <http://maude.cs.uiuc.edu/pipermail/maude-help>
  • List-id: Maude help list <maude-help.maude.cs.uiuc.edu>

Is there a way that I can get Maude to (meta)parse literal constants without also automatically parsing expressions involving these?

For example, I would like to define a module EXP for representing expressions from a programming language, which are meant to include literal integer and string constants, but *no* operations on them, so that, after

fmod TEST is
protecting EXP .
op f : Exp -> Exp .
endfm

the calls

metaParse(upModule('TEST, true), 'f '( '123 '), 'Exp)
metaParse(upModule('TEST, true), 'f '( '"abc" '), 'Exp)

would produce, respectively,

ResultPair: {'f['s_^123['0.Zero]],'Exp}
ResultPair: {'f['"1234".String],'Exp}

but that, for example,

metaParse(upModule('TEST, true), 'f '( '123 '+ '1 '), 'Exp)

would fail, as addition is not defined in EXP. It seems that if I import NAT or STRING into EXP, I'm forced to accept all of the operations defined there.

Todd Wilson
Department of Computer Science
California State University, Fresno



  • [Maude-help] Parsing question, Todd Wilson, 10/31/2005

Archive powered by MHonArc 2.6.16.

Top of Page