k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- 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
// 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
- [K-user] String format parsing question, SITTHISAK Pakakorn, 03/26/2014
- Re: [K-user] String format parsing question, Radu Mereuta, 03/28/2014
- <Possible follow-up(s)>
- [K-user] String format parsing question, Omar Duhaiby, 03/28/2014
- Re: [K-user] String format parsing question, Radu Mereuta, 03/28/2014
Archive powered by MHonArc 2.6.16.