STR-155: sdf2parenthesize: must use transitive closure of chain priorities
————————————————————-
definition
module Main
exports
context-free start-symbols Expsorts Exp Id
context-free syntax
Id -> Exp
“(” Exp “)” -> Exp {bracket}
Exp “*” Exp -> Exp {cons(“Mul”)}
Exp “+” Exp -> Exp {cons(“Plus”)}
Exp “<” Exp -> Exp {cons(“Lt”)}context-free priorities
Exp “*” Exp -> Exp
> Exp “+” Exp -> Exp
> Exp “<” Exp -> Explexical syntax
[a-z] -> Id
[
] -> LAYOUTlexical restrictions
Id -/- [a-zA-Z0-9_]context-free restrictions
LAYOUT? -/- [
]
————————————————————-Normalized:
————————————————————-
syntax
[60] -> “<”
[43] -> “+”
[42] -> “*”
[41] -> “)”
[40] -> “(”
-> <LAYOUT?-CF>
-> <LAYOUT?-CF>
<LAYOUT?-CF> “<” <LAYOUT?-CF> -> {appl(uqlit(“cons”),[fun(qlit(""Lt""))])}
<LAYOUT?-CF> “+” <LAYOUT?-CF> -> {appl(uqlit(“cons”),[fun(qlit(""Plus""))])}
<LAYOUT?-CF> “*” <LAYOUT?-CF> -> {appl(uqlit(“cons”),[fun(qlit(""Mul""))])}
“(” <LAYOUT?-CF> <LAYOUT?-CF> “)” -> {bracket}
->
->
[9-1032] ->
->
[97-122] ->
<LAYOUT?-CF> <LAYOUT?-CF> ->
-> {left}
[256] ->restrictions
-/- [48-5765-909597-122]
<LAYOUT?-CF> -/- [9-1032]priorities
Submitted on 25 July 2004 at 09:58
<LAYOUT?-CF> “*” <LAYOUT?-CF> -> >
<LAYOUT?-CF> “+” <LAYOUT?-CF> ->
<LAYOUT?-CF> “+” <LAYOUT?-CF> -> >
<LAYOUT?-CF> “<” <LAYOUT?-CF> ->
-> {left} left ->
{left}
————————————————————-
Log in to post comments