cloneRule (old rule, new rule) for lib/GenTest/Grammar.pm which just duplicates a given grammar rule
This function seems to be necessary for a sophisticated RQG grammar simplifier.
Extreme simple and artificial scenario for illustration of the problem:
We search for desired_
query:
tricky tricky;
tricky:
KILL | CONNECTION_ID() ;
The usual attempt of the simplifier to shrink "tricky" will fail.
But in case I would have the cloneRule-function I could write a smart simplifier
which changes the grammar to
query:
tricky1 tricky2;
tricky1:
KILL | CONNECTION_ID() ;
tricky2:
KILL | CONNECTION_ID() ;
Realistic scenario:
Have a fat grammar where some rule
table_name:
t1 | t2 | t3 | ....
is used within the components of various other grammar rules.
cloneRule
Input name of rule to clone
Input name of cloned rule
or maybe
Input name of rule to clone
Output name of cloned rule , the name must be unique
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Medium
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by