k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: "Park, Daejun" <dpark69 AT illinois.edu>
- To: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
- Subject: [K-user] [syntax] Best practice for representing a list of somethings
- Date: Fri, 18 Oct 2013 19:29:14 +0000
- Accept-language: en-US
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hi,
This is my first question as a K user!
When it comes to represent the following syntax, what would be the best practice?
- e? : zero or one
- e* : more than or equal to zero
- e+ : more than zero
What I've been trying is:
syntax EOpt ::= E | "" [onlyLabel, klabel("'epsilon")]
syntax EStar ::= List{E, ""}
syntax EPlus ::= ??
syntax EPlus ::= ??
Am I right? Or, is there more elegant way?
Also, if I should use either of the follows, which one will be better?
syntax EPlus ::= E | E EPlus
syntax EPlus ::= E | EPlus EPlus
Thanks in advance!
Daejun
- [K-user] [syntax] Best practice for representing a list of somethings, Park, Daejun, 10/18/2013
- Re: [K-user] [syntax] Best practice for representing a list of somethings, Radu Mereuta, 10/19/2013
Archive powered by MHonArc 2.6.16.