Skip to Content.
Sympa Menu

k-user - Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?)

k-user AT lists.cs.illinois.edu

Subject: K-user mailing list

List archive

Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?)


Chronological Thread 
  • From: Robby Findler <robby AT eecs.northwestern.edu>
  • To: Ömer Sinan Ağacan <omeragacan AT gmail.com>
  • Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
  • Subject: Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?)
  • Date: Mon, 9 Sep 2013 11:24:41 -0500
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
  • List-id: <k-user.cs.uiuc.edu>

Not speaking as a very heavy K user, but my experience with semantics suggests that spending lots of time fiddling with syntax when you're really interested in studying semantics can be a huge time waster. Sounds like you're taking the right approach to me.

Robby


On Mon, Sep 9, 2013 at 10:56 AM, Ömer Sinan Ağacan <omeragacan AT gmail.com> wrote:
Hi Radu, thanks for your response,

I think one important lesson I learned from my experience with K
framework so far is that it's very, very hard to implement
complex(realistic) syntax in K and it's even harder to match that
syntax in rules(e.g. inside configurations).

So I decided to go on with very simple syntax, for instance, if my
language has a for-in syntax(like `for a in ... do ... end`) I'll try
to have something like ForIn(Id, Exp, Exp) in my syntax of semantics.
This makes testing harder because for each change I need to update my
external parser but my guess is it makes my work easier in general.

---
Ömer Sinan Ağacan
http://osa1.net


2013/9/9 Radu Mereuta <headness13 AT gmail.com>:
> Hi Ömer,
>
> Try using List{Test,""}, without the space inside the separation terminal.
> The problem lays with SDF, the parser that we are using in K. Space is part
> of the layout definition (whitespaces that separate tokens in the grammar)
> and sometimes it has problems handling spaces, eol... inside terminals.
>
> If you use the list without the space, you will get a similar grammar for
> your language. Since Ids will match in a greedy way, the input `[a b]` will
> parse the same with both grammars. In your original grammar the space
> between the 'a' and 'b' should go to the list separator, and in the second
> grammar, the space would parse as layout, and will automatically be
> discarded when creating the AST.
>
> I will discuss this with the rest of the group and negotiate a warning
> message that disallows whitespace inside terminals.
>
> Radu
> K developer
>
>
> On Fri, Sep 6, 2013 at 11:31 PM, Ömer Sinan Ağacan <omeragacan AT gmail.com>
> wrote:
>>
>> Dear K users,
>>
>>
>> This simple K program demonstrates a feature that works in an older
>> version K framework but fails with latest version:
>>
>>
>>     module TEST-SYNTAX
>>
>>       syntax Lst ::= List{Test, " "}
>>
>>       syntax Test ::= Id
>>                    | "[" Lst "]"
>>
>>     endmodule
>>
>>     module TEST
>>
>>       imports TEST-SYNTAX
>>
>>     endmodule
>>
>>
>> This compiles fine with both old and latest versions .. The problem is
>> it doesn't parse this simple program `[a b]` in latest version(fails
>> with "Critical: Parse error: Syntax error near unexpected character
>> 'b'")
>>
>> Anyone has ideas on this?
>>
>> Thanks.
>>
>>
>> ---
>> Ömer Sinan Ağacan
>> http://osa1.net
>>
>> _______________________________________________
>> k-user mailing list
>> k-user AT cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/k-user
>
>

_______________________________________________
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user




Archive powered by MHonArc 2.6.16.

Top of Page