I want to show a proposal for using the matching expression builder.
The idea is to keep it simple, so if you think this is very complex, let me know!
First of all open Flamel-UI, in a workspace:
Flamel new openWithSpec.
For those non familiarized with the project, you will see something like this:
- Scope for the rule: Here we restrict the scopes for the rule, for those familiarized with the RW-Engine behind this we have the RBEnvironment objects.
- Define match: The idea here is to help to define the matching rule, for this we have:
- Starting point example method: We choose a method to use as an example for the pattern, you can change for the method you want, and you have more options available (just, right click and see)
- Pattern expression type: 3 options here:
- Method: The pattern corresponds to a method
- Expression: The pattern corresponds to an expression, so we don’t have the selector definition plus the optional temporary variables definition
- Both: Basically, try to search the matching expression as a method and as an expression
- Matching expression: The pattern we will search
- Define transformation: The same idea for the matching but in this case to help you with the transformation
How to use Flamel in 5 stepChoose the scope for your rule
if we don’t clarify this we will look in the hole image and this takes time
- Select your base example: You can use the default example or… choose an example method that is better for you
The example will help you to define the pattern
For change the example, right click in the Starting point example method and choose: “Change example”, you will see a window like this:
- Choose the Pattern expression type: If you are not sure, just let the both and we will try to do our best, but if you really know if you want to define a pattern with a method syntax or not (an expression) choose the best option.
- Define the matching expression: For this we use the right-click menu options to help us.
We can start choosing “Reset expression” and then we will see the same code in the example as a pattern
Then we use the menu to modify the expression
- Perform the search just clicking in the Search button.
And then see your results!