2 * Copyright (c) 1989 The Regents of the University of California.
5 * This code is derived from software contributed to Berkeley by
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 static char sccsid[] = "@(#)reader.c 5.7 (Berkeley) 1/20/91";
43 /* The line size must be a positive integer. One hundred was chosen */
44 /* because few lines in Yacc input grammars exceed 100 characters. */
45 /* Note that if a line exceeds LINESIZE characters, the line buffer */
46 /* will be expanded to accomodate it. */
76 char *line_format = "\t\t\t\t\t// line %d \"%s\"\n";
77 char *default_line_format = "\t\t\t\t\t// line %d\n";
84 if (cinc >= cache_size)
87 cache = REALLOC(cache, cache_size);
88 if (cache == 0) no_space();
97 register FILE *f = input_file;
101 if (saw_eof || (c = getc(f)) == EOF)
103 if (line) { FREE(line); line = 0; }
109 if (line == 0 || linesize != (LINESIZE + 1))
111 if (line) FREE(line);
112 linesize = LINESIZE + 1;
113 line = MALLOC(linesize);
114 if (line == 0) no_space();
122 if (c == '\n') { cptr = line; return; }
125 linesize += LINESIZE;
126 line = REALLOC(line, linesize);
127 if (line == 0) no_space();
144 register char *p, *s, *t;
146 if (line == 0) return (0);
148 while (*s != '\n') ++s;
149 p = MALLOC(s - line + 1);
150 if (p == 0) no_space();
154 while ((*t++ = *s++) != '\n') continue;
163 int st_lineno = lineno;
164 char *st_line = dup_line();
165 char *st_cptr = st_line + (cptr - line);
170 if (*s == '*' && s[1] == '/')
180 unterminated_comment(st_lineno, st_line, st_cptr);
208 if (line == 0) return (EOF);
234 else if (s[1] == '/')
237 if (line == 0) return (EOF);
265 if (isupper(c)) c = tolower(c);
268 else if (isdigit(c) || c == '_' || c == '.' || c == '$')
276 if (strcmp(cache, "token") == 0 || strcmp(cache, "term") == 0)
278 if (strcmp(cache, "type") == 0)
280 if (strcmp(cache, "left") == 0)
282 if (strcmp(cache, "right") == 0)
284 if (strcmp(cache, "nonassoc") == 0 || strcmp(cache, "binary") == 0)
286 if (strcmp(cache, "start") == 0)
294 if (c == '%' || c == '\\')
305 syntax_error(lineno, line, t_cptr);
315 int need_newline = 0;
316 int t_lineno = lineno;
317 char *t_line = dup_line();
318 char *t_cptr = t_line + (cptr - line - 2);
324 unterminated_text(t_lineno, t_line, t_cptr);
326 fprintf(f, line_format, lineno, input_file_name);
338 unterminated_text(t_lineno, t_line, t_cptr);
343 int s_lineno = lineno;
344 char *s_line = dup_line();
345 char *s_cptr = s_line + (cptr - line - 1);
360 unterminated_string(s_lineno, s_line, s_cptr);
369 unterminated_string(s_lineno, s_line, s_cptr);
381 do putc(c, f); while ((c = *++cptr) != '\n');
386 int c_lineno = lineno;
387 char *c_line = dup_line();
388 char *c_cptr = c_line + (cptr - line - 1);
396 if (c == '*' && *cptr == '/')
407 unterminated_comment(c_lineno, c_line, c_cptr);
418 if (need_newline) putc('\n', f);
436 if (c >= '0' && c <= '9')
438 if (c >= 'A' && c <= 'F')
439 return (c - 'A' + 10);
440 if (c >= 'a' && c <= 'f')
441 return (c - 'a' + 10);
449 register int c, quote;
454 int s_lineno = lineno;
455 char *s_line = dup_line();
456 char *s_cptr = s_line + (cptr - line);
463 if (c == quote) break;
464 if (c == '\n') unterminated_string(s_lineno, s_line, s_cptr);
467 char *c_cptr = cptr - 1;
474 if (line == 0) unterminated_string(s_lineno, s_line, s_cptr);
477 case '0': case '1': case '2': case '3':
478 case '4': case '5': case '6': case '7':
483 n = (n << 3) + (c - '0');
487 n = (n << 3) + (c - '0');
491 if (n > MAXCHAR) illegal_character(c_cptr);
498 if (n < 0 || n >= 16)
499 illegal_character(c_cptr);
504 if (i < 0 || i >= 16) break;
507 if (n > MAXCHAR) illegal_character(c_cptr);
512 case 'a': c = 7; break;
513 case 'b': c = '\b'; break;
514 case 'f': c = '\f'; break;
515 case 'n': c = '\n'; break;
516 case 'r': c = '\r'; break;
517 case 't': c = '\t'; break;
518 case 'v': c = '\v'; break;
527 if (s == 0) no_space();
529 for (i = 0; i < n; ++i)
538 for (i = 0; i < n; ++i)
540 c = ((unsigned char *)s)[i];
541 if (c == '\\' || c == cache[0])
553 case 7: cachec('a'); break;
554 case '\b': cachec('b'); break;
555 case '\f': cachec('f'); break;
556 case '\n': cachec('n'); break;
557 case '\r': cachec('r'); break;
558 case '\t': cachec('t'); break;
559 case '\v': cachec('v'); break;
561 cachec(((c >> 6) & 7) + '0');
562 cachec(((c >> 3) & 7) + '0');
563 cachec((c & 7) + '0');
577 if (n == 1 && bp->value == UNDEFINED)
578 bp->value = *(unsigned char *)s;
591 if (strcmp(name, ".") == 0 ||
592 strcmp(name, "$accept") == 0 ||
593 strcmp(name, "$end") == 0)
596 if (name[0] == '$' && name[1] == '$' && isdigit(name[2]))
599 while (isdigit(*s)) ++s;
600 if (*s == NUL) return (1);
613 for (c = *cptr; IS_IDENT(c); c = *++cptr)
617 if (is_reserved(cache)) used_reserved(cache);
619 return (lookup(cache));
630 for (c = *cptr; isdigit(c); c = *++cptr)
631 n = 10*n + (c - '0');
643 int t_lineno = lineno;
644 char *t_line = dup_line();
645 char *t_cptr = t_line + (cptr - line);
649 if (c == EOF) unexpected_EOF();
650 if (emptyOk && c == '>') {
651 ++cptr; return 0; // 0 indicates empty tag if emptyOk
653 if (!isalpha(c) && c != '_' && c != '$')
654 illegal_tag(t_lineno, t_line, t_cptr);
657 do { cachec(c); c = *++cptr; } while (IS_IDENT(c));
661 if (c == EOF) unexpected_EOF();
663 illegal_tag(t_lineno, t_line, t_cptr);
666 for (i = 0; i < ntags; ++i)
668 if (strcmp(cache, tag_table[i]) == 0)
669 return (tag_table[i]);
675 tag_table = (char **)
676 (tag_table ? REALLOC(tag_table, tagmax*sizeof(char *))
677 : MALLOC(tagmax*sizeof(char *)));
678 if (tag_table == 0) no_space();
682 if (s == 0) no_space();
684 tag_table[ntags] = s;
691 declare_tokens(assoc)
699 if (assoc != TOKEN) ++prec;
702 if (c == EOF) unexpected_EOF();
707 if (c == EOF) unexpected_EOF();
712 if (isalpha(c) || c == '_' || c == '.' || c == '$')
714 else if (c == '\'' || c == '"')
719 if (bp == goal) tokenized_start(bp->name);
724 if (bp->tag && tag != bp->tag)
725 retyped_warning(bp->name);
731 if (bp->prec && prec != bp->prec)
732 reprec_warning(bp->name);
738 if (c == EOF) unexpected_EOF();
742 value = get_number();
743 if (bp->value != UNDEFINED && value != bp->value)
744 revalued_warning(bp->name);
747 if (c == EOF) unexpected_EOF();
760 if (c == EOF) unexpected_EOF();
761 if (c != '<') syntax_error(lineno, line, cptr);
767 if (isalpha(c) || c == '_' || c == '.' || c == '$')
769 else if (c == '\'' || c == '"')
774 if (bp->tag && tag != bp->tag)
775 retyped_warning(bp->name);
787 if (c == EOF) unexpected_EOF();
788 if (!isalpha(c) && c != '_' && c != '.' && c != '$')
789 syntax_error(lineno, line, cptr);
791 if (bp->class == TERM)
792 terminal_start(bp->name);
793 if (goal && goal != bp)
804 cache = MALLOC(cache_size);
805 if (cache == 0) no_space();
810 if (c == EOF) unexpected_EOF();
811 if (c != '%') syntax_error(lineno, line, cptr);
812 switch (k = keyword())
818 copy_text(prolog_file);
844 pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *));
845 if (pitem == 0) no_space();
854 plhs = (bucket **) MALLOC(maxrules*sizeof(bucket *));
855 if (plhs == 0) no_space();
859 rprec = (short *) MALLOC(maxrules*sizeof(short));
860 if (rprec == 0) no_space();
864 rassoc = (char *) MALLOC(maxrules*sizeof(char));
865 if (rassoc == 0) no_space();
875 pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
876 if (pitem == 0) no_space();
883 plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
884 if (plhs == 0) no_space();
885 rprec = (short *) REALLOC(rprec, maxrules*sizeof(short));
886 if (rprec == 0) no_space();
887 rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char));
888 if (rassoc == 0) no_space();
910 copy_text(local_file);
918 syntax_error(lineno, line, s_cptr);
923 if (!isalpha(c) && c != '_' && c != '.' && c != '_')
924 syntax_error(lineno, line, cptr);
928 if (bp->class == TERM)
929 terminal_start(bp->name);
935 if (c == EOF) unexpected_EOF();
936 if (c != ':') syntax_error(lineno, line, cptr);
937 start_rule(bp, s_lineno);
942 start_rule(bp, s_lineno)
946 if (bp->class == TERM)
947 terminal_lhs(s_lineno);
949 if (nrules >= maxrules)
952 rprec[nrules] = UNDEFINED;
953 rassoc[nrules] = TOKEN;
961 if (!last_was_action && plhs[nrules]->tag)
963 for (i = nitems - 1; pitem[i]; --i) continue;
964 if (pitem[i+1] == 0 || pitem[i+1]->tag != plhs[nrules]->tag)
965 default_action_warning(); /** if classes don't match exactly **/
966 } /** bug: could be superclass... **/
969 if (nitems >= maxitems) expand_items();
978 register bucket *bp, **bpp;
981 sprintf(cache, "$$%d", ++gensym);
982 bp = make_bucket(cache);
983 last_symbol->next = bp;
985 bp->tag = plhs[nrules]->tag;
988 if ((nitems += 2) > maxitems)
990 bpp = pitem + nitems - 1;
992 while (bpp[0] = bpp[-1]) --bpp;
994 if (++nrules >= maxrules)
996 plhs[nrules] = plhs[nrules-1];
998 rprec[nrules] = rprec[nrules-1];
1000 rassoc[nrules] = rassoc[nrules-1];
1001 rassoc[nrules-1] = TOKEN;
1008 register bucket *bp;
1009 int s_lineno = lineno;
1012 if (c == '\'' || c == '"')
1021 start_rule(bp, s_lineno);
1026 if (last_was_action)
1027 insert_empty_rule();
1028 last_was_action = 0;
1030 if (++nitems > maxitems)
1032 pitem[nitems-1] = bp;
1043 FILE *f = action_file;
1044 int a_lineno = lineno;
1045 char *a_line = dup_line();
1046 char *a_cptr = a_line + (cptr - line);
1047 char buffer [10000];
1049 int comment_lines = 0;
1051 memset (buffer, 0, 10000);
1053 if (last_was_action)
1054 insert_empty_rule();
1055 last_was_action = 1;
1057 fprintf(f, "case %d:\n", nrules - 2);
1058 if (*cptr == '=') ++cptr;
1062 for (i = nitems - 1; pitem[i]; --i) ++n;
1071 int d_lineno = lineno;
1072 char *d_line = dup_line();
1073 char *d_cptr = d_line + (cptr - line);
1080 if (tag && strcmp(tag, "Object")) {
1081 len += sprintf(buffer + len, "((%s)yyVal)", tag);
1083 strcat (buffer + len, "yyVal");
1090 else if (isdigit(c))
1093 if (i > n) dollar_warning(d_lineno, i);
1094 if (tag && strcmp(tag, "Object"))
1095 len += sprintf(buffer + len, "((%s)yyVals[%d+yyTop])", tag, i - n);
1097 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i - n);
1101 else if (c == '-' && isdigit(cptr[1]))
1104 i = -get_number() - n;
1105 if (tag && strcmp(tag, "Object"))
1106 len += sprintf(buffer + len, "((%s)yyVals[%d+yyTop])", tag, i);
1108 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i);
1113 dollar_error(d_lineno, d_line, d_cptr);
1115 else if (cptr[1] == '$')
1117 if (ntags && plhs[nrules]->tag == 0)
1119 strcat (buffer, "yyVal");
1124 else if (isdigit(cptr[1]))
1130 if (i <= 0 || i > n)
1132 tag = pitem[nitems + i - n - 1]->tag;
1134 untyped_rhs(i, pitem[nitems + i - n - 1]->name),
1135 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i - n);
1136 else if (strcmp(tag, "Object"))
1137 len += sprintf(buffer + len, "((%s)yyVals[%d+yyTop])", tag, i - n);
1139 len += sprintf(buffer + len, "yyVals[%d+yyTop]", i - n);
1144 dollar_warning(lineno, i);
1146 len += sprintf(buffer + len,"yyVals[%d+yyTop]", i - n);
1150 else if (cptr[1] == '-')
1156 len += sprintf(buffer + len, "yyVals[%d+yyTop]", -i - n);
1160 if (isalpha(c) || c == '_' || c == '$')
1166 } while (isalnum(c) || c == '_' || c == '$');
1176 if (line) goto loop;
1177 unterminated_action(a_lineno, a_line, a_cptr);
1180 if (depth > 0) goto loop;
1188 if (--depth > 0) goto loop;
1194 int s_lineno = lineno;
1195 char *s_line = dup_line();
1196 char *s_cptr = s_line + (cptr - line - 1);
1209 unterminated_string(s_lineno, s_line, s_cptr);
1218 unterminated_string(s_lineno, s_line, s_cptr);
1228 buffer[len++] = '*';
1229 while ((c = *++cptr) != '\n')
1231 if (c == '*' && cptr[1] == '/'){
1232 buffer[len++] = '*';
1233 buffer[len++] = ' ';
1238 buffer[len++] = '*';
1239 buffer[len++] = '/';
1240 buffer[len++] = '\n';
1245 int c_lineno = lineno;
1246 char *c_line = dup_line();
1247 char *c_cptr = c_line + (cptr - line - 1);
1249 buffer[len++] = '*';
1255 if (c == '*' && *cptr == '/')
1257 buffer[len++] = '/';
1267 unterminated_comment(c_lineno, c_line, c_cptr);
1277 if (comment_lines > 0)
1280 if ((lineno - (a_lineno + comment_lines)) > 2)
1283 char line_define[256];
1285 sprintf(mname, "case_%d()", nrules - 2);
1287 putc(' ', f); putc(' ', f);
1293 methods = NEW2(maxmethods, char *);
1295 else if (nmethods == maxmethods)
1298 methods = REALLOC (methods, maxmethods*sizeof(char *));
1301 sprintf(line_define, line_format, a_lineno, input_file_name);
1303 mbody = NEW2(5+strlen(line_define)+1+strlen(mname)+strlen(buffer)+1, char);
1304 strcpy(mbody, "void ");
1305 strcat(mbody, mname);
1306 strcat(mbody, "\n");
1307 strcat(mbody, line_define);
1308 strcat(mbody, buffer);
1309 methods[nmethods++] = mbody;
1313 fprintf(f, line_format, lineno, input_file_name);
1314 putc(' ', f); putc(' ', f);
1315 fwrite(buffer, 1, len, f);
1318 fprintf(f, "\n break;\n");
1326 register bucket *bp;
1329 if (c == '%' || c == '\\')
1337 else if ((c == 'p' || c == 'P') &&
1338 ((c = cptr[2]) == 'r' || c == 'R') &&
1339 ((c = cptr[3]) == 'e' || c == 'E') &&
1340 ((c = cptr[4]) == 'c' || c == 'C') &&
1341 ((c = cptr[5], !IS_IDENT(c))))
1344 syntax_error(lineno, line, cptr);
1347 if (isalpha(c) || c == '_' || c == '.' || c == '$')
1349 else if (c == '\'' || c == '"')
1353 syntax_error(lineno, line, cptr);
1357 if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules])
1360 rprec[nrules] = bp->prec;
1361 rassoc[nrules] = bp->assoc;
1370 initialize_grammar();
1376 if (c == EOF) break;
1377 if (isalpha(c) || c == '_' || c == '.' || c == '$' || c == '\'' ||
1380 else if (c == '{' || c == '=')
1385 start_rule(plhs[nrules-1], 0);
1390 if (mark_symbol()) break;
1393 syntax_error(lineno, line, cptr);
1403 if (tag_table == 0) return;
1405 for (i = 0; i < ntags; ++i)
1407 assert(tag_table[i]);
1416 register bucket *bp;
1417 register char *p, *s, *t;
1419 name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */
1420 for (bp = first_symbol; bp; bp = bp->next)
1421 name_pool_size += strlen(bp->name) + 1;
1422 name_pool = MALLOC(name_pool_size);
1423 if (name_pool == 0) no_space();
1425 strcpy(name_pool, "$accept");
1426 strcpy(name_pool+8, "$end");
1428 for (bp = first_symbol; bp; bp = bp->next)
1432 while (*t++ = *s++) continue;
1441 register bucket *bp;
1443 if (goal->class == UNKNOWN)
1444 undefined_goal(goal->name);
1446 for (bp = first_symbol; bp; bp = bp->next)
1448 if (bp->class == UNKNOWN)
1450 undefined_symbol_warning(bp->name);
1459 register bucket *bp;
1460 register bucket **v;
1461 register int i, j, k, n;
1465 for (bp = first_symbol; bp; bp = bp->next)
1468 if (bp->class == TERM) ++ntokens;
1470 start_symbol = ntokens;
1471 nvars = nsyms - ntokens;
1473 symbol_name = (char **) MALLOC(nsyms*sizeof(char *));
1474 if (symbol_name == 0) no_space();
1475 symbol_value = (short *) MALLOC(nsyms*sizeof(short));
1476 if (symbol_value == 0) no_space();
1477 symbol_prec = (short *) MALLOC(nsyms*sizeof(short));
1478 if (symbol_prec == 0) no_space();
1479 symbol_assoc = MALLOC(nsyms);
1480 if (symbol_assoc == 0) no_space();
1482 v = (bucket **) MALLOC(nsyms*sizeof(bucket *));
1483 if (v == 0) no_space();
1486 v[start_symbol] = 0;
1489 j = start_symbol + 1;
1490 for (bp = first_symbol; bp; bp = bp->next)
1492 if (bp->class == TERM)
1497 assert(i == ntokens && j == nsyms);
1499 for (i = 1; i < ntokens; ++i)
1502 goal->index = start_symbol + 1;
1503 k = start_symbol + 2;
1513 for (i = start_symbol + 1; i < nsyms; ++i)
1523 for (i = 1; i < ntokens; ++i)
1528 for (j = k++; j > 0 && symbol_value[j-1] > n; --j)
1529 symbol_value[j] = symbol_value[j-1];
1530 symbol_value[j] = n;
1534 if (v[1]->value == UNDEFINED)
1539 for (i = 2; i < ntokens; ++i)
1541 if (v[i]->value == UNDEFINED)
1543 while (j < k && n == symbol_value[j])
1545 while (++j < k && n == symbol_value[j]) continue;
1553 symbol_name[0] = name_pool + 8;
1554 symbol_value[0] = 0;
1556 symbol_assoc[0] = TOKEN;
1557 for (i = 1; i < ntokens; ++i)
1559 symbol_name[i] = v[i]->name;
1560 symbol_value[i] = v[i]->value;
1561 symbol_prec[i] = v[i]->prec;
1562 symbol_assoc[i] = v[i]->assoc;
1564 symbol_name[start_symbol] = name_pool;
1565 symbol_value[start_symbol] = -1;
1566 symbol_prec[start_symbol] = 0;
1567 symbol_assoc[start_symbol] = TOKEN;
1568 for (++i; i < nsyms; ++i)
1571 symbol_name[k] = v[i]->name;
1572 symbol_value[k] = v[i]->value;
1573 symbol_prec[k] = v[i]->prec;
1574 symbol_assoc[k] = v[i]->assoc;
1586 ritem = (short *) MALLOC(nitems*sizeof(short));
1587 if (ritem == 0) no_space();
1588 rlhs = (short *) MALLOC(nrules*sizeof(short));
1589 if (rlhs == 0) no_space();
1590 rrhs = (short *) MALLOC((nrules+1)*sizeof(short));
1591 if (rrhs == 0) no_space();
1592 rprec = (short *) REALLOC(rprec, nrules*sizeof(short));
1593 if (rprec == 0) no_space();
1594 rassoc = REALLOC(rassoc, nrules);
1595 if (rassoc == 0) no_space();
1598 ritem[1] = goal->index;
1603 rlhs[2] = start_symbol;
1609 for (i = 3; i < nrules; ++i)
1611 rlhs[i] = plhs[i]->index;
1617 ritem[j] = pitem[j]->index;
1618 if (pitem[j]->class == TERM)
1620 prec = pitem[j]->prec;
1621 assoc = pitem[j]->assoc;
1627 if (rprec[i] == UNDEFINED)
1642 register int i, j, k;
1644 register FILE *f = verbose_file;
1649 for (i = 2; i < nrules; ++i)
1651 if (rlhs[i] != rlhs[i-1])
1653 if (i != 2) fprintf(f, "\n");
1654 fprintf(f, "%4d %s :", i - 2, symbol_name[rlhs[i]]);
1655 spacing = strlen(symbol_name[rlhs[i]]) + 1;
1659 fprintf(f, "%4d ", i - 2);
1661 while (--j >= 0) putc(' ', f);
1665 while (ritem[k] >= 0)
1667 fprintf(f, " %s", symbol_name[ritem[k]]);
1678 create_symbol_table();
1679 read_declarations();
1681 free_symbol_table();