You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the present moment re2c has tags, which technically is the same as having actions that execute YYSTAGP / YYSTAGN / YYMTAGP / YYMTAGN code. We could probably generalize this to arbitrary actions, doing the same analysis and TDFA construction for each action as if it was a tag. It would be safe to add actions if the tag has 1st degree of nondeterminism (meaning that it can be implemented with a single tag variable), otherwise if nondeterminism degree is 2 or more, the action would be unsafe and re2c should warn about it (so the user can still have it at their own risk).
The downside is that actions will always be attached to the outgoing transitions, the way TDFA(1) does it with tag operations. This is more restrictive compared to Ragel that has all sorts of actions attached to different kinds of transitions.
The upside is that re2c can have safe actions that are guaranteed to have no conflicts (or, if the user want, they can have conflict with a warning), and TDFA(1) makes use of the lookahead symbol to reduce nondeterminism.
At the present moment re2c has tags, which technically is the same as having actions that execute YYSTAGP / YYSTAGN / YYMTAGP / YYMTAGN code. We could probably generalize this to arbitrary actions, doing the same analysis and TDFA construction for each action as if it was a tag. It would be safe to add actions if the tag has 1st degree of nondeterminism (meaning that it can be implemented with a single tag variable), otherwise if nondeterminism degree is 2 or more, the action would be unsafe and re2c should warn about it (so the user can still have it at their own risk).
The downside is that actions will always be attached to the outgoing transitions, the way TDFA(1) does it with tag operations. This is more restrictive compared to Ragel that has all sorts of actions attached to different kinds of transitions.
The upside is that re2c can have safe actions that are guaranteed to have no conflicts (or, if the user want, they can have conflict with a warning), and TDFA(1) makes use of the lookahead symbol to reduce nondeterminism.
The proposed syntax was discussed in #521:
!action:x { ... }
!x
stands for action namedx
(used in a regexp, and not as the only element of a regexp, as it would clash with pre-defined actions like!entry
)!{ ... }
The text was updated successfully, but these errors were encountered: