Skip to content

Commit

Permalink
more details in the LR graph
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Sep 20, 2023
1 parent 7d42e7c commit 46ccde4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/runtime/c/pgf/pgf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3162,6 +3162,11 @@ pgf_graphviz_lr_automaton(PgfDB *db, PgfConcrRevision revision,
auto lin =
ref<PgfConcrLin>::untagged(reduce->lin_obj);
printer.efun(&lin->name);
printer.nprintf(32,"/%zd[",reduce->seq_idx);
for (size_t i = 0; i < reduce->args->len; i++) {
printer.puts(reduce->args->data[i] ? "t" : "f");
}
printer.puts("]");
break;
}
case PgfConcrLincat::tag: {
Expand All @@ -3182,7 +3187,10 @@ pgf_graphviz_lr_automaton(PgfDB *db, PgfConcrRevision revision,
ref<PgfLRShift> shift = vector_elem(state->shifts, j);
printer.nprintf(16, " s%zu -> s%zu [label=\"", i, shift->next_state);
printer.efun(&shift->lincat->name);
printer.nprintf(16, ".%zu\"];\n", shift->r);
printer.nprintf(16, ".%zu\"", shift->r);
if (!shift->exact)
printer.puts(", style=dashed");
printer.puts("];\n");
}
}
printer.puts("}");
Expand Down

0 comments on commit 46ccde4

Please sign in to comment.