Stratego/XT JIRA  History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: STR-27
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Merijn de Jonge
Reporter: Arthur van Dam
Votes: 0
Watchers: 1
Operations

Clone this issue
Create sub-task
If you were logged in you would be able to see more operations.
Stratego/XT

parse-pp-table doesn't support 'iter-n' nor 'iter-sep-n'

Created: 2004-03-21 11:03   Updated: 2008-03-31 20:39
Component/s: gpp
Affects Version/s: 0.9.5
Fix Version/s: 0.10

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: strategoxt-r5522


 Description  « Hide
(For a detailed context of this issue, see STR-26)

If an sdf contains:
    "(" {Foo ","}2+ ")" -> Bar {cons("TwoOrMore")}

The pp entry by pp-gen is:
   TwoOrMore -- KW["("] _1 KW[")"],
   TwoOrMore.1:iter-sep-n -- _1 KW[","] _2,
   TwoOrMore.1:iter-sep-n.2:"2" -- ,

and, when feeding this to parse-pp-table, the following error occurs:

[adam@freshwater adam]$ parse-pp-table -i niter-test.pp -o niter-test.pp.af
sglr: error in niter-test.pp, line 4, col 29: character `"' (\x22) unexpected
parse-pp-table: rewriting failed


(line 4, col 29) is the first " in "2"

 All   Comments   Work Log   Change History      Sort Order:
Arthur van Dam [2004-03-21 11:17]
Hmmz, just dove into the pp-table.sdf, which contains:

ConsName "." {Selector "."}+ -> Path {cons("Path")}
    NatCon ":" UQLiteral -> Selector {cons("selector")}

It's probably in the UQLiteral. I don't whether it's safe to make the a Literal (i.e. either QLiteral or UQLiteral)?

Or maybe it's the pp-gen that should not have output a quoted literal "2" in the first place.

Merijn de Jonge [2004-03-21 12:20]
Hi,

Yes, you are right 'iter-n' and 'iter-n-sep' are not supported at the moment. To be honest, there are more fancy SDF2 constructs that are not supported. Since these cosntructs are likely to be removed from SDF2 anyway, you better not use them. However, I think it would not be difficult to change ppgen to either ignore these constructs, or generate generate pretty-print rules form them that are syntactically correct.
Ppgen should produce 'TwoOrMore.1:iter-sep-n', not 'TwoOrMore.1:iter-sep-n.2:"2"'.


Best regards,
Merijn

Merijn de Jonge [2004-03-21 12:58]
pretty-printer generator now generates syntactically correct rules for all SDF2 constructs