k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Mihály Palenik <palenik.mihaly AT gmail.com>
- To: k-user AT lists.cs.illinois.edu
- Subject: [[K-user] ] Unresolved warning
- Date: Mon, 5 Dec 2016 18:05:15 +0100
Hello,
I found a strange warning message and I don't know what is the problem.syntax Variable ::= r"[A-Z][_a-zA-Z0-9@]*" [token, autoReject]
syntax Exp ::= Variable
which always has parsing ambiguity with #KVariable. That's why is use :: sort annotation which eliminate it.I have a function called matching
syntax Map ::= matching(Exp, Exp, Map) [function]
I'd like to write matching rule where second Exp is always different subsort of Exp (e.g Atom, Variable...).
For the Variable I write this:
rule matching(E::Exp, P:Variable, M) => do_something
[Warning] Inner Parser: Parsing ambiguity. Arbitrarily choosing the first.
1: syntax Variable ::= r"[A-Z][_a-zA-Z0-9@]*"
[Location(...)
Source(#token("...",KString))
autoReject(#token("",AttributeValue)) klabel(#token("",KString))
token(#token("",AttributeValue))]
#token(Variable,"P")
2: syntax #KVariable ::=
r"(?<![A-Za-z0-9_\\$!\\?])(\\!|\\?)?([A-Z][A-Za-z0-9'_]*|_)"
[Location(#token("62",Int),#token("25",Int),#token("62",Int),#token("143",Int))
Source(#token("../include/builtin/kast.k",KString))
autoReject(#token("",AttributeValue))
hook(#token("org.kframework.kore.KVariable",AttributeValue))
klabel(#token("",KString)) token(#token("",AttributeValue))]
#token(#KVariable,"P")
Source(...)
Location(...)
rule matching(E::Exp, P::Variable, M) => do_something
[Warning] Inner Parser: Parsing ambiguity. Arbitrarily choosing the first.
1: syntax Variable ::= r"[A-Z][_a-zA-Z0-9@]*"
[Location(...)
Source(#token("...",KString))
autoReject(#token("",AttributeValue)) klabel(#token("",KString))
token(#token("",AttributeValue))]
#token(Variable,"P")
2: syntax Variable ::= Variable ":Variable"
[klabel(#token("#SemanticCastToVariable",KString))
sort(#token("Variable",KString))]
#SemanticCastToVariable(#token(#KVariable,"P"))
Source(...)
Location(...)
[Warning] Inner Parser: Parsing ambiguity. Arbitrarily choosing the first.
1: syntax Variable ::= r"[A-Z][_a-zA-Z0-9@]*"
[Location(...)
Source(#token("...",KString))
autoReject(#token("",AttributeValue)) klabel(#token("",KString))
token(#token("",AttributeValue))]
#token(Variable,"P")
2: syntax Variable ::= Variable ":Variable"
[klabel(#token("#SemanticCastToVariable",KString))
sort(#token("Variable",KString))]
#SemanticCastToVariable(#token(#KVariable,"P"))
Source(...)
Location(...)
I don't know the second syntax Variable where come from. Maybe second is a #KVariable which is cast to Variable. But how can I fix it?
I read in CHANGELOG.md that I can edit k-distribution/include/builtin/kast.k (where is #KVariable) but I'm not professional with K and don't want to change it.
Thank you your answers in advance.
Best regards,
Mihály Palenik
- [[K-user] ] Unresolved warning, Mihály Palenik, 12/05/2016
- Re: [[K-user] ] Unresolved warning, Park, Daejun, 12/05/2016
- Re: [[K-user] ] Unresolved warning, Mihály Palenik, 12/06/2016
- Re: [[K-user] ] Unresolved warning, Radu Mereuta, 12/06/2016
- Re: [[K-user] ] Unresolved warning, Mihály Palenik, 12/06/2016
- Re: [[K-user] ] Unresolved warning, Park, Daejun, 12/05/2016
Archive powered by MHonArc 2.6.19.