k-user AT lists.siebelschool.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: Ömer Sinan Ağacan <omeragacan AT gmail.com>
- To: Radu Mereuta <headness13 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 18:56:16 +0300
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
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] Once working K program is now broken, need help (do we have changelogs ?), Ömer Sinan Ağacan, 09/06/2013
- Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?), Radu Mereuta, 09/09/2013
- Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?), Ömer Sinan Ağacan, 09/09/2013
- Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?), Robby Findler, 09/09/2013
- Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?), Rosu, Grigore, 09/09/2013
- Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?), Ömer Sinan Ağacan, 09/09/2013
- Re: [K-user] Once working K program is now broken, need help (do we have changelogs ?), Radu Mereuta, 09/09/2013
Archive powered by MHonArc 2.6.16.