Skip to Content.
Sympa Menu

maude-help - Re: [[maude-help] ] parsing a file format using a maude module

maude-help AT lists.cs.illinois.edu

Subject: Maude-help mailing list

List archive

Chronological Thread  
  • From: Steven Eker <steveneker AT gmail.com>
  • To: maude-help AT lists.cs.illinois.edu
  • Subject: Re: [[maude-help] ] parsing a file format using a maude module
  • Date: Thu, 7 Dec 2023 16:49:24 -0800

[resending to the list because it bounces if sent from my SRI email no matter which address I used for the list]

You need to fix your operator declaration and the colon in the term you want to parse must be followed by a space (Maude does not support user defined lexical syntax), but otherwise this works:

fmod FOO is
  inc LIST{Nat} .
  sort MySort .
  op Card_:_|_ : Nat List{Nat} List{Nat} -> MySort [ctor] .
endfm

red Card 1 : 41 48 83 86 17 | 83 86  6 31 17  9 48 53 .

Steven


On Thu, Dec 7, 2023 at 6:49 AM Raghu Ranganathan <rraghu.11502 AT gmail.com> wrote:
Assuming I define an op like

op Card_:_|_ : -> Nat List{Nat} List{Nat} [ctor] .

I would like to parse a line of this form with the help of the module this op is defined in.
Card 1: 41 48 83 86 17 | 83 86  6 31 17  9 48 53

Is there a way I can use a module to parse a format like this from a String?




Archive powered by MHonArc 2.6.24.

Top of Page