Skip to Content.
Sympa Menu

k-user - [K-user] String format parsing question

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] String format parsing question


Chronological Thread 
  • From: Omar Duhaiby <3omarz AT gmail.com>
  • To: k-user AT cs.uiuc.edu
  • Subject: [K-user] String format parsing question
  • Date: Fri, 28 Mar 2014 14:20:22 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>


You want to change K's predefined the lexer rules for String. You should define your own String format, call it String2 for example. K defines String like this:

syntax #String ::= Lexer{"\"" (~[\"\\] | "\\\"" | "\\")* "\""}
                   // where '\' cannot be followed by double quote

I took this from the documentation/ref-manual.k file.

All you have to do is replace "\"" with [\"\']
of course you don't need the # before your String2


I haven't tested it but it should work




Archive powered by MHonArc 2.6.16.

Top of Page