definition
module Main
exports
context-free start-symbols Foo
context-free syntax
“foo” “;”? -> Foo {cons(“Foo”)}

lexical syntax
[

] -> LAYOUT

martin@linux:~/tmp> echo “foo;” | sglri -p Foo.tbl
Foo(Some(“;”))

martin@linux:~/tmp> sdf2rtg -i Foo.sdf
SdfChecker:warning: undeclared sort
— Foo [file: Foo.sdf line: 4 col: 29]
[ sdf2rtg | error ] No constructor name specified in production:
[ sdf2rtg | error ] “;” -> <“;”?-CF>
[ sdf2rtg | error ] Resolution: please add a cons attribute to this production.
[ sdf2rtg | error ] Production in abstract syntax:
prod([lit(“;”)],cf(opt(lit(“;”))),attrs([]))

Reported by Bernd Fischer

Submitted on 18 January 2007 at 01:46

On 18 January 2007 at 01:48 Jira commented:

STR-691, martin:
The workaround for now is to move the literal to a separate production:

 "foo" Semicolon? -> Foo {cons("Foo")}
 ";" -> Semicolon {cons("Semicolon")}

$ echo “foo;” | sglri -p Foo.tbl
Foo(Some(Semicolon))


On 28 January 2013 at 14:47 Eelco Visser removed tag 0.18

On 28 January 2013 at 14:47 Eelco Visser tagged interesting

Log in to post comments