003 File Manager
Current Path:
/usr/src/contrib/byacc
usr
/
src
/
contrib
/
byacc
/
📁
..
📄
ACKNOWLEDGEMENTS
(771 B)
📄
AUTHORS
(247 B)
📄
CHANGES
(150.04 KB)
📄
MANIFEST
(41.11 KB)
📄
Makefile.old
(1.26 KB)
📄
NEW_FEATURES
(2 KB)
📄
NOTES
(504 B)
📄
NO_WARRANTY
(156 B)
📄
README
(1.37 KB)
📄
README.BTYACC
(22.02 KB)
📄
VERSION
(9 B)
📄
aclocal.m4
(51.8 KB)
📄
btyaccpar.c
(46.94 KB)
📄
btyaccpar.skel
(36.6 KB)
📄
closure.c
(4.18 KB)
📄
config.guess
(47.31 KB)
📄
config.sub
(30.87 KB)
📄
config_h.in
(2.66 KB)
📄
configure
(205.86 KB)
📄
configure.in
(1.57 KB)
📄
defs.h
(15.1 KB)
📄
descrip.mms
(1.14 KB)
📄
error.c
(8.83 KB)
📄
graph.c
(1.92 KB)
📄
install-sh
(6.96 KB)
📄
lalr.c
(10.74 KB)
📄
lr0.c
(9.85 KB)
📄
main.c
(14.75 KB)
📄
makefile.in
(3.39 KB)
📄
mkpar.c
(7.71 KB)
📄
mstring.c
(3.37 KB)
📄
output.c
(40.19 KB)
📁
package
📄
reader.c
(67.01 KB)
📄
skel2c
(2.81 KB)
📄
symtab.c
(1.88 KB)
📁
test
📄
verbose.c
(7.37 KB)
📄
vmsbuild.com
(5.46 KB)
📄
warshall.c
(1.12 KB)
📄
yacc.1
(12.82 KB)
📄
yaccpar.c
(11.96 KB)
📄
yaccpar.skel
(8.83 KB)
Editing: graph.c
/* $Id: graph.c,v 1.8 2014/02/19 00:46:57 Tom.Shields Exp $ */ #include "defs.h" static void graph_state(int stateno); static void graph_LA(int ruleno); static unsigned int larno; void graph(void) { int i; int j; shifts *sp; int sn; int as; if (!gflag) return; for (i = 0; i < nstates; ++i) { closure(state_table[i]->items, state_table[i]->nitems); graph_state(i); } fprintf(graph_file, "\n\n"); for (i = 0; i < nstates; ++i) { sp = shift_table[i]; if (sp) for (j = 0; j < sp->nshifts; ++j) { sn = sp->shift[j]; as = accessing_symbol[sn]; fprintf(graph_file, "\tq%d -> q%d [label=\"%s\"];\n", i, sn, symbol_pname[as]); } } fprintf(graph_file, "}\n"); for (i = 0; i < nsyms; ++i) FREE(symbol_pname[i]); FREE(symbol_pname); } static void graph_state(int stateno) { Value_t *isp; int rule; Value_t *sp; Value_t *sp1; larno = (unsigned)lookaheads[stateno]; fprintf(graph_file, "\n\tq%d [label=\"%d:\\l", stateno, stateno); for (isp = itemset; isp < itemsetend; isp++) { sp1 = sp = ritem + *isp; while (*sp >= 0) ++sp; rule = -(*sp); fprintf(graph_file, " %s -> ", symbol_pname[rlhs[rule]]); for (sp = ritem + rrhs[rule]; sp < sp1; sp++) fprintf(graph_file, "%s ", symbol_pname[*sp]); putc('.', graph_file); while (*sp >= 0) { fprintf(graph_file, " %s", symbol_pname[*sp]); sp++; } if (*sp1 < 0) graph_LA(-*sp1); fprintf(graph_file, "\\l"); } fprintf(graph_file, "\"];"); } static void graph_LA(int ruleno) { int i; unsigned tokensetsize; unsigned *rowp; tokensetsize = (unsigned)WORDSIZE(ntokens); if (ruleno == LAruleno[larno]) { rowp = LA + larno * tokensetsize; fprintf(graph_file, " { "); for (i = ntokens - 1; i >= 0; i--) { if (BIT(rowp, i)) fprintf(graph_file, "%s ", symbol_pname[i]); } fprintf(graph_file, "}"); ++larno; } }
Upload File
Create Folder