Skip to Content.
Sympa Menu

k-user - [K-user] [syntax] Best practice for representing a list of somethings

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

[K-user] [syntax] Best practice for representing a list of somethings


Chronological Thread 
  • 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 ::= ??

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



Archive powered by MHonArc 2.6.16.

Top of Page