mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 16:23:04 +00:00
traces: add some colors
This is an experiment. Maybe more styles will be used (in which case a short-hand function will be useful), maybe it will be just reverted. * data/bison-default.css (.traces0): New. * src/lalr.c (lalr): Use it.
This commit is contained in:
5
TODO
5
TODO
@@ -119,7 +119,10 @@ introduce lr(0) and lalr, just the way we have ielr categories. The
|
|||||||
"set" can still be used for summariring the important sets. That would make
|
"set" can still be used for summariring the important sets. That would make
|
||||||
tests easy to maintain.
|
tests easy to maintain.
|
||||||
|
|
||||||
|
*** complain.*
|
||||||
|
Rename these guys as "diagnostics.*" (or "diagnose.*"), since that the name
|
||||||
|
they have in gcc, clang, etc. Likewise for the complain_* series of
|
||||||
|
functions.
|
||||||
|
|
||||||
* Completion
|
* Completion
|
||||||
Several features are not available in all the backends.
|
Several features are not available in all the backends.
|
||||||
|
|||||||
@@ -22,3 +22,4 @@
|
|||||||
.note { color: cyan; }
|
.note { color: cyan; }
|
||||||
/* Semantic values in Bison's own parser traces. */
|
/* Semantic values in Bison's own parser traces. */
|
||||||
.value { color: green; }
|
.value { color: green; }
|
||||||
|
.trace0 { color: green; }
|
||||||
|
|||||||
15
src/lalr.c
15
src/lalr.c
@@ -550,6 +550,14 @@ lookahead_tokens_print (FILE *out)
|
|||||||
void
|
void
|
||||||
lalr (void)
|
lalr (void)
|
||||||
{
|
{
|
||||||
|
if (trace_flag & trace_automaton)
|
||||||
|
{
|
||||||
|
fputc ('\n', stderr);
|
||||||
|
begin_use_class ("trace0", stderr);
|
||||||
|
fprintf (stderr, "lalr: begin");
|
||||||
|
end_use_class ("trace0", stderr);
|
||||||
|
fputc ('\n', stderr);
|
||||||
|
}
|
||||||
initialize_LA ();
|
initialize_LA ();
|
||||||
set_goto_map ();
|
set_goto_map ();
|
||||||
initialize_goto_follows ();
|
initialize_goto_follows ();
|
||||||
@@ -560,6 +568,13 @@ lalr (void)
|
|||||||
|
|
||||||
if (trace_flag & trace_sets)
|
if (trace_flag & trace_sets)
|
||||||
lookahead_tokens_print (stderr);
|
lookahead_tokens_print (stderr);
|
||||||
|
if (trace_flag & trace_automaton)
|
||||||
|
{
|
||||||
|
begin_use_class ("trace0", stderr);
|
||||||
|
fprintf (stderr, "lalr: done");
|
||||||
|
end_use_class ("trace0", stderr);
|
||||||
|
fputc ('\n', stderr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user