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

Key: STR-198
Type: New Feature New Feature
Status: Closed Closed
Resolution: Not A Bug
Priority: Minor Minor
Assignee: Unassigned
Reporter: Martin Bravenboer
Votes: 0
Watchers: 0
Operations

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

Concrete syntax for optional match and build

Created: 2004-10-31 18:15   Updated: 2008-03-31 20:39
Component/s: stratego-front
Affects Version/s: 0.12
Fix Version/s: 0.14

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
It would be useful to support concrete syntax for optional matches and builds. The optional match should perform a match of Some(_) and result in an unbound variable if there is None(). The build should try to build a Some(_) or create None() if that fails.

The contribution of this feature is that you don't need to write separate rules for both cases. This is especially frustrating if there are several optional constructs in a single syntactical construct (e.g. a for loop). It's tempting to fall back to abstract syntax in these cases.

This should be easy to implement. It probably introduces a special AST construct, similar to FromTerm, ToTerm and meta-var.


 All   Comments   Work Log   Change History      Sort Order:
Martin Bravenboer [2004-10-31 18:18]
Maybe using None or Some is more attractive then using bound and unbound variables or success and failure.

Martin Bravenboer [2005-04-28 16:58]
You can just do this in your embedding.