Skip to content

Instantly share code, notes, and snippets.

@stesh
Created February 10, 2011 15:36
Show Gist options
  • Save stesh/820725 to your computer and use it in GitHub Desktop.
Save stesh/820725 to your computer and use it in GitHub Desktop.
bool has_left_recursion(Grammar g) {
for (vector<Rule>::iterator i = g.rules.begin(); i != g.rules.end(); ++i) {
if (i->mother == i->dtrs.front()) return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment