STR-691: sdf2rtg: support optional literals.
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
Issue Log
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))
Log in to post comments