k-user AT lists.cs.illinois.edu
Subject: K-user mailing list
List archive
- From: Daniele Filaretti <dfilaretti AT gmail.com>
- To: k-user AT cs.uiuc.edu
- Subject: [K-user] changing builtin Id definition
- Date: Tue, 9 Apr 2013 16:40:39 +0100
- List-archive: <http://lists.cs.uiuc.edu/pipermail/k-user/>
- List-id: <k-user.cs.uiuc.edu>
Hi all,
I've been trying to change the definition of builtin Id, because I need Ids
which also contains '_'.
I had a look at the work-in-progress manual contained in the K distribution,
and ended up with the simple definition, which I used in the definition in
place of the old 'Id':
> syntax MyId ::= Token{[a-zA-Z\_][a-zA-Z0-9\_]*}
but this causes a lot of errors in my development. So I tried the same using
the IMP definition from the K tutorial, but I have the same problems. The
errors apparently also related to K's builtin stuff. I copied here a
selection of the errors (the list is quite long, let me know if you want me
to post everything).
Related to builtins:
> File: /Users/danielefilaretti/bin/k/include/modules/uris.k
> Location: (87,21,87,74)
> Compilation Phase: Ambiguity filter
> [Warning] Parser: Parsing ambiguity between: "#fReadChar" "(" Int ")"
> (K1424Syn), # fReadChar (#stdin ) Arbitrarily choosing the first. in
> the following AST:
> amb(
> #fReadChar ( #stdin ),
> # fReadChar(#stdin)
> )
> File: /Users/danielefilaretti/bin/k/include/modules/uris.k
> Location: (91,23,91,41)
> Compilation Phase: Ambiguity filter
> [Warning] Parser: Parsing ambiguity between: # fReadChar (N:Int ),
> "#fReadChar" "(" Int ")" (K1424Syn) Arbitrarily choosing the first. in
> the following AST:
> amb(
> # fReadChar(N:Int),
> #fReadChar ( N )
> )
Related to imp.k:
> File: /Users/danielefilaretti/bin/k/tutorial/2_imp/lesson_4/imp.k
> Location: (56,36,56,38)
> Compilation Phase: Ambiguity filter
> [Warning] Parser: Parsing ambiguity between: X , X:MyId Arbitrarily
> choosing the first. in the following AST:
> amb(
> X,
> X:MyId
> )
> File: /Users/danielefilaretti/bin/k/tutorial/2_imp/lesson_4/imp.k
> Location: (56,69,56,70)
> Compilation Phase: Ambiguity filter
> [Warning] Parser: Parsing ambiguity between: X:MyId , X Arbitrarily
> choosing the first. in the following AST:
> amb(
> X:MyId,
> X
> )
Is it a bug or am I missing something obvious?
Cheers,
Daniele
- [K-user] changing builtin Id definition, Daniele Filaretti, 04/09/2013
- Re: [K-user] changing builtin Id definition, Andrei Stefanescu, 04/09/2013
Archive powered by MHonArc 2.6.16.