How can anyone check if a string is part of context free grammar? Not only virtually, but also build an algorithm for it?
Given contextual free grammar with rules like
- V-> v1v2
- v1-> 1 | 1x1
- v2-> 2 | 2x2
Obviously, this is the language 1 ^ n 2 ^ n. But how would you go about using an algorithm to check if it really is. I am trying to execute this in java.
source
share