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
Is there any way to have a context dependent rule?
A B
Where B depends on the "value" of A.
e.g.,
A = [abc]
B = [efg]
A B{A=a}
The idea is that the rule B only matches if the rule A matched an a.
Probably a much better way to implement it, just trying to demonstrate a possible solution. For simple context dependent grammars, this should work well. I imagine one could do it by grossly complicating the grammar which I want to avoid... it can be done programmatically but I'd rather do it in the grammar if possible, and if not, extend pegged to do it if it is not too difficult.
The text was updated successfully, but these errors were encountered:
Is there any way to have a context dependent rule?
A B
Where B depends on the "value" of A.
e.g.,
A = [abc]
B = [efg]
A B{A=a}
The idea is that the rule B only matches if the rule A matched an
a
.Probably a much better way to implement it, just trying to demonstrate a possible solution. For simple context dependent grammars, this should work well. I imagine one could do it by grossly complicating the grammar which I want to avoid... it can be done programmatically but I'd rather do it in the grammar if possible, and if not, extend pegged to do it if it is not too difficult.
The text was updated successfully, but these errors were encountered: