gsdlab / clafer

Clafer is a lightweight modeling language
http://clafer.org
MIT License
45 stars 13 forks source link

Incorrect parsing of 'some' quantifier in constraints. #17

Closed mantkiew closed 12 years ago

mantkiew commented 12 years ago

Clafer v0.2.6-2-2012

For the following code:

abstract A
    b *
        c ?
    [ some b1 : b | b1.c ]

The translator produces the following incorrect error:

clafer "issue17.cfr" -v -m=alloy42
issue17.cfr

Parse              Failed...

Tokens:
syntax error at line 4 before : b | b1
kbak commented 12 years ago

It seems like the parser generated by happy is unable to parse the file because grammar is ambiguous. I don't see any easy fix of that problem. I looked into parser combinators and played a little bit. Most likely I'll use them to create a new parser.

kbak commented 12 years ago

should be fixed now