Represent repetitions with associative structure

This commit is contained in:
Max Brunsfeld 2018-01-29 10:40:59 -08:00
parent f8704d28da
commit 8c29841adf
9 changed files with 46 additions and 12 deletions

View file

@ -623,6 +623,8 @@ class CCodeGenerator {
case ParseActionTypeShift:
if (action.extra) {
add("SHIFT_EXTRA()");
} else if (action.repetition) {
add("SHIFT_REPEAT(" + to_string(action.state_index) + ")");
} else {
add("SHIFT(" + to_string(action.state_index) + ")");
}