k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Radu Mereuta <headness13 AT gmail.com>
- To: Charles Jacobsen <charlie.jacobsen AT utah.edu>
- Cc: "k-user AT cs.uiuc.edu" <k-user AT cs.uiuc.edu>
- Subject: Re: [K-user] Using Float literals inside rules
- Date: Thu, 4 Jul 2013 15:05:28 +0300
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hi Charles,
Sorry for the late response.
It can't give ambiguous parsing in those examples, because you didn't define the + operator. The only way to parse, is as an Expr, just like you declared it.
I think you oversimplified the example, and the issue may be related to something that's not present here.
Radu
K-developer
On Wed, Jun 19, 2013 at 10:24 PM, Charles Jacobsen <charlie.jacobsen AT utah.edu> wrote:
Hello again,
This may be a bug, but I am not sure:
module TEST
syntax Expr ::= "1.0 + 2.0"
rule 1.0 + 2.0 => 1.0 +Float 2.0 [structural]
endmodule
leads to a "parsing ambiguity" error, while
module TEST
syntax Expr ::= "1 + 2"
rule 1 + 2 => 1 +Int 2 [structural]
endmodule
does not (and produces 3 when given the program "1+2"). I suspect it's because '.' has special meaning inside k rules. Parsing ambiguity does not result when a Float literal is used inside of the "where" clause of a k rule.
_______________________________________________
k-user mailing list
k-user AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/k-user
- Re: [K-user] Using Float literals inside rules, Radu Mereuta, 07/04/2013
- Re: [K-user] Using Float literals inside rules, Charles Jacobsen, 07/08/2013
- Message not available
- Re: [K-user] Using Float literals inside rules, Patrick Meredith, 07/08/2013
- Re: [K-user] Using Float literals inside rules, Charles Jacobsen, 07/08/2013
- Re: [K-user] Using Float literals inside rules, Patrick Meredith, 07/08/2013
Archive powered by MHonArc 2.6.16.