diff options
Diffstat (limited to 'Build/source/texk/web2c/omegafonts')
39 files changed, 14708 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/omegafonts/Makefile.in b/Build/source/texk/web2c/omegafonts/Makefile.in new file mode 100644 index 00000000000..b2c64dc4634 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/Makefile.in @@ -0,0 +1,72 @@ +# Makefile for TeX-project WEB sources to C conversion programs. + +# These get expanded from the parent directory, not this one. +kpse_include ../make/common.mk +kpse_include ../make/programs.mk +kpse_include ../make/paths.mk +kpse_include kpathsea.mk + +LEX = @LEX@ +#LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +YACC = @YACC@ + +proglib = ../lib/lib.a +programs = omfonts +linked_programs = ofm2opl opl2ofm ovf2ovp ovp2ovf +scripts = + +omfonts_objects = omfonts.o y_tab.o $(LEX_OUTPUT_ROOT).o \ + char_routines.o dimen_routines.o error_routines.o \ + header_routines.o ligkern_routines.o list_routines.o \ + out_routines.o param_routines.o print_routines.o \ + font_routines.o extra_routines.o out_ofm.o \ + parse_ofm.o +h_files = char_routines.h dimen_routines.h error_routines.h \ + font_routines.h header_routines.h ligkern_routines.h \ + list_routines.h out_routines.h param_routines.h print_routines.h \ + extra_routines.h manifests.h parser.h out_ofm.h dvi.h \ + parse_ofm.h omfonts.h + +all: $(programs) +$(omfonts_objects): Makefile +omfonts: $(omfonts_objects) + $(kpathsea_link) $(omfonts_objects) $(LEXLIB) $(LOADLIBES) + +omfonts.o: omfonts.c y_tab.h +y_tab.c y_tab.h: pl.y + $(YACC) -d -v $(srcdir)/pl.y + -test -f y.tab.c && mv -f y.tab.c y_tab.c + -test -f y.tab.h && mv -f y.tab.h y_tab.h +$(LEX_OUTPUT_ROOT).o: parser.h +$(LEX_OUTPUT_ROOT).c: pl.l + $(LEX) $(srcdir)/pl.l + + + +$(programs): $(proglib) $(kpathsea) + +$(omfonts_objects): $(h_files) + +install: install-exec +install-exec:: install-links + +install-programs: $(programs) + $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) + for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done + +install-links: install-programs + for f in ""$(linked_programs); do \ + cd $(bindir) && (rm -f $$f; $(LN) omfonts $$f); done + +Makefile: Makefile.in ../config.status + cd .. && $(SHELL) config.status + +kpse_include ../make/tkpathsea.mk +kpse_include ../make/clean.mk + +clean:: + rm -f y_tab.c y_tab.h y.out* yacc.* $(LEX_OUTPUT_ROOT).c + +kpse_include ../make/rdepend.mk +kpse_include omegafonts/depend.mk diff --git a/Build/source/texk/web2c/omegafonts/char_routines.c b/Build/source/texk/web2c/omegafonts/char_routines.c new file mode 100644 index 00000000000..169479235cc --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/char_routines.c @@ -0,0 +1,901 @@ +/* char_routines.c: Data structures for character information + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "manifests.h" +#include "list_routines.h" +#include "char_routines.h" +#include "print_routines.h" +#include "out_routines.h" +#include "error_routines.h" +#include "ligkern_routines.h" +#include "dimen_routines.h" +#include "header_routines.h" +#include "font_routines.h" +#include "out_ofm.h" +#include "omfonts.h" +#include "dvi.h" + +#define PLANE 0x10000 +#define HALFPLANE 0x08000 + +#define MAX_START_OFM 65535 +#define MAX_START_TFM 255 + +/* + * Characters can range from 0x0 to 0x7fffffff (31 bits unsigned), + * which is a lot of characters. We would expect characters to either + * be bunched up in a given region, or else sparsely defined throughout + * the range. The data structure to hold them is an array of HALFPLANE + * arrays, each of which holds a full PLANE (0x10000) of characters. + * + * At all times, init_character ensures that planes[0] to planes[plane_max] + * are either NULL or allocated arrays of PLANE characters. + * + * For allocated array p, init_character also ensures that planes[p][0] + * to planes[p][char_max[p]] are either NULL or pointers to allocated + * char_entry values. + * + * init_character can be called when actually reading a CHARACTER definition + * or when the character is referenced in a charlist cycle, an extensible + * piece or in a ligature/kerning table. In the latter case, ensure_existence + * is called, and it sets the defined field of the character to be FALSE; + * + * init_character also sets current_character to the character entry; + * + */ + +unsigned bc=0x7fffffff; +unsigned ec=0x0; +unsigned ne=0; + +char_entry **planes[HALFPLANE]; +unsigned char_max[HALFPLANE]; +unsigned plane_max = 0; + +char_entry *current_character = NULL; +char_entry *current_secondary_character = NULL; + +queue exten_queue; +four_pieces **exten_table = NULL; + +unsigned no_labels = 0; +label_entry *label_table; +int label_ptr, sort_ptr; +int lk_offset; +boolean extra_loc_needed; + +extern unsigned bchar; + +void +init_planes(void) +{ + plane_max = 0; + planes[plane_max] = NULL; + char_max[plane_max] = 0; +} + +void +init_character(unsigned c, char_entry *ready_made) +{ + register unsigned i, index, plane; + + if ((c<CHAR_MINIMUM) || (c>CHAR_MAXIMUM)) { + warning_1("CHARACTER index (H %X) not 31-bit unsigned integer; " + "ignored", c); + current_character = NULL; + return; + } + plane = c / PLANE; + index = c % PLANE; + for (i=plane_max+1; i<=plane; i++) { + planes[plane] = NULL; + } + if (planes[plane]==NULL) { + planes[plane] = (char_entry **)xmalloc(PLANE * sizeof(char_entry *)); + char_max[plane] = 0; + planes[plane][0] = NULL; + } + for (i=char_max[plane]+1; i<=index; i++) { + planes[plane][i] = NULL; + } + if (plane>plane_max) plane_max = plane; + if (index>char_max[plane]) char_max[plane] = index; + + if (planes[plane][index] != NULL) { + if (planes[plane][index]->defined == FALSE) { + current_character = planes[plane][index]; + current_character->defined = TRUE; + return; + } + warning_1("CHARACTER index (H %X) previously defined; " + "old definition ignored", c); + free(current_character); + current_character = NULL; + } + if (ready_made != NULL) { + current_character = ready_made; + planes[plane][index] = current_character; + } else { + current_character = (char_entry *)xmalloc(sizeof(char_entry)); + planes[plane][index] = current_character; + for (i=C_MIN; i<=C_MAX; i++) { + current_character->indices[i] = NULL; + current_character->index_indices[i] = 0; + } + current_character->c = c; + current_character->copies = 0; + current_character->remainder = 0; + current_character->tag = TAG_NONE; + current_character->defined = TRUE; + current_character->accent = ACC_NONE; + current_character->ovf_packet_length = 0; + current_character->ovf_packet = NULL; + cur_packet = NULL; + } +} + +void +copy_characters(unsigned c, unsigned copies) +{ + unsigned i=0; + unsigned plane, index; + char_entry *the_entry; + + if ((c<CHAR_MINIMUM) || (c>CHAR_MAXIMUM)) { + warning_1("CHARACTER index (H %X) not 31-bit unsigned integer; " + "ignored", c); + current_character = NULL; + return; + } + plane = c / PLANE; + index = c % PLANE; + if (planes[plane]==NULL) + internal_error_1("copy_characters (plane %d)", plane); + the_entry = planes[plane][index]; + if (the_entry==NULL) + internal_error_1("copy_characters (index %d)", index); + the_entry->copies = copies; + for (i=(c+1); i<=(c+copies); i++) + init_character(i, the_entry); +} + +void +ensure_existence(unsigned c) +{ + register unsigned index, plane; + plane = c / PLANE; + index = c % PLANE; + + if ((planes[plane]==NULL) || (planes[plane][index]==NULL)) { + init_character(c, NULL); + planes[plane][index]->defined = FALSE; + } + current_secondary_character = planes[plane][index]; +} + +#define FOR_ALL_CHARACTERS(FOR_ALL_CHARACTERS_ACTION) \ + for (plane = 0; plane <=plane_max; plane++) { \ + if (planes[plane] != NULL) { \ + for (index = 0; index <=char_max[plane]; index++) { \ + entry = planes[plane][index]; \ + c = plane*PLANE + index; \ + if (entry != NULL) { \ + FOR_ALL_CHARACTERS_ACTION \ + } \ + } \ + } \ + } + +#define FOR_ALL_EXISTING_CHARACTERS(FOR_ALL_EXISTING_CHARACTERS_ACTION) \ + FOR_ALL_CHARACTERS( \ + if (entry->defined == TRUE) { \ + FOR_ALL_EXISTING_CHARACTERS_ACTION \ + } \ + ) + +void +output_ovf_chars(void) +{ + register unsigned index, plane, c, k; + char_entry *entry; + fix wd; + + FOR_ALL_EXISTING_CHARACTERS( + wd = lval(entry->indices[C_WD]); + if (design_units != UNITY) + wd = zround(((double)wd) / ((double)design_units) * 1048576.0); + if ((entry->ovf_packet_length>241) || + (wd < 0) || (wd >= 0x1000000) || + (c < 0) || (c >255)) { + out_ovf(242); out_ovf_4(entry->ovf_packet_length); + out_ovf_4(c); out_ovf_4(wd); + } else { + out_ovf(entry->ovf_packet_length); out_ovf(c); + out_ovf((wd >>16) & 0xff); out_ovf((wd >>8) & 0xff); + out_ovf(wd & 0xff); + } + for (k=0; k<entry->ovf_packet_length; k++) + out_ovf(entry->ovf_packet[k]); + ) +} + + +void +check_existence_all_character_fields(void) +{ + register unsigned index, plane, c; + char_entry *entry; + unsigned *exten; + unsigned j; + + FOR_ALL_EXISTING_CHARACTERS( + switch(entry->tag) { + case TAG_NONE: { break; } + case TAG_LIG: { + check_ligature_program(c, entry->remainder); + break; + } + case TAG_LIST:{ + check_existence_and_safety(c, entry->remainder, NULL, + "%sCharacter (H %X) NEXTLARGER than (H %X) " + "has no CHARACTER spec"); + break; + } + case TAG_EXT:{ + exten = entry->extens; + for (j=E_MIN; j<=E_MAX; j++) { + if (exten[j]!=0) + check_existence_and_safety(c, exten[j], + extensible_pieces[j], + "%s piece (H %X) of character (H %X) " + "has no CHARACTER spec"); + } + break; + } + } + ) +} + +void +clear_ligature_entries(void) +{ + register unsigned index, plane, c; + char_entry *entry; + + FOR_ALL_EXISTING_CHARACTERS( + if (entry->tag == TAG_LIG) { + entry->tag = TAG_NONE; + entry->remainder = 0; + } + ) +} + +void +check_existence_and_safety(unsigned c, unsigned g, string extra, string fmt) +{ + char_entry *gentry = planes[g/PLANE][g%PLANE]; + + if ((g<CHAR_MINIMUM) || (g>CHAR_MAXIMUM)) + internal_error_1("check_existence_and_safety (g=%d)", g); + gentry = planes[g/PLANE][g%PLANE]; + if ((g>=128) && (c<128)) + seven_bit_calculated = 0; + if ((gentry==NULL) || (gentry->defined == FALSE)) { + warning_s_2(fmt, extra, g, c); + current_character = gentry; + set_character_measure(C_WD, 0); + } +} + +void +doublecheck_existence(unsigned g, string extra, char*fmt) +{ + char_entry *gentry = planes[g/PLANE][g%PLANE]; + + if ((g<CHAR_MINIMUM) || (g>CHAR_MAXIMUM)) + internal_error_1("doublecheck_existence (g=%d)", g); + gentry = planes[g/PLANE][g%PLANE]; + if ((gentry==NULL) || (gentry->defined == FALSE)) { + warning_s_1(fmt, extra, g); + current_character = gentry; +/* + set_character_measure(C_WD, 0); +*/ + } +} + +extern string character_measures[]; + +void +print_characters(boolean read_ovf) +{ + register unsigned index, plane, c; + char_entry *entry; + four_pieces *exten; + four_entries *lentry; + unsigned j,k; + + FOR_ALL_CHARACTERS( + if (entry->index_indices[C_WD] != 0) { + print_character(c); + for (k=C_MIN; k<C_MAX; k++) { + if (entry->index_indices[k] != 0) { + print_character_measure(k, + dimen_tables[k][entry->index_indices[k]]); + } + } + fflush(file_output); + switch (entry->tag) { + case TAG_NONE: { break; } + case TAG_LIG: { + left(); + out("COMMENT"); out_ln(); + lentry = lig_kern_table + entry->remainder; + if (lentry->entries[0] > STOP_FLAG) { + lentry = lig_kern_table + + (256*lentry->entries[2]+lentry->entries[3]); + } + do { + print_one_lig_kern_entry(lentry, FALSE); + if (lentry->entries[0] >= STOP_FLAG) { + lentry = lig_kern_table + nl; + } else { + lentry = lentry + 1 + lentry->entries[0]; + } + } while (lentry < (lig_kern_table + nl)); + right(); + break; + } + case TAG_LIST: { + print_next_larger(entry->remainder); + break; + } + case TAG_EXT: { + print_var_character(); + exten = exten_table[entry->remainder]; + for (j=E_MIN; j<=E_MAX; j++) { + if (exten->pieces[j]!=0) + print_extensible_piece(j,exten->pieces[j]); + } + right(); + break; + } + } + if ((read_ovf==TRUE) && (entry->ovf_packet_length>0)) { + print_map(); + print_packet(entry->ovf_packet, entry->ovf_packet_length); + right(); + } + right(); + fflush(file_output); + } + ) +} + +unsigned stack_top = 0; +int wstack[1000]; +int xstack[1000]; +int ystack[1000]; +int zstack[1000]; + +void +print_packet(unsigned char *packet_start, unsigned packet_length) +{ + unsigned cmd, arg; + fix fix_arg, fix_arg1; + unsigned char *packet = packet_start; + unsigned char *max_packet = packet+packet_length; + + stack_top = 0; + wstack[stack_top] = xstack[stack_top] = + ystack[stack_top] = zstack[stack_top] = 0; + while (packet <max_packet) { + if (*packet <= DVI_SET_CHAR_127) { + arg = *packet; packet++; + print_set_char(arg); + } else if ((*packet >= DVI_FNT_NUM_0) && (*packet <= DVI_FNT_NUM_63)) { + arg = *packet - DVI_FNT_NUM_0; packet++; + print_select_font(arg); + } else switch(*packet) { + case DVI_SET_1: case DVI_SET_2: case DVI_SET_3: case DVI_SET_4: + cmd = *packet; packet++; + arg = ovf_get_arg(&packet, cmd - DVI_SET_1 + 1, FALSE); + print_set_char(arg); + break; + case DVI_NOP: + packet++; + break; + case DVI_PUSH: + cmd = DVI_PUSH; packet++; stack_top++; + wstack[stack_top] = wstack[stack_top-1]; + xstack[stack_top] = xstack[stack_top-1]; + ystack[stack_top] = ystack[stack_top-1]; + zstack[stack_top] = zstack[stack_top-1]; + print_push(); + break; + case DVI_POP: + cmd = DVI_PUSH; packet++; stack_top--; + print_pop(); + break; + case DVI_SET_RULE: + cmd = DVI_SET_RULE; packet++; fix_arg = ovf_get_arg(&packet, 4, TRUE); + fix_arg1 = ovf_get_arg(&packet, 4, TRUE); + print_set_rule(fix_arg, fix_arg1); + break; + case DVI_PUT_RULE: + cmd = DVI_PUT_RULE; packet++; fix_arg = ovf_get_arg(&packet, 4, TRUE); + fix_arg1 = ovf_get_arg(&packet, 4, TRUE); + print_put_rule(fix_arg, fix_arg1); + break; + case DVI_RIGHT_1: case DVI_RIGHT_2: case DVI_RIGHT_3: case DVI_RIGHT_4: + cmd = *packet; packet++; + fix_arg = ovf_get_arg(&packet, cmd - DVI_RIGHT_1 + 1, TRUE); + print_move(M_RIGHT, fix_arg); + break; + case DVI_DOWN_1: case DVI_DOWN_2: case DVI_DOWN_3: case DVI_DOWN_4: + cmd = *packet; packet++; + fix_arg = ovf_get_arg(&packet, cmd - DVI_DOWN_1 + 1, TRUE); + print_move(M_DOWN, fix_arg); + break; + case DVI_W_0: + cmd = DVI_W_0; packet++; + print_move(M_RIGHT, wstack[stack_top]); + break; + case DVI_W_1: case DVI_W_2: case DVI_W_3: case DVI_W_4: + cmd = *packet; packet++; + wstack[stack_top] = ovf_get_arg(&packet, cmd - DVI_W_1 + 1, TRUE); + print_move(M_RIGHT, wstack[stack_top]); + break; + case DVI_X_0: + cmd = DVI_X_0; packet++; + print_move(M_RIGHT, xstack[stack_top]); + break; + case DVI_X_1: case DVI_X_2: case DVI_X_3: case DVI_X_4: + cmd = *packet; packet++; + xstack[stack_top] = ovf_get_arg(&packet, cmd - DVI_X_1 + 1, TRUE); + print_move(M_RIGHT, xstack[stack_top]); + break; + case DVI_Y_0: + cmd = DVI_Y_0; packet++; + print_move(M_DOWN, ystack[stack_top]); + break; + case DVI_Y_1: case DVI_Y_2: case DVI_Y_3: case DVI_Y_4: + cmd = *packet; packet++; + ystack[stack_top] = ovf_get_arg(&packet, cmd - DVI_Y_1 + 1, TRUE); + print_move(M_DOWN, ystack[stack_top]); + break; + case DVI_Z_0: + cmd = DVI_Z_0; packet++; + print_move(M_DOWN, zstack[stack_top]); + break; + case DVI_Z_1: case DVI_Z_2: case DVI_Z_3: case DVI_Z_4: + cmd = *packet; packet++; + zstack[stack_top] = ovf_get_arg(&packet, cmd - DVI_Z_1 + 1, TRUE); + print_move(M_DOWN, zstack[stack_top]); + break; + case DVI_PUT_1: case DVI_PUT_2: case DVI_PUT_3: case DVI_PUT_4: + cmd = *packet; packet++; + fix_arg = ovf_get_arg(&packet, cmd - DVI_PUT_1 + 1, FALSE); + print_put_char(fix_arg); + break; + case DVI_XXX_1: case DVI_XXX_2: case DVI_XXX_3: case DVI_XXX_4: + cmd = *packet; packet++; + fix_arg = ovf_get_arg(&packet, cmd - DVI_XXX_1 + 1, FALSE); + break; + case DVI_FNT_1: case DVI_FNT_2: case DVI_FNT_3: case DVI_FNT_4: + cmd = *packet; packet++; + fix_arg = ovf_get_arg(&packet, cmd - DVI_FNT_1 + 1, FALSE); + print_select_font(fix_arg); + break; + default: + internal_error_1("Unrecognized DVI packet (%d)\n", *packet); + } + } + fflush(file_output); + fflush(stderr); +} + +void +check_char_tag(unsigned c) +{ + ensure_existence(c); +} + +void +set_char_tag(unsigned c, unsigned tag) +{ + ensure_existence(c); + planes[c/PLANE][c%PLANE]->tag = tag; +} + +void +set_char_remainder(unsigned c, unsigned remainder) +{ + ensure_existence(c); + planes[c/PLANE][c%PLANE]->remainder = remainder; +} + +int +get_char_remainder(unsigned c) +{ + ensure_existence(c); + return planes[c/PLANE][c%PLANE]->remainder; +} + +void +set_next_larger(unsigned larger) +{ + check_char_tag(current_character->c); + set_char_tag(current_character->c, TAG_LIST); + set_char_remainder(current_character->c, larger); +} + +void +init_var_character(void) +{ + four_pieces *entry = (four_pieces *) xmalloc(sizeof(four_pieces)); + unsigned j; + + check_char_tag(current_character->c); + set_char_tag(current_character->c, TAG_EXT); + append_to_queue(&exten_queue, entry); + for (j=E_MIN; j<=E_MAX; j++) { + entry->pieces[j] = 0; + } + set_char_remainder(current_character->c, ne); + current_character->extens = (unsigned int *)entry->pieces; + ne++; +} + +void +set_extensible_piece(unsigned piece, unsigned val) +{ + unsigned *exten = current_character->extens; + + if ((piece < E_MIN) || (piece > E_MAX)) + internal_error_1("set_extensible_piece (piece=%d)", piece); + if (exten[piece]!=0) + warning_0("value already defined"); + exten[piece] = val; +} + +void +adjust_labels(boolean play_with_starts) +{ + unsigned plane, index; + unsigned c; + char_entry *entry; + int max_start = (ofm_level==OFM_TFM) ? MAX_START_TFM : MAX_START_OFM; + + label_table = (label_entry *)xmalloc((no_labels+2)*sizeof(label_entry)); + label_ptr = 0; + label_table[0].rr = -1; /* sentinel */ + FOR_ALL_CHARACTERS( + if ((c>=bc) && (c<=ec) && (entry->tag == TAG_LIG)) { + sort_ptr = label_ptr; /* hole at position sort_ptr+1 */ + while (label_table[sort_ptr].rr > (int)(entry->remainder)) { + label_table[sort_ptr+1] = label_table[sort_ptr]; + sort_ptr--; /* move the hole */ + } + label_table[sort_ptr+1].cc = c; + label_table[sort_ptr+1].rr = entry->remainder; + label_ptr++; + } + ) + if (play_with_starts) { + if (bchar != CHAR_BOUNDARY) { + extra_loc_needed = TRUE; lk_offset = 1; + } else { + extra_loc_needed = FALSE; lk_offset = 0; + } + sort_ptr = label_ptr; /* the largest unallocated label */ + if ((label_table[sort_ptr].rr + lk_offset) > max_start) { + lk_offset=0; extra_loc_needed=FALSE; + /* location 0 can do double duty */ + do { + set_char_remainder(label_table[sort_ptr].cc, lk_offset); + while (label_table[sort_ptr-1].rr == label_table[sort_ptr].rr) { + sort_ptr--; + set_char_remainder(label_table[sort_ptr].cc, lk_offset); + } + lk_offset++; sort_ptr--; + } while ((lk_offset+label_table[sort_ptr].rr) > max_start); + /* N.B. lk_offset=MAX_START+1 satisfies this when sort_ptr=0 */ + } + if (lk_offset>0) { + while (sort_ptr>0) { + set_char_remainder(label_table[sort_ptr].cc, + get_char_remainder(label_table[sort_ptr].cc) + +lk_offset); + sort_ptr--; + } + } + } +} + +void +print_labels(void) +{ + unsigned i; + + if (label_ptr>0) { + left(); out("COMMENT"); out_ln(); + for (i=1; i<=label_ptr; i++) { + left(); out("LABEL_ENTRY"); out(" "); + out_int(i,10); out(" "); + out_char(label_table[i].cc); out(" "); + out_int(label_table[i].rr, 10); right(); + } + right(); + } +} + +void +check_and_correct(void) +{ + build_kern_table(); + build_dimen_tables(); + build_exten_table(); + check_ligature_ends_properly(); + compute_ofm_character_info(); + adjust_labels(TRUE); + check_existence_all_character_fields(); + calculate_seven_bit_safe_flag(); + check_ligature_infinite_loops(); + check_charlist_infinite_loops(); + doublecheck_ligatures(); + doublecheck_extens(); +} + +void +check_charlist_infinite_loops(void) +{ + unsigned plane, index; + unsigned c; + char_entry *entry; + unsigned g; + + FOR_ALL_CHARACTERS( + if (entry->tag == TAG_LIST) { + g = entry->remainder; + while ((g < c) && (planes[g/PLANE][g%PLANE]->tag == TAG_LIST)) { + g = planes[g/PLANE][g%PLANE]->remainder; + } + if (g == c) { + entry->tag = TAG_NONE; + entry->remainder = 0; + warning_1("Cycle of NEXTLARGER characters " + "has been broken at ",c); + } + } + ) +} + +void +build_exten_table(void) +{ + list L1 = exten_queue.front, L2; + unsigned i = 0; + + exten_table = (four_pieces **) xmalloc(ne*sizeof(four_pieces *)); + while (L1 != NULL) { + exten_table[i] = (four_pieces *)L1->contents; + L2 = L1->ptr; + free(L1); L1 = L2; + i++; + } +} + +void +retrieve_exten_table(unsigned char *table) +{ + unsigned i = 0, j; + four_pieces *entry; + + exten_table = (four_pieces **) xmalloc(ne*sizeof(four_pieces *)); + for (i=0; i<ne; i++) { + exten_table[i] = entry = (four_pieces *) xmalloc(sizeof(four_pieces)); + for (j=E_MIN; j<=E_MAX; j++) { + if (ofm_level==OFM_TFM) { + entry->pieces[j] = table[4*i+j] & 0xff; + } else { + entry->pieces[j] = + ((table[8*i+j*2] & 0xff) << 8) | + (table[8*i+j*2+1] & 0xff); + } + } + } +} + +void +print_extens(void) +{ + unsigned i,j; + + if (ne>0) { + left(); out("COMMENT"); out_ln(); + for (i=0; i<ne; i++) { + left(); out("EXTEN_ENTRY"); + out(" "); out_int(i,10); out_ln(); + for (j=E_MIN; j<=E_MAX; j++) { + if (exten_table[i]->pieces[j] != 0) + print_extensible_piece(j,exten_table[i]->pieces[j]); + } + right(); + } + right(); + } +} + +void +doublecheck_extens(void) +{ + unsigned i,j; + + if (ne>0) { + for (i=0; i<ne; i++) { + for (j=E_MIN; j<=E_MAX; j++) { + if (exten_table[i]->pieces[j] != 0) + doublecheck_existence( + exten_table[i]->pieces[j], extensible_pieces[j], + "Unused %s piece (H %X) refers to " + "nonexistent character"); + } + } + } +} + +void +compute_ligkern_offset(void) +{ +} + +void +compute_character_info_size(void) +{ +} + +void +output_ofm_extensible(void) +{ + unsigned i,j; + + for (i=0; i<ne; i++) { + for (j=E_MIN; j<=E_MAX; j++) { + if (exten_table[i]->pieces[j] != 0) + out_ofm_char(exten_table[i]->pieces[j]); + else out_ofm_char(0); + } + } +} + +void +compute_ofm_character_info(void) +{ + unsigned plane, index; + unsigned c; + char_entry *entry; + + bc = 0x7fffffff; ec=0; + switch (ofm_level) { + case OFM_TFM: { + FOR_ALL_EXISTING_CHARACTERS( + if (c < bc) bc = c; + if (c > ec) ec = c; + ) + break; + } + case OFM_LEVEL0: { + FOR_ALL_EXISTING_CHARACTERS( + if (c < bc) bc = c; + if (c > ec) ec = c; + ) + break; + } +/* Level 1 only uses plane 0. Take advantage of this fact. */ + case OFM_LEVEL1: { + FOR_ALL_CHARACTERS( + if (c < bc) bc = c; + if (c > ec) ec = c; + ) + break; + } + default: { internal_error_0("compute_ofm_character_info"); } + } +} + +void +output_ofm_character_info(void) +{ + unsigned plane, index; + unsigned c; + char_entry *entry; + unsigned wd, ht, dp, ic; + + switch (ofm_level) { + case OFM_TFM: { + plane=0; + for (index = bc; index <=ec; index++) { + entry = planes[plane][index]; + c = plane*PLANE + index; + if (entry == NULL) { + out_ofm_4(0); + } else { + if (entry->indices[C_WD] != NULL) + wd = entry->indices[C_WD]->index; + else wd = 0; + if (entry->indices[C_HT] != NULL) + ht = entry->indices[C_HT]->index; + else ht = 0; + if (entry->indices[C_DP] != NULL) + dp = entry->indices[C_DP]->index; + else dp = 0; + if (entry->indices[C_IC] != NULL) + ic = entry->indices[C_IC]->index; + else ic = 0; + out_ofm(wd); + out_ofm(ht*16 + dp); + out_ofm(ic*4 + entry->tag); + out_ofm(entry->remainder); + } + } + break; + } + case OFM_LEVEL0: { + plane=0; + for (index = bc; index <=ec; index++) { + entry = planes[plane][index]; + c = plane*PLANE + index; + if (entry == NULL) { + out_ofm_4(0); out_ofm_4(0); + } else { + if (entry->indices[C_WD] != NULL) + wd = entry->indices[C_WD]->index; + else wd = 0; + if (entry->indices[C_HT] != NULL) + ht = entry->indices[C_HT]->index; + else ht = 0; + if (entry->indices[C_DP] != NULL) + dp = entry->indices[C_DP]->index; + else dp = 0; + if (entry->indices[C_IC] != NULL) + ic = entry->indices[C_IC]->index; + else ic = 0; + out_ofm_2(wd); + out_ofm(ht); + out_ofm(dp); + out_ofm(ic); + out_ofm(entry->tag); + out_ofm_2(entry->remainder); + } + } + break; + } + case OFM_LEVEL1: { + internal_error_0("OFM level 1 not currently supported"); + break; + } + default: { internal_error_0("compute_ofm_character_info"); } + } +} diff --git a/Build/source/texk/web2c/omegafonts/char_routines.h b/Build/source/texk/web2c/omegafonts/char_routines.h new file mode 100644 index 00000000000..bc8665f49eb --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/char_routines.h @@ -0,0 +1,91 @@ +/* char_routines.h: Data structures for character information + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +typedef struct char_entry_struct { + in_list indices[C_MAX+1]; + unsigned index_indices[C_MAX+1]; + unsigned c; + unsigned copies; + unsigned tag; + unsigned remainder; + unsigned defined; + unsigned accent; + unsigned *extens; + unsigned ovf_packet_length; + unsigned char *ovf_packet; +} char_entry; + +extern char_entry *current_character; +extern char_entry *current_secondary_character; + +extern void print_characters(boolean); +extern void init_character(unsigned, char_entry *); +extern void copy_characters(unsigned, unsigned); +extern void init_planes(void); + +extern void ensure_existence(unsigned); +extern void check_char_tag(unsigned); +extern void set_char_tag(unsigned,unsigned); +extern void set_char_remainder(unsigned,unsigned); +extern void set_next_larger(unsigned); +extern void init_var_character(void); + +typedef struct label_entry_struct { + int rr; + int cc; +} label_entry; + +extern unsigned no_labels; +extern label_entry *label_table; +extern int label_ptr, sort_ptr; +extern int lk_offset; +extern boolean extra_loc_needed; + + +extern void check_and_correct(void); +extern void finalize_dimension_lists(void); +extern void check_existence_all_character_fields(void); +extern void check_charlist_infinite_loops(void); + +extern void adjust_labels(boolean); +extern void print_labels(void); +extern void set_extensible_piece(unsigned,unsigned); +extern void check_existence_and_safety(unsigned,unsigned,string,string); +extern void clear_ligature_entries(void); +extern void doublecheck_extens(void); +extern void print_extens(void); +extern void build_exten_table(void); +extern void retrieve_exten_table(unsigned char *); +extern void doublecheck_existence(unsigned, string,string); +extern void output_ovf_chars(void); +extern void print_packet(unsigned char *, unsigned); + +extern unsigned bc; +extern unsigned ec; +extern unsigned ne; + +extern void compute_ligkern_offset(void); +extern void compute_character_info_size(void); +extern void output_ofm_extensible(void); +extern void compute_ofm_character_info(void); +extern void output_ofm_character_info(void); diff --git a/Build/source/texk/web2c/omegafonts/depend.mak b/Build/source/texk/web2c/omegafonts/depend.mak new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/depend.mak diff --git a/Build/source/texk/web2c/omegafonts/dimen_routines.c b/Build/source/texk/web2c/omegafonts/dimen_routines.c new file mode 100644 index 00000000000..a4f5a1360ab --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/dimen_routines.c @@ -0,0 +1,324 @@ +/* dimen_routines.c: Data structures for holding widths, heights, etc. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "manifests.h" +#include "header_routines.h" +#include "dimen_routines.h" +#include "char_routines.h" +#include "out_routines.h" +#include "error_routines.h" +#include "out_ofm.h" +#include "parse_ofm.h" +#include "omfonts.h" + +int *measure_max_entries; +int TFM_measure_max_entries[] = + {256,16,16,64, 0,0,0,0, + 0,0,0,0, 0,0,0,0, + 0,0,0,0, 0,0,0,0}; +int OFM0_measure_max_entries[] = + {65536,256,256,256, 0,0,0,0, + 0,0,0,0, 0,0,0,0, + 0,0,0,0, 0,0,0,0}; +int OFM2_measure_max_entries[] = + {256,256,256,256, 256,256,256,256, + 256,256,256,256, 256,256,256,0, + 256,256,256,256, 256,256,256,0}; + +in_list measure_list[C_MAX+1]; +int measure_max[C_MAX+1]; +int *dimen_tables[C_MAX+1]; +unsigned char *measure_base[C_MAX+1]; + +unsigned nw=0; +unsigned nh=0; +unsigned nd=0; +unsigned ni=0; + +void +init_measures(void) +{ + register int i; + for (i=C_MIN; i<=C_MAX; i++) { + measure_list[i] = in_list1(INFINITY, NULL); + measure_max[i] = 0; + } +} + +void +set_character_measure(int index, int val) +{ + in_list L1, L2, *the_list; + + if ((index < C_MIN) || (index > C_MAX)) { + internal_error_1("set_character_measure (index=%d)", index); + return; + } + the_list = measure_list+index; + L1 = *the_list; + if (L1 == NULL) { + internal_error_0("set_character_measure (L1)"); + } else { + L2 = L1->ptr; + while ((L2 != NULL) && (lval(L2) <= val)) { + L1 = L2; + L2 = L2->ptr; + } + if (val < lval(L1)) { + *the_list = in_list1(val, NULL); + (*the_list)->ptr = L1; + (*the_list)->actual = *the_list; + measure_max[index]++; + current_character->indices[index] = *the_list; + } else if (val == lval(L1)) { + current_character->indices[index] = L1; + } else { + L2 = in_list1(val, NULL); + L2->ptr = L1->ptr; + L2->actual = L2; + L1->ptr = L2; + measure_max[index]++; + current_character->indices[index] = L2; + } + } + /* print_measures(); */ +} + +void +print_measures(void) +{ + in_list L; + register int i,j; + + for (i=C_MIN; i<=C_MAX; i++) { + L = measure_list[i]; + if (L!=NULL) { + j=0; + out_character_measure(i); + fprintf(stdout, ":\n"); + while (L != NULL) { + fprintf(stdout, " %d: ", j++); + out_fix(lval(L)); + fprintf(stdout, "\n"); + L = L->ptr; + } + fprintf(stdout, "\n"); + } + } + fprintf(stdout, "--------------------------------\n"); +} + + +int next_d; +int excess; +int delta; + +int +min_cover(int h, int d) +{ + in_list L = measure_list[h]; + int m=0; /* the current size of the cover being generated */ + int l; /* the least element covered by the current interval */ + + m = 0; next_d = INFINITY; + while (lval(L) != INFINITY) { + m++; l = lval(L); + while (lval(L->ptr) <= (l+d)) L = L->ptr; + L = L->ptr; + if ((lval(L) - l) < next_d) next_d = lval(L) - l; + } + return m; +} + +/* finds best way to round */ + +int +shorten(int h, int m) +{ + int d=0; /* the current trial interval length */ + int k; /* the size of a minimum cover */ + int M = measure_max[h]; + + if (M>m) { + excess = M-m; + k = min_cover(h,0); d = next_d; + /* now the answer is at least d*/ + /* first we ascend rapidly until finding the range */ + do { + d = d+d; k = min_cover(h,d); + } while (k>m); + /* now we run through the feasible steps */ + d = d/2; k=min_cover(h,d); + while (k>m) { + d = next_d; k = min_cover(h,d); + } + } + return d; +} + +/* reduces and indexes a list */ + +void +set_indices(int h, int d) +{ + in_list L1; /* the current node of interest */ + in_list L2; /* trails one step behind L1 */ + int l; /* least value in the current interval */ + int lprime; /* middle value for current interval */ + int m; /* index number of nodes in the current interval */ + +/* How to store the information for each character ? */ + L1 = measure_list[h]; m = 0; + while (lval(L1) != INFINITY) { + L2 = L1; + m++; l = lval(L1); + L1->index = m; + while (lval(L1->ptr) <= (l+d)) { + L1 = L1->ptr; excess--; + if (excess==0) d = 0; + } + lprime = l + (lval(L1)-l) / 2; + lval(L1) = lprime; + while (L2 != L1) { + lval(L2) = lprime; + L2->actual = L1; + L2->index = m; + L2 = L2->ptr; + } + L1 = L1->ptr; L2 = L1; + } + measure_max[h] = m; +} + +void +build_dimen_tables(void) +{ + int delta; + in_list L1; + int i,j; + + switch(ofm_level) { + case OFM_TFM: + measure_max_entries = TFM_measure_max_entries; + break; + case OFM_LEVEL0: case OFM_LEVEL1: + measure_max_entries = OFM0_measure_max_entries; + break; + default: + measure_max_entries = OFM2_measure_max_entries; + } + for (i=C_MIN; i<=C_MAX; i++) { + if (measure_max_entries[i] != 0) { + delta=shorten(i,measure_max_entries[i]); + set_indices(i,delta); + dimen_tables[i] = (int *) malloc((measure_max[i]+1)*sizeof(int)); + L1 = measure_list[i]; + j=0; + while (lval(L1) != INFINITY) { + L1 = L1->actual; + dimen_tables[i][j] = lval(L1); + L1 = L1->ptr; + j++; + } + } + } + nw = measure_max[C_WD]; + nh = measure_max[C_HT]; + nd = measure_max[C_DP]; + ni = measure_max[C_IC]; +} + +void +retrieve_dimen_tables(void) +{ + unsigned i, j; + unsigned char *k; + + measure_max[C_WD] = nw; + measure_max[C_HT] = nh; + measure_max[C_DP] = nd; + measure_max[C_IC] = ni; + measure_base[C_WD] = ofm+width_base*4; + measure_base[C_HT] = ofm+height_base*4; + measure_base[C_DP] = ofm+depth_base*4; + measure_base[C_IC] = ofm+italic_base*4; + for (i=C_IC+1; i<=C_MAX; i++) { + measure_max[i] = 0; + dimen_tables[i] = NULL; + } + for (i=C_MIN; i<=C_MAX; i++) { + dimen_tables[i] = (int *) malloc((measure_max[i]+1)*sizeof(int)); + for (j=0; j<measure_max[i]; j++) { + k = measure_base[i]+4*j; + dimen_tables[i][j] = (((*k)&0xff) << 24) | + (((*(k+1))&0xff) << 16) | + (((*(k+2))&0xff) << 8) | + ((*(k+3))&0xff); + } + } +} + +void +print_dimen_tables(void) +{ + int i, j; + + for (i=C_MIN; i<=C_MAX; i++) { + if (measure_max[i] != 0) { + left(); out("COMMENT"); out_ln(); + for (j=0; j<measure_max[i]; j++) { + left(); + out_character_measure(i); out("_ENTRY"); + out(" "); out_int(j,10); + out(" "); out_fix(dimen_tables[i][j]); + right(); + } + right(); + } + } +} + +void +set_accent(unsigned kind) +{ + if ((kind<ACC_TOP) || (kind>ACC_BOT)) { + warning_0("bad ACCENT value; ignored"); + kind = ACC_NONE; + } + current_character->accent = kind; +} + +void +output_ofm_dimension(void) +{ + int i, j; + + for (i=C_WD; i<=C_IC; i++) { + out_ofm_4(0); + for (j=0; j<measure_max[i]; j++) { + out_ofm_4(dimen_tables[i][j]); + } + } +} diff --git a/Build/source/texk/web2c/omegafonts/dimen_routines.h b/Build/source/texk/web2c/omegafonts/dimen_routines.h new file mode 100644 index 00000000000..a3894cf7f9a --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/dimen_routines.h @@ -0,0 +1,38 @@ +/* dimen_routines.h: Data structures for holding widths, heights, etc. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern int *dimen_tables[]; + +extern void set_character_measure(int, int); +extern void print_measures(void); +extern void init_measures(void); +extern void build_dimen_tables(void); +extern void retrieve_dimen_tables(void); +extern void print_dimen_tables(void); +extern void set_accent(unsigned); +extern void output_ofm_dimension(void); + +extern unsigned nw; +extern unsigned nh; +extern unsigned nd; +extern unsigned ni; diff --git a/Build/source/texk/web2c/omegafonts/dvi.h b/Build/source/texk/web2c/omegafonts/dvi.h new file mode 100644 index 00000000000..8c9eb5b8265 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/dvi.h @@ -0,0 +1,93 @@ +/* dvi.h: All of the DVI commands + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +/* VF commands */ + +#define VF_ID 202 /* the second byte of a VF file */ +#define VF_LONG_CHAR 242 /* long format for character packets */ + +/* DVI commands */ + +#define DVI_SET_CHAR_0 0 /* typeset character 0 and move right */ +#define DVI_SET_CHAR_127 127 /* ... to 127 */ +#define DVI_SET_1 128 /* typeset a char (1 byte) and move right */ +#define DVI_SET_2 129 /* typeset a char (2 bytes) and move right */ +#define DVI_SET_3 130 /* typeset a char (3 bytes) and move right */ +#define DVI_SET_4 131 /* typeset a char (4 bytes) and move right */ +#define DVI_SET_RULE 132 /* typeset a rule and move right */ +#define DVI_PUT_1 133 /* typeset a char (1 byte) and stay put */ +#define DVI_PUT_2 134 /* typeset a char (2 bytes) and stay put */ +#define DVI_PUT_3 135 /* typeset a char (3 bytes) and stay put */ +#define DVI_PUT_4 136 /* typeset a char (4 bytes) and stay put */ +#define DVI_PUT_RULE 137 /* typeset a rule and stay put */ +#define DVI_NOP 138 /* no-op */ +#define DVI_BOP 139 /* beginning of page */ +#define DVI_EOP 140 /* end of page */ +#define DVI_PUSH 141 /* save the current positions */ +#define DVI_POP 142 /* restore previous positions */ +#define DVI_RIGHT_1 143 /* move right (1 byte) */ +#define DVI_RIGHT_2 144 /* move right (2 bytes) */ +#define DVI_RIGHT_3 145 /* move right (3 bytes) */ +#define DVI_RIGHT_4 146 /* move right (4 bytes) */ +#define DVI_W_0 147 /* move right by |w| */ +#define DVI_W_1 148 /* move right and set |w| (1 byte) */ +#define DVI_W_2 149 /* move right and set |w| (2 bytes) */ +#define DVI_W_3 150 /* move right and set |w| (3 bytes) */ +#define DVI_W_4 151 /* move right and set |w| (4 bytes) */ +#define DVI_X_0 152 /* move right by |x| */ +#define DVI_X_1 153 /* move right and set |x| (1 byte) */ +#define DVI_X_2 154 /* move right and set |x| (2 bytes) */ +#define DVI_X_3 155 /* move right and set |x| (3 bytes) */ +#define DVI_X_4 156 /* move right and set |x| (4 bytes) */ +#define DVI_DOWN_1 157 /* move down (1 byte) */ +#define DVI_DOWN_2 158 /* move down (2 bytes) */ +#define DVI_DOWN_3 159 /* move down (3 bytes) */ +#define DVI_DOWN_4 160 /* move down (4 bytes) */ +#define DVI_Y_0 161 /* move down by |y| */ +#define DVI_Y_1 162 /* move down and set |y| (1 byte) */ +#define DVI_Y_2 163 /* move down and set |y| (2 bytes) */ +#define DVI_Y_3 164 /* move down and set |y| (3 bytes) */ +#define DVI_Y_4 165 /* move down and set |y| (4 bytes) */ +#define DVI_Z_0 166 /* move down by |z| */ +#define DVI_Z_1 167 /* move down and set |z| (1 byte) */ +#define DVI_Z_2 168 /* move down and set |z| (2 bytes) */ +#define DVI_Z_3 169 /* move down and set |z| (3 bytes) */ +#define DVI_Z_4 170 /* move down and set |z| (4 bytes) */ +#define DVI_FNT_NUM_0 171 /* set current font to 0 */ +#define DVI_FNT_NUM_63 234 /* ... to 234 */ +#define DVI_FNT_1 235 /* set current font (1 byte) */ +#define DVI_FNT_2 236 /* set current font (2 bytes) */ +#define DVI_FNT_3 237 /* set current font (3 bytes) */ +#define DVI_FNT_4 238 /* set current font (4 bytes) */ +#define DVI_XXX_1 239 /* extension to DVI primitives (1 byte) */ +#define DVI_XXX_2 240 /* extension to DVI primitives (2 bytes) */ +#define DVI_XXX_3 241 /* extension to DVI primitives (3 bytes) */ +#define DVI_XXX_4 242 /* extension to DVI primitives (4 bytes) */ +#define DVI_FNT_DEF_1 243 /* declare font (1 byte) */ +#define DVI_FNT_DEF_2 244 /* declare font (2 bytes) */ +#define DVI_FNT_DEF_3 245 /* declare font (3 bytes) */ +#define DVI_FNT_DEF_4 246 /* declare font (4 bytes) */ +#define DVI_PRE 247 /* preamble */ +#define DVI_POST 248 /* postamble beginning */ +#define DVI_POST_POST 249 /* postamble ending */ + diff --git a/Build/source/texk/web2c/omegafonts/error_routines.c b/Build/source/texk/web2c/omegafonts/error_routines.c new file mode 100644 index 00000000000..dfb234cb539 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/error_routines.c @@ -0,0 +1,184 @@ +/* error_routines.c: General error routines. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "parser.h" + +/* Error routines: + +All of the routines in this file have the same general format. +They + +*/ + +void +lex_error_0(string fmt) +{ + fprintf(stderr, "line %d (lexing): ", line_number); + fprintf(stderr, fmt); + fprintf(stderr, "\n"); +} + +void +lex_error_1(string fmt, int item) +{ + fprintf(stderr, "line %d (lexing): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); +} + +void +lex_error_s(string fmt, string item) +{ + fprintf(stderr, "line %d (lexing): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); +} + +void +lex_error_s_1(string fmt, string item, int item1) +{ + fprintf(stderr, "line %d (lexing): ", line_number); + fprintf(stderr, fmt, item, item1); + fprintf(stderr, "\n"); +} + +void +yyerror(string fmt) +{ + fprintf(stderr, "line %d (parsing): ", line_number); + fprintf(stderr, fmt); + fprintf(stderr, "\n"); +} + + +void +warning_0(string fmt) +{ + fprintf(stderr, "line %d (warning): ", line_number); + fprintf(stderr, fmt); + fprintf(stderr, "\n"); +} + +void +warning_1(string fmt, int item) +{ + fprintf(stderr, "line %d (warning): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); +} + +void +warning_2(string fmt, int item, int item2) +{ + fprintf(stderr, "line %d (warning): ", line_number); + fprintf(stderr, fmt, item, item2); + fprintf(stderr, "\n"); +} + +void +warning_s(string fmt, string item) +{ + fprintf(stderr, "line %d (warning): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); +} + +void +warning_s_1(string fmt, string item, int item1) +{ + fprintf(stderr, "line %d (warning): ", line_number); + fprintf(stderr, fmt, item, item1); + fprintf(stderr, "\n"); +} + +void +warning_s_2(string fmt, string item, int item1, int item2) +{ + fprintf(stderr, "line %d (warning): ", line_number); + fprintf(stderr, fmt, item, item1, item2); + fprintf(stderr, "\n"); +} + +void +fatal_error_0(string fmt) +{ + fprintf(stderr, "line %d (fatal): ", line_number); + fprintf(stderr, fmt); + fprintf(stderr, "\n"); + exit(1); +} + +void +fatal_error_1(string fmt, int item) +{ + fprintf(stderr, "line %d (fatal): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); + exit(1); +} + +void +fatal_error_2(string fmt, int item, int item2) +{ + fprintf(stderr, "line %d (fatal): ", line_number); + fprintf(stderr, fmt, item, item2); + fprintf(stderr, "\n"); + exit(1); +} + +void +fatal_error_s(string fmt, string item) +{ + fprintf(stderr, "line %d (fatal): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); + exit(1); +} + +void +internal_error_0(string fmt) +{ + fprintf(stderr, "line %d (internal): ", line_number); + fprintf(stderr, fmt); + fprintf(stderr, "\n"); + exit(2); +} + +void +internal_error_1(string fmt, int item) +{ + fprintf(stderr, "line %d (internal): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); + exit(2); +} + +void +internal_error_s(string fmt, string item) +{ + fprintf(stderr, "line %d (internal): ", line_number); + fprintf(stderr, fmt, item); + fprintf(stderr, "\n"); + exit(2); +} diff --git a/Build/source/texk/web2c/omegafonts/error_routines.h b/Build/source/texk/web2c/omegafonts/error_routines.h new file mode 100644 index 00000000000..6bd09db62f9 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/error_routines.h @@ -0,0 +1,47 @@ +/* error_routines.h: General error routines. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern void lex_error_0(string); +extern void lex_error_1(string, int); +extern void lex_error_s(string, string); +extern void lex_error_s_1(string, string, int); + +extern void fatal_error_0(string); +extern void fatal_error_1(string, int); +extern void fatal_error_2(string, int, int); +extern void fatal_error_s(string, string); + +extern void yyerror(string); + +extern void warning_0(string); +extern void warning_1(string, int); +extern void warning_2(string, int, int); +extern void warning_s(string, string); +extern void warning_s_1(string, string, int); +extern void warning_s_2(string, string, int, int); + +extern void internal_error_0(string); +extern void internal_error_1(string, int); +extern void internal_error_s(string, string); + + diff --git a/Build/source/texk/web2c/omegafonts/extra_routines.c b/Build/source/texk/web2c/omegafonts/extra_routines.c new file mode 100644 index 00000000000..924417f2f27 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/extra_routines.c @@ -0,0 +1,479 @@ +/* extra_routines.c: Tables for glues, rules, penalties, etc. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "manifests.h" +#include "list_routines.h" +#include "extra_routines.h" +#include "header_routines.h" +#include "error_routines.h" + +#define MAX_EXTRA_TABLES 16 +#define MAX_TABLE_ENTRIES 256 + +unsigned *ivalue_tables[MAX_EXTRA_TABLES]; +unsigned *penalty_tables[MAX_EXTRA_TABLES]; +fix *fvalue_tables[MAX_EXTRA_TABLES]; +fix *mvalue_tables[MAX_EXTRA_TABLES]; +rule *rule_tables[MAX_EXTRA_TABLES]; +glue *glue_tables[MAX_EXTRA_TABLES]; + +unsigned max_ivalue_entry[MAX_EXTRA_TABLES]; +unsigned max_penalty_entry[MAX_EXTRA_TABLES]; +unsigned max_fvalue_entry[MAX_EXTRA_TABLES]; +unsigned max_mvalue_entry[MAX_EXTRA_TABLES]; +unsigned max_rule_entry[MAX_EXTRA_TABLES]; +unsigned max_glue_entry[MAX_EXTRA_TABLES]; + +unsigned no_ivalue_tables = 0; +unsigned no_penalty_tables = 0; +unsigned no_fvalue_tables = 0; +unsigned no_mvalue_tables = 0; +unsigned no_rule_tables = 0; +unsigned no_glue_tables = 0; + +unsigned *cur_ivalue_table; +unsigned *cur_penalty_table; +fix *cur_mvalue_table; +fix *cur_fvalue_table; +rule *cur_rule_table; +glue *cur_glue_table; + +unsigned cur_ivalue_table_index; +unsigned cur_penalty_table_index; +unsigned cur_mvalue_table_index; +unsigned cur_fvalue_table_index; +unsigned cur_rule_table_index; +unsigned cur_glue_table_index; + +unsigned *cur_ivalue_entry; +unsigned *cur_penalty_entry; +fix *cur_mvalue_entry; +fix *cur_fvalue_entry; +rule *cur_rule_entry; +glue *cur_glue_entry; + +unsigned nki=0; +unsigned nwi=0; +unsigned nkp=0; +unsigned nwp=0; +unsigned nkm=0; +unsigned nwm=0; +unsigned nkf=0; +unsigned nwf=0; +unsigned nkr=0; +unsigned nwr=0; +unsigned nkg=0; +unsigned nwg=0; + +void +compute_ofm_extra_stuff(void) +{ + unsigned i=0; + + if (ofm_level >= OFM_LEVEL1) { + nki = no_ivalue_tables; + nkp = no_penalty_tables; + nkm = no_mvalue_tables; + nkf = no_fvalue_tables; + nkr = no_rule_tables; + nkg = no_glue_tables; + for (i=0; i<nki; i++) { + nwi += max_ivalue_entry[i]; + } + for (i=0; i<nkp; i++) { + nwp += max_penalty_entry[i]; + } + for (i=0; i<nkm; i++) { + nwm += max_mvalue_entry[i]; + } + for (i=0; i<nkf; i++) { + nwf += max_fvalue_entry[i]; + } + for (i=0; i<nkr; i++) { + nwr += 3 * max_rule_entry[i]; + } + for (i=0; i<nkg; i++) { + nwg += 4 * max_glue_entry[i]; + } + } +} + +void +output_ofm_extra_stuff(void) +{ + if (ofm_level >= OFM_LEVEL1) { + fatal_error_0("OFM level 1 not currently supported"); + } +} + +void +init_all_tables(void) +{ + unsigned i=0; + + for (i=0; i<MAX_EXTRA_TABLES; i++) { + ivalue_tables[i] = NULL; + penalty_tables[i] = NULL; + fvalue_tables[i] = NULL; + mvalue_tables[i] = NULL; + rule_tables[i] = NULL; + glue_tables[i] = NULL; + } +} + +void +init_font_ivalue(unsigned tab) +{ + unsigned j; + + if (tab>=MAX_EXTRA_TABLES) + internal_error_1("init_font_ivalue (tab=%d)", tab); + if (ivalue_tables[tab] != NULL) { + warning_1("IVALUE table (D %d) previously defined; " + "old value ignored", tab); + cur_ivalue_table = ivalue_tables[tab]; + for (j=0; j<MAX_TABLE_ENTRIES; j++) { + cur_ivalue_table[j] = 0; + } + } else { + no_ivalue_tables++; + ivalue_tables[tab] = + (unsigned *) xmalloc(MAX_TABLE_ENTRIES*sizeof(unsigned)); + cur_ivalue_table = ivalue_tables[tab]; + } + max_ivalue_entry[tab] = 0; +} + +void +init_font_penalty(unsigned tab) +{ + unsigned j; + + if (tab>=MAX_EXTRA_TABLES) + internal_error_1("init_font_penalty (tab=%d)", tab); + if (penalty_tables[tab] != NULL) { + warning_1("IVALUE table (D %d) previously defined; " + "old value ignored", tab); + cur_penalty_table = ivalue_tables[tab]; + for (j=0; j<MAX_TABLE_ENTRIES; j++) { + cur_penalty_table[j] = 0; + } + } else { + no_penalty_tables++; + penalty_tables[tab] = + (unsigned *) xmalloc(MAX_TABLE_ENTRIES*sizeof(unsigned)); + cur_penalty_table = ivalue_tables[tab]; + } + max_penalty_entry[tab] = 0; +} + +void +init_font_mvalue(unsigned tab) +{ + unsigned j; + + if (tab>=MAX_EXTRA_TABLES) + internal_error_1("init_font_mvalue (tab=%d)", tab); + if (mvalue_tables[tab] != NULL) { + warning_1("MVALUE table (D %d) previously defined; " + "old value ignored", tab); + cur_mvalue_table = mvalue_tables[tab]; + for (j=0; j<MAX_TABLE_ENTRIES; j++) { + cur_mvalue_table[j] = 0; + } + } else { + no_mvalue_tables++; + mvalue_tables[tab] = + (fix *) xmalloc(MAX_TABLE_ENTRIES*sizeof(unsigned)); + cur_mvalue_table = mvalue_tables[tab]; + } + max_mvalue_entry[tab] = 0; +} + +void +init_font_fvalue(unsigned tab) +{ + unsigned j; + + if (tab>=MAX_EXTRA_TABLES) + internal_error_1("init_font_fvalue (tab=%d)", tab); + if (fvalue_tables[tab] != NULL) { + warning_1("FVALUE table (D %d) previously defined; " + "old value ignored", tab); + cur_fvalue_table = fvalue_tables[tab]; + for (j=0; j<MAX_TABLE_ENTRIES; j++) { + cur_fvalue_table[j] = 0; + } + } else { + no_fvalue_tables++; + fvalue_tables[tab] = + (fix *) xmalloc(MAX_TABLE_ENTRIES*sizeof(unsigned)); + cur_fvalue_table = fvalue_tables[tab]; + } + max_fvalue_entry[tab] = 0; +} + +void +init_font_rule(unsigned tab) +{ + unsigned j; + + if (tab>=MAX_EXTRA_TABLES) + internal_error_1("init_font_rule (tab=%d)", tab); + if (rule_tables[tab] != NULL) { + warning_1("RULE table (D %d) previously defined; " + "old value ignored", tab); + cur_rule_table = rule_tables[tab]; + for (j=0; j<MAX_TABLE_ENTRIES; j++) { + cur_rule_table[j].rule_wd = 0; + cur_rule_table[j].rule_dp = 0; + cur_rule_table[j].rule_ht = 0; + } + } else { + no_rule_tables++; + rule_tables[tab] = + (rule *) xmalloc(MAX_TABLE_ENTRIES*sizeof(rule)); + cur_rule_table = rule_tables[tab]; + } + max_rule_entry[tab] = 0; +} + +void +init_font_glue(unsigned tab) +{ + unsigned j; + + if (tab>=MAX_EXTRA_TABLES) + internal_error_1("init_font_glue (tab=%d)", tab); + if (glue_tables[tab] != NULL) { + warning_1("GLUE table (D %d) previously defined; " + "old value ignored", tab); + cur_glue_table = glue_tables[tab]; + for (j=0; j<MAX_TABLE_ENTRIES; j++) { + cur_glue_table[j].glue_width = 0; + cur_glue_table[j].glue_stretch = 0; + cur_glue_table[j].glue_shrink = 0; + cur_glue_table[j].glue_stretch_order = 0; + cur_glue_table[j].glue_shrink_order = 0; + cur_glue_table[j].glue_type = 0; + cur_glue_table[j].glue_arg_type = GLUEARG_NONE; + cur_glue_table[j].glue_arg1 = 0; + cur_glue_table[j].glue_arg2 = 0; + } + } else { + no_glue_tables++; + glue_tables[tab] = + (glue *) xmalloc(MAX_TABLE_ENTRIES*sizeof(glue)); + cur_glue_table = glue_tables[tab]; + } + max_glue_entry[tab] = 0; +} + + +void +init_font_ivalue_entry(unsigned index) +{ + if (index>=MAX_TABLE_ENTRIES) + internal_error_1("init_font_ivalue_entry (index=%d)", index); + cur_ivalue_entry = &cur_ivalue_table[index]; + if (max_ivalue_entry[cur_ivalue_table_index]<index) + max_ivalue_entry[cur_ivalue_table_index] = index; +} + +void +init_font_penalty_entry(unsigned index) +{ + if (index>=MAX_TABLE_ENTRIES) + internal_error_1("init_font_penalty_entry (index=%d)", index); + cur_penalty_entry = &cur_penalty_table[index]; + if (max_penalty_entry[cur_penalty_table_index]<index) + max_penalty_entry[cur_penalty_table_index] = index; +} + +void +init_font_mvalue_entry(unsigned index) +{ + if (index>=MAX_TABLE_ENTRIES) + internal_error_1("init_font_mvalue_entry (index=%d)", index); + cur_mvalue_entry = &cur_mvalue_table[index]; + if (max_mvalue_entry[cur_mvalue_table_index]<index) + max_mvalue_entry[cur_mvalue_table_index] = index; +} + +void +init_font_fvalue_entry(unsigned index) +{ + if (index>=MAX_TABLE_ENTRIES) + internal_error_1("init_font_fvalue_entry (index=%d)", index); + cur_fvalue_entry = &cur_fvalue_table[index]; + if (max_fvalue_entry[cur_fvalue_table_index]<index) + max_fvalue_entry[cur_fvalue_table_index] = index; +} + +void +init_font_rule_entry(unsigned index) +{ + if (index>=MAX_TABLE_ENTRIES) + internal_error_1("init_font_rule_entry (index=%d)", index); + cur_rule_entry = &cur_rule_table[index]; + if (max_rule_entry[cur_rule_table_index]<index) + max_rule_entry[cur_rule_table_index] = index; +} + +void +init_font_glue_entry(unsigned index) +{ + if (index>=MAX_TABLE_ENTRIES) + internal_error_1("init_font_glue_entry (index=%d)", index); + cur_glue_entry = &cur_glue_table[index]; + if (max_glue_entry[cur_glue_table_index]<index) + max_glue_entry[cur_glue_table_index] = index; +} + + +void +set_font_ivalue_definition(unsigned val) +{ + *cur_ivalue_entry = val; +} + +void +set_font_penalty_definition(unsigned val) +{ + *cur_penalty_entry = val; +} + +void +set_font_mvalue_definition(fix fval) +{ + *cur_mvalue_entry = fval; +} + +void +set_font_fvalue_definition(fix fval) +{ + *cur_fvalue_entry = fval; +} + +void +set_font_rule_measure(unsigned measure, fix fval) +{ + switch (measure) { + case RULE_WD: { + cur_rule_entry->rule_wd = fval; break; + } + case RULE_HT: { + cur_rule_entry->rule_ht = fval; break; + } + case RULE_DP: { + cur_rule_entry->rule_dp = fval; break; + } + default: { + internal_error_1("set_font_rule_measure (measure=%d)", measure); + } + } +} + + +void +set_font_glue_width(fix width) +{ + cur_glue_entry->glue_width = width; +} + +void +set_font_glue_shrink_stretch(unsigned shrink_stretch, + fix width, unsigned order) +{ + switch (shrink_stretch) { + case GLUE_SHRINK: { + cur_glue_entry->glue_shrink = width; break; + cur_glue_entry->glue_shrink_order = order; break; + } + case GLUE_STRETCH: { + cur_glue_entry->glue_stretch_order = order; break; + } + default: { + internal_error_1("set_font_rule_measure (shrink_stretch=%d)", + shrink_stretch); + } + } +} + +void +set_font_glue_type(unsigned type) +{ + cur_glue_entry->glue_type = type; +} + +void +set_font_glue_character(unsigned c) +{ + cur_glue_entry->glue_arg_type = GLUEARG_CHAR; + cur_glue_entry->glue_arg1 = c; +} + +void +set_font_glue_rule(unsigned rule_table, unsigned rule_index) +{ + cur_glue_entry->glue_arg_type = GLUEARG_RULE; + cur_glue_entry->glue_arg1 = rule_table; + cur_glue_entry->glue_arg2 = rule_index; +} + +void +set_character_ivalue(unsigned table, unsigned index) +{ + fatal_error_0("CHARIVALUE not currently supported"); +} + +void +set_character_penalty(unsigned table, unsigned index) +{ + fatal_error_0("CHARPENALTY not currently supported"); +} + +void +set_character_mvalue(unsigned table, unsigned index) +{ + fatal_error_0("CHARMVALUE not currently supported"); +} + +void +set_character_fvalue(unsigned table, unsigned index) +{ + fatal_error_0("CHARFVALUE not currently supported"); +} + +void +set_character_rule(unsigned table, unsigned index) +{ + fatal_error_0("CHARRULE not currently supported"); +} + +void +set_character_glue(unsigned table, unsigned index) +{ + fatal_error_0("CHARGLUE not currently supported"); +} diff --git a/Build/source/texk/web2c/omegafonts/extra_routines.h b/Build/source/texk/web2c/omegafonts/extra_routines.h new file mode 100644 index 00000000000..6f8a5a10acc --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/extra_routines.h @@ -0,0 +1,88 @@ +/* extra_routines.h: Tables for glues, rules, penalties, etc. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern void init_font_ivalue(unsigned); +extern void init_font_mvalue(unsigned); +extern void init_font_fvalue(unsigned); +extern void init_font_penalty(unsigned); +extern void init_font_rule(unsigned); +extern void init_font_glue(unsigned); + + +void init_font_ivalue_entry(unsigned); +void set_font_ivalue_definition(unsigned); +void init_font_mvalue_entry(unsigned); +void set_font_mvalue_definition(fix); +void init_font_fvalue_entry(unsigned); +void set_font_fvalue_definition(fix); +void init_font_penalty_entry(unsigned); +void set_font_penalty_definition(unsigned); +void init_font_rule_entry(unsigned); +void set_font_rule_measure(unsigned, fix); +void init_font_glue_entry(unsigned); +void set_font_glue_type(unsigned); +void set_font_glue_width(fix); +void set_font_glue_character(unsigned); +void set_font_glue_rule(unsigned, unsigned); +void set_font_glue_shrink_stretch(unsigned, fix, unsigned); + +typedef struct rule_struct { + fix rule_wd; + fix rule_ht; + fix rule_dp; +} rule; + +typedef struct glue_struct { + fix glue_width; + fix glue_stretch; + fix glue_shrink; + unsigned glue_stretch_order; + unsigned glue_shrink_order; + unsigned glue_type; + unsigned glue_arg_type; + unsigned glue_arg1; + unsigned glue_arg2; +} glue; + +extern void set_character_ivalue(unsigned, unsigned); +extern void set_character_penalty(unsigned, unsigned); +extern void set_character_mvalue(unsigned, unsigned); +extern void set_character_fvalue(unsigned, unsigned); +extern void set_character_rule(unsigned, unsigned); +extern void set_character_glue(unsigned, unsigned); +extern void compute_ofm_extra_stuff(void); +extern void output_ofm_extra_stuff(void); + +extern unsigned nki; +extern unsigned nwi; +extern unsigned nkp; +extern unsigned nwp; +extern unsigned nkm; +extern unsigned nwm; +extern unsigned nkf; +extern unsigned nwf; +extern unsigned nkr; +extern unsigned nwr; +extern unsigned nkg; +extern unsigned nwg; + diff --git a/Build/source/texk/web2c/omegafonts/font_routines.c b/Build/source/texk/web2c/omegafonts/font_routines.c new file mode 100644 index 00000000000..8cb763b7db0 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/font_routines.c @@ -0,0 +1,757 @@ +/* font_routines.c: Data structures for virtual font support + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "manifests.h" +#include "dvi.h" +#include "error_routines.h" +#include "list_routines.h" +#include "font_routines.h" +#include "char_routines.h" +#include "header_routines.h" +#include "print_routines.h" +#include "out_routines.h" +#include "omfonts.h" + +#define BLOCK 256 + +font *font_table = NULL; +unsigned font_table_size = 0; +unsigned no_fonts = 0; +font *cur_font = NULL; +unsigned cur_font_index = 0; + +unsigned vtitle_length = 0; +unsigned vf_check_sum = 0; +unsigned vf_design_size = 0; + +void +font_table_init(void) +{ + font_table_size = BLOCK; + font_table = (font *) xmalloc(font_table_size); + no_fonts = 0; +} + +void +font_no_incr(void) +{ + if (no_fonts == font_table_size) { + font_table_size += BLOCK; + font_table = (font *) xrealloc(font_table, font_table_size); + } + no_fonts++; +} + +void +clear_map_font(int font_number) +{ + if (cur_font==NULL) internal_error_0("clear_map_font"); + cur_font->font_number = font_number; + cur_font->font_name = NULL; + cur_font->font_area = NULL; + cur_font->font_at = 0; + cur_font->font_checksum = 0; + cur_font->font_dsize = 10*UNITY; + cur_font->font_at_defined = FALSE; + cur_font->font_checksum_defined = FALSE; + cur_font->font_dsize_defined = FALSE; + cur_font->ovf_packet = NULL; + cur_font->ovf_packet_length = 0; +} + +void +init_map_font(int font_number) +{ + unsigned i=0; + + while (i<no_fonts) { + if (font_number == font_table[i].font_number) { + warning_1("MAPFONT index (D %d) previously defined; " + "old definition ignored", font_number); + cur_font = &font_table[i]; + if (cur_font->font_area != NULL) + free(cur_font->font_area); + if (cur_font->font_name != NULL) + free(cur_font->font_name); + if (cur_font->ovf_packet != NULL) + free(cur_font->ovf_packet); + clear_map_font(font_number); + break; + } + i++; + } + if (i==no_fonts) { + font_no_incr(); + cur_font = &font_table[i]; + clear_map_font(font_number); + } + packet_table_init(); + append_command(DVI_FNT_DEF_1, i); + cur_font_index = i; + cur_font = &font_table[i]; + cur_font->ovf_packet = cur_packet; + cur_font->ovf_packet_length = packet_ptr; + packet_table_end(); + +} + +void +set_font_name(string name) +{ + if (cur_font==NULL) { + internal_error_0("set_font_name"); + } + if (cur_font->font_name != NULL) { + warning_0("FONTNAME previously defined; old value ignored"); + free(cur_font->font_name); + cur_font->font_name=NULL; + } + cur_font->font_name = name; +} + +void +set_font_area(string area) +{ + if (cur_font==NULL) { + internal_error_0("set_font_area"); + } + if (cur_font->font_area != NULL) { + warning_0("FONTAREA previously defined; old value ignored"); + free(cur_font->font_area); + cur_font->font_area=NULL; + } + cur_font->font_area = area; +} + +void +set_font_check_sum(unsigned cs) +{ + if (cur_font==NULL) { + internal_error_0("set_font_check_sum"); + } + if (cur_font->font_checksum_defined != FALSE) { + warning_0("FONTCHECKSUM previously defined; old value ignored"); + } + cur_font->font_checksum = cs; + cur_font->font_checksum_defined = TRUE; +} + +void +set_font_at(fix at) +{ + if (cur_font==NULL) { + internal_error_0("set_font_at"); + } + if (cur_font->font_at_defined != FALSE) { + warning_0("FONTAT previously defined; old value ignored"); + } + cur_font->font_at = at; + cur_font->font_at_defined = TRUE; +} + +void +set_font_design_size(fix ds) +{ + if (cur_font==NULL) { + internal_error_0("set_font_design_size"); + } + if (cur_font->font_dsize_defined != FALSE) { + warning_0("FONTDSIZE previously defined; old value ignored"); + } + cur_font->font_dsize = ds; + cur_font->font_dsize_defined = TRUE; +} + +string vtitle = NULL; + +void +set_vtitle(string title) +{ + if (vtitle!=NULL) { + warning_0("VTITLE previously defined; old value ignored"); + free(vtitle); vtitle = NULL; + } + vtitle = title; +} + +unsigned packet_table_size = 0; +unsigned char *packet_table = NULL; +unsigned char *cur_packet = NULL; +unsigned packet_ptr = 0; + +void +packet_table_init(void) +{ + packet_table_size = BLOCK; + packet_table = (unsigned char *) xmalloc(packet_table_size); + packet_ptr = 0; + cur_packet = packet_table; +} + +void +packet_ptr_incr(void) +{ + if (packet_ptr == packet_table_size) { + packet_table_size += BLOCK; + packet_table = (unsigned char *) + xrealloc(packet_table, packet_table_size); + } + packet_ptr++; +} + +void +append_to_packet(unsigned val) +{ + packet_ptr_incr(); + packet_table[packet_ptr-1] = val & 0xff; +} + +void +init_map(void) +{ + move_table_init(); + packet_table_init(); +} + +void +end_map(void) +{ + current_character->ovf_packet = cur_packet; + current_character->ovf_packet_length = packet_ptr; + packet_table_end(); +} + +void +append_command_2(unsigned cmd_0, unsigned max_n, + unsigned cmd_1, unsigned actual) +{ + if ((actual < 0) || (actual > 0x7fffffff)) + internal_error_1("append_command (actual=%d)", actual); + if ((cmd_0 + actual) <= max_n) + append_to_packet(cmd_0 + actual); + else + append_command(cmd_1, actual); +} + +void +append_command(unsigned cmd_1, unsigned actual) +{ + if ((cmd_1 != DVI_SET_1) && (cmd_1 != DVI_FNT_1) && + (cmd_1 != DVI_FNT_DEF_1) && (cmd_1 != DVI_XXX_1)) { + internal_error_1("append_command (cmd_1=%d)", cmd_1); + } + if (actual < 0x100) { + append_to_packet(cmd_1); + append_to_packet(actual); + } else if (actual < 0x10000) { + append_to_packet(cmd_1 + 1); + append_to_packet(actual >> 8); + append_to_packet(actual & 0xff); + } else if (actual < 0x1000000) { + append_to_packet(cmd_1 + 2); + append_to_packet(actual >> 16); + append_to_packet((actual >> 8) & 0xff); + append_to_packet(actual & 0xff); + } else { + append_to_packet(cmd_1 + 3); +/* BUG: Should deal with negative numbers */ + append_to_packet((actual >> 24) & 0xff); + append_to_packet((actual >> 16) & 0xff); + append_to_packet((actual >> 8) & 0xff); + append_to_packet(actual & 0xff); + } + +} + +unsigned char *ovf_ptr=NULL; + +int +ovf_get_arg(unsigned char **ptr, unsigned k, boolean is_signed) +{ + int a, b; + + if (k>4) internal_error_1("ovf_get_arg (k=%d)", k); + a = b = (int) ((**ptr) & 0xff); + (*ptr)++; + if ((is_signed==TRUE) || (k==4)) { /* 4-byte numbers are signed */ + if (b > 0x7f) { a = a - 0x100; } + } + while (k>1) { + b = (**ptr) & 0xff; + (*ptr)++; + a = 0x100 * a + b; + k--; + } + return a; +} + +void +input_command(unsigned *cmd, int *actual) +{ + unsigned the_cmd = *ovf_ptr & 0xff; + + ovf_ptr++; + if ((the_cmd>=DVI_SET_CHAR_0) && (the_cmd<=DVI_SET_CHAR_127)) { + (*cmd)=DVI_SET_1; + (*actual) = the_cmd; + } else if ((the_cmd>=DVI_SET_1) && (the_cmd<=DVI_SET_4)) { + (*cmd)=DVI_SET_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_SET_1 + 1, FALSE); + } else if ((the_cmd>=DVI_FNT_NUM_0) && (the_cmd<=DVI_FNT_NUM_63)) { + (*cmd)=DVI_FNT_1; + (*actual) = the_cmd - DVI_FNT_NUM_0; + } else if ((the_cmd>=DVI_FNT_1) && (the_cmd<=DVI_FNT_4)) { + (*cmd)=DVI_FNT_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_FNT_1 + 1, FALSE); + } else if ((the_cmd>=DVI_FNT_DEF_1) && (the_cmd<=DVI_FNT_DEF_4)) { + (*cmd)=DVI_FNT_DEF_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_FNT_DEF_1 + 1, FALSE); + } else if ((the_cmd>=DVI_XXX_1) && (the_cmd<=DVI_XXX_4)) { + (*cmd)=DVI_XXX_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_XXX_1 + 1, FALSE); + } else if ((the_cmd>=DVI_RIGHT_1) && (the_cmd<=DVI_RIGHT_4)) { + (*cmd)=DVI_RIGHT_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_RIGHT_1 + 1, TRUE); + } else if ((the_cmd>=DVI_DOWN_1) && (the_cmd<=DVI_DOWN_4)) { + (*cmd)=DVI_DOWN_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_DOWN_1 + 1, TRUE); + } else if ((the_cmd>=DVI_W_1) && (the_cmd<=DVI_W_4)) { + (*cmd)=DVI_W_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_W_1 + 1, TRUE); + } else if ((the_cmd>=DVI_X_1) && (the_cmd<=DVI_X_4)) { + (*cmd)=DVI_X_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_X_1 + 1, TRUE); + } else if ((the_cmd>=DVI_Y_1) && (the_cmd<=DVI_Y_4)) { + (*cmd)=DVI_Y_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_Y_1 + 1, TRUE); + } else if ((the_cmd>=DVI_Z_1) && (the_cmd<=DVI_Z_4)) { + (*cmd)=DVI_Z_1; + (*actual) = ovf_get_arg(&ovf_ptr, the_cmd - DVI_Z_1 + 1, TRUE); + } +} + + +void +append_to_packet_fix(unsigned cmd, fix fval) +{ + unsigned k; + unsigned negative=FALSE; + int t; + + if (design_units != UNITY) + fval = zround(((double)fval) / ((double)design_units) * 1048576.0); + if (fval<0) { + negative = TRUE; + fval = -1 - fval; + } + if (cmd == 0) { + k = 4; t = 0x1000000; + } else { + t = 0x7f; k = 1; + while (fval>t) { + t = (t<<8) | 0xff; k++; + } + append_to_packet(cmd+k-1); t = t/0x80 + 1; + } + do { + if (negative == TRUE) { + append_to_packet(0xff - fval/t); + fval = (fval/t)*t + t-1-fval; + negative = FALSE; + } else { + append_to_packet((fval/t) & 0xff); + } + k--; t = t >> 8; + } while (k != 0); +} + +unsigned move_table_size = 0; +move *move_table = NULL; +move *cur_move = NULL; +unsigned move_ptr = 0; + +void +move_table_init(void) +{ + if (move_table == NULL) { + move_table_size = BLOCK; + move_table = (move *) xmalloc(move_table_size); + } + move_ptr = 0; + cur_move = move_table; + cur_move->h = 0; cur_move->v = 0; +} + +void +packet_table_end(void) +{ + cur_packet = NULL; + packet_ptr = 0; + packet_table_size = 0; +} + + +void +move_ptr_decr(void) +{ + if (move_ptr==0) + internal_error_0("move_ptr_incr"); + move_ptr--; + cur_move = &move_table[move_ptr]; +} + +void +move_ptr_incr(void) +{ + if (move_ptr == move_table_size) { + move_table_size += BLOCK; + move_table = (move *) xrealloc(move_table, move_table_size); + } + move_ptr++; + cur_move = &move_table[move_ptr]; +} + +unsigned +get_hex(unsigned char c) +{ + if ((c>='0') || (c<='9')) return(c-'0'); + if ((c>='A') || (c<='F')) return(c-'A'+10); + internal_error_1("get_hex (a=%c)", c); +} + +void +set_select_font(unsigned f) +{ + append_command_2(DVI_FNT_NUM_0, DVI_FNT_NUM_63, DVI_FNT_1, f); +} + +void +set_set_char(unsigned c) +{ + if (cur_font==NULL) { + warning_1("Character (H %X) cannot be typeset in undefined font", c); + } else { + append_command_2(DVI_SET_CHAR_0, DVI_SET_CHAR_127, DVI_SET_1, c); + } +} + +void +set_set_rule(fix height, fix width) +{ + append_to_packet(DVI_SET_RULE); + append_to_packet_fix(0, height); + append_to_packet_fix(0, width); +} + +void +set_move(unsigned direction, fix fval) +{ + if (cur_move == NULL) { + internal_error_0("set_move"); + } + if (direction == M_LEFT) { + fval = -fval; + direction = M_RIGHT; + } else if (direction == M_UP) { + fval = -fval; + direction = M_DOWN; + } + if (direction == M_RIGHT) { /* horizontal movement */ + if (cur_move->h == 0) { + cur_move->wfix = fval; cur_move->h++; + append_to_packet_fix(DVI_W_1, fval); + } else if (fval == cur_move->wfix) { + append_to_packet(DVI_W_0); + } else if (cur_move->h == 1) { + cur_move->xfix = fval; cur_move->h++; + append_to_packet_fix(DVI_X_1, fval); + } else if (fval == cur_move->xfix) { + append_to_packet(DVI_X_0); + } else { + append_to_packet_fix(DVI_RIGHT_1, fval); + } + } else { /* vertical movement */ + if (cur_move->v == 0) { + cur_move->yfix = fval; cur_move->v++; + append_to_packet_fix(DVI_Y_1, fval); + } else if (fval == cur_move->yfix) { + append_to_packet(DVI_Y_0); + } else if (cur_move->v == 1) { + cur_move->zfix = fval; cur_move->v++; + append_to_packet_fix(DVI_Z_1, fval); + } else if (fval == cur_move->zfix) { + append_to_packet(DVI_Z_0); + } else { + append_to_packet_fix(DVI_DOWN_1, fval); + } + } +} + +void +set_push(void) +{ + append_to_packet(DVI_PUSH); + move_ptr_incr(); + cur_move->h = 0; + cur_move->v = 0; +} + +void +set_pop(void) +{ + append_to_packet(DVI_POP); + move_ptr_decr(); +} + +void +set_special(string special_string) +{ + unsigned len = strlen(special_string); + unsigned i=0; + + append_command(DVI_XXX_1, len); + for (i=0; i<len; i++) { + append_to_packet(special_string[i]); + } +} + +void +set_special_hex(string special_hex_string) +{ + unsigned len = strlen(special_hex_string); + unsigned i=0; + + append_command(DVI_XXX_1, len/2); + for (i=0; i<len; i+=2) { + append_to_packet(get_hex(special_hex_string[i])*16+ + get_hex(special_hex_string[i+1])); + } +} + +unsigned file_ovf_count = 0; + +void +out_ovf(unsigned i) +{ + fputc(i,file_ovf); + file_ovf_count++; +} + +void +out_ovf_4(unsigned i) +{ + fputc(i>>24, file_ovf); + fputc((i>>16)&0xff, file_ovf); + fputc((i>>8)&0xff, file_ovf); + fputc(i&0xff, file_ovf); + file_ovf_count += 4; +} + +void +output_ovf_fonts(void) +{ + unsigned i, j, k1, k2; + + for (i=0; i<no_fonts; i++) { + cur_font = font_table+i; + for (j=0; j<cur_font->ovf_packet_length; j++) + out_ovf(cur_font->ovf_packet[j]); + out_ovf_4(cur_font->font_checksum); + out_ovf_4(cur_font->font_at); + out_ovf_4((unsigned int)cur_font->font_dsize); + if (cur_font->font_area != NULL) { + k2 = strlen(cur_font->font_area); + out_ovf(k2); + } else { + k2 = 0; out_ovf(0); + } + if (cur_font->font_name != NULL) { + k1 = strlen(cur_font->font_name); + out_ovf(k1); + } else { + k1 = 4; out_ovf(4); + } + if (cur_font->font_area != NULL) { + for (j=0; j<k2; j++) + out_ovf(cur_font->font_area[j]); + } + if (cur_font->font_name != NULL) { + for (j=0; j<k1; j++) + out_ovf(cur_font->font_name[j]); + } else { + out_ovf('N'); out_ovf('U'); out_ovf('L'); out_ovf('L'); + } + } +} + +void +output_ovf_file(void) +{ + unsigned i, k; + + out_ovf(DVI_PRE); out_ovf(VF_ID); + /* Check for vtitle==NULL by Joel Riou <joel.riou@normalesup.org> */ + k = vtitle ? strlen(vtitle) : 0; out_ovf(k); + for (i=0; i<k; i++) out_ovf(vtitle[i]); + out_ovf_4(check_sum); out_ovf_4(design_size); + output_ovf_fonts(); + output_ovf_chars(); + do { + out_ovf(DVI_POST); + } while ((file_ovf_count % 4) != 0); +} + +void +in_ovf_4(int *value) +{ + *value = (((*ovf_ptr) & 0xff) << 24) | + (((*(ovf_ptr+1)) & 0xff) << 16) | + (((*(ovf_ptr+2)) & 0xff) << 8) | + ((*(ovf_ptr+3)) & 0xff); + ovf_ptr += 4; +} + +void +in_ovf_unsigned_4(unsigned *value) +{ + *value = (((*ovf_ptr) & 0xff) << 24) | + (((*(ovf_ptr+1)) & 0xff) << 16) | + (((*(ovf_ptr+2)) & 0xff) << 8) | + ((*(ovf_ptr+3)) & 0xff); + ovf_ptr += 4; +} + +void +in_ovf_3(int *value) +{ + *value = (((*ovf_ptr) & 0xff) << 16) | + (((*(ovf_ptr+1)) & 0xff) << 8) | + ((*(ovf_ptr+2)) & 0xff); + ovf_ptr += 3; +} + +void +in_ovf(int *value) +{ + *value = (*ovf_ptr) & 0xff; + ovf_ptr ++; +} + +void +input_ovf_file(void) +{ + ovf_ptr = ovf; + if ((*ovf_ptr & 0xff) != DVI_PRE) + fatal_error_0("Not a VF or OVF file; first byte should be 247"); + ovf_ptr++; + if ((*ovf_ptr & 0xff) != VF_ID) + fatal_error_0("Not a VF or OVF file; second byte should be 202"); + ovf_ptr++; + vtitle_length = *ovf_ptr & 0xff; + ovf_ptr++; + vtitle = (char *) xmalloc(vtitle_length+1); + strncpy(vtitle, (const char *)ovf_ptr, vtitle_length); + vtitle[vtitle_length] = '\0'; + ovf_ptr += vtitle_length; + print_vtitle(vtitle); + in_ovf_unsigned_4(&vf_check_sum); + in_ovf_unsigned_4(&vf_design_size); +} + + +void +input_ovf_fonts(void) +{ + int cur_font_area_length; + int cur_font_name_length; + char *cur_font_name; + char *cur_font_area; + unsigned cur_font_check_sum; + int cur_font_at; + int cur_font_dsize; + unsigned cmd; + + font_table_init(); + while (((*ovf_ptr & 0xff) >= DVI_FNT_DEF_1) && + ((*ovf_ptr & 0xff) <= DVI_FNT_DEF_4)) { + cur_font_index = no_fonts; + cur_font = &(font_table[cur_font_index]); + font_no_incr(); + input_command(&cmd, &(cur_font->font_number)); + print_map_font(cur_font->font_number); + in_ovf_unsigned_4(&cur_font_check_sum); + cur_font_at = ovf_get_arg(&ovf_ptr, 4, FALSE); + cur_font_dsize = ovf_get_arg(&ovf_ptr, 4, FALSE); + in_ovf(&cur_font_area_length); + in_ovf(&cur_font_name_length); + cur_font_area = NULL; + if (cur_font_area_length != 0) { + cur_font_area = (char *)xmalloc(cur_font_area_length+1); + strncpy(cur_font_area, (const char *)ovf_ptr, cur_font_area_length); + cur_font_area[cur_font_area_length] = '\0'; + ovf_ptr += cur_font_area_length; + print_font_area(cur_font_area); + } + cur_font_name = NULL; + if (cur_font_name_length != 0) { + cur_font_name = (char *)xmalloc(cur_font_name_length+1); + strncpy(cur_font_name, (const char *)ovf_ptr, cur_font_name_length); + cur_font_name[cur_font_name_length] = '\0'; + ovf_ptr += cur_font_name_length; + print_font_name(cur_font_name); + } + print_font_check_sum(cur_font_check_sum); + print_font_at(cur_font_at); + print_font_design_size(cur_font_dsize); + right(); + } +} + +void +input_ovf_chars(void) +{ + int pl,cc,wd; + + while ((*ovf_ptr & 0xff) <= VF_LONG_CHAR) { + if ((*ovf_ptr & 0xff) == VF_LONG_CHAR) { + ovf_ptr++; + in_ovf_4(&pl); + in_ovf_4(&cc); + in_ovf_4(&wd); + } else { + in_ovf(&pl); + in_ovf(&cc); + in_ovf_3(&wd); + } + ensure_existence(cc); + current_secondary_character->ovf_packet_length = pl; + current_secondary_character->ovf_packet = ovf_ptr; + ovf_ptr += pl; + } + while (ovf_ptr < (ovf+length_ovf)) { + if ((*ovf_ptr & 0xff) != DVI_POST) + fatal_error_0("Not a VF or OVF file; final bytes should be 248"); + ovf_ptr++; + } +} diff --git a/Build/source/texk/web2c/omegafonts/font_routines.h b/Build/source/texk/web2c/omegafonts/font_routines.h new file mode 100644 index 00000000000..4aafa6647be --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/font_routines.h @@ -0,0 +1,98 @@ +/* font_routines.h: Data structures for virtual font support. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +typedef struct font_struct { + int font_number; + unsigned font_checksum; + double font_dsize; + string font_name; + string font_area; + fix font_at; + unsigned char *ovf_packet; + unsigned ovf_packet_length; + boolean font_at_defined; + boolean font_dsize_defined; + boolean font_checksum_defined; +} font; + +typedef struct move_struct { + fix wfix; + fix xfix; + fix yfix; + fix zfix; + unsigned h; + unsigned v; +} move; + +extern font *font_table; +extern unsigned no_fonts; +extern unsigned cur_font_index; +extern font *cur_font; +extern unsigned char *cur_packet; + +extern string vtitle; + +extern unsigned packet_table_size; +extern unsigned char *packet_table; +extern unsigned char *cur_packet; +extern unsigned packet_ptr; + +extern void clear_map_font(int); +extern void init_map_font(int); +extern void set_font_name(string); +extern void set_font_area(string); +extern void set_font_check_sum(unsigned); +extern void set_font_at(fix); +extern void set_font_design_size(fix); + +extern void set_vtitle(string ); +extern void init_map(void); +extern void end_map(void); +extern void set_select_font(unsigned); +extern void set_set_char(unsigned); +extern void set_set_rule(fix, fix); +extern void set_move(unsigned, fix); +extern void set_push(void); +extern void set_pop(void); +extern void set_special(string ); +extern void set_special_hex(string ); +extern unsigned get_hex(unsigned char); + +extern void append_command(unsigned, unsigned); +extern void append_command_2(unsigned, unsigned, unsigned, unsigned); +extern void append_to_packet_fix(unsigned, fix); +extern void move_table_init(void); +extern void font_table_init(void); + +extern void packet_table_init(void); +extern void packet_table_end(void); +extern void out_ovf(unsigned); +extern void out_ovf_4(unsigned); + +extern int ovf_get_arg(unsigned char **, unsigned,boolean); +extern void input_command(unsigned *, int *); +extern void input_ovf_fonts(void); +extern void input_ovf_chars(void); +extern void input_ovf_file(void); +extern void in_ovf_4(int *); +extern void in_ovf_unsigned_4(unsigned *); diff --git a/Build/source/texk/web2c/omegafonts/header_routines.c b/Build/source/texk/web2c/omegafonts/header_routines.c new file mode 100644 index 00000000000..48e3ef00ec6 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/header_routines.c @@ -0,0 +1,651 @@ +/* header_routines.c: Headers of font metric files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "manifests.h" +#include "header_routines.h" +#include "print_routines.h" +#include "error_routines.h" +#include "out_ofm.h" +#include "omfonts.h" + +#define LOC_CHECK_SUM 0 +#define LOC_DESIGN_SIZE 4 +#define LOC_CODING_SCHEME 8 +#define LOC_FAMILY (LOC_CODING_SCHEME+LEN_CODING_SCHEME+1) +#define LOC_SEVEN_FLAG (LOC_FAMILY+LEN_FAMILY+1) +#define LOC_FACE (LOC_SEVEN_FLAG+3) + +#define HEADER_MIN 18 +#define HEADER_MAX 255 + + +string header; +av_list header_list = NULL; +unsigned header_max = HEADER_MIN-1; + +unsigned check_sum; +boolean check_sum_specified; + +fix design_size; +boolean design_size_specified; + +fix design_units; +boolean design_units_specified; + +string coding_scheme; +boolean coding_scheme_specified; + +string family; +boolean family_specified; + +unsigned face; +boolean face_specified; + +unsigned ofm_level; +boolean ofm_level_specified; + +unsigned font_dir; +boolean font_dir_specified; + +boolean seven_bit; +boolean seven_bit_specified; +boolean seven_bit_calculated; + +unsigned font_type = FT_VANILLA; + +unsigned lh; + +void +store_header_int(unsigned loc, unsigned val) +{ + header[loc] = 0xff & (val >> 24) ; + header[loc+1] = 0xff & (val >> 16) ; + header[loc+2] = 0xff & (val >> 8) ; + header[loc+3] = 0xff & val ; +} + +void +store_header_byte(unsigned loc, unsigned val) +{ + header[loc] = 0xff & val ; +} + +void +retrieve_header_int(unsigned loc, unsigned *where) +{ + string ptr = header+loc; + + *where = ((* ptr & 0xff) << 24) | + ((*(ptr+1) & 0xff) << 16) | + ((*(ptr+2) & 0xff) << 8) | + (*(ptr+3) & 0xff) ; + +} + +void +retrieve_header_byte(unsigned loc, unsigned char *where) +{ + *where = header[loc]; +} + +/* HEADER */ + +void +init_header_word() +{ +header_list = NULL; +header_max = HEADER_MIN-1; +font_type = FT_VANILLA; +} + +void +set_header_word(unsigned index, unsigned val) +{ + av_list L1, L2; + + if (index > HEADER_MAX) { + warning_0("HEADER index must be at most 255; ignored"); + return; + } + if (index < HEADER_MIN) { + warning_0("HEADER index must be at least 18; ignored"); + return; + } + L1 = header_list; + if (L1 == NULL) { + header_list = av_list1(index, val); + header_max = index; + } else { + L2 = L1->ptr; + while ((L2 != NULL) && (lattr(L2) <= index)) { + L1 = L2; + L2 = L2->ptr; + } + if (index < lattr(L1)) { + header_list = av_list1(index, val); + header_list->ptr = L1; + } else if (index == lattr(L1)) { + warning_1("HEADER index (%d) previously defined; " + "old value ignored", index); + lval(L1) = val; + } else { + L2 = av_list1(index, val); + L2->ptr = L1->ptr; + if (L1->ptr==NULL) header_max = index; + L1->ptr = L2; + } + } +} + +void +store_header_word() +{ + av_list L = header_list; + unsigned ctr = HEADER_MIN; + + header = (string) xmalloc(4*(header_max+1)); + while (L != NULL) { + while (ctr<lattr(L)) { + store_header_int(ctr*4,0); + ctr++; + } + store_header_int(ctr*4,lval(L)); + ctr++; L = L->ptr; + } +} + +void +retrieve_header_word() +{ + unsigned j = HEADER_MIN, value, header_no=lh; + + header_list = NULL; + while (j <= header_no) { + retrieve_header_int(j*4, &value); + if (value != 0) { + set_header_word(j, value); + } + j++; + } +} + +void +print_header(void) +{ + av_list L = header_list; + + print_check_sum(); + print_design_size(); + print_coding_scheme(); + print_family(); + print_face(); + print_seven_bit_safe_flag(); + while (L!=NULL) { + print_header_word(lattr(L),lval(L)); + L = L->ptr; + } +} + +/* CHECKSUM */ + +void +init_check_sum(void) +{ + check_sum = 0; + check_sum_specified = FALSE; +} + +void +set_check_sum(unsigned cs) +{ + check_sum = cs; + check_sum_specified = TRUE; +} + +void +store_check_sum(void) +{ + + calculate_check_sum(); + store_header_int(LOC_CHECK_SUM, check_sum); +} + +void +retrieve_check_sum(void) +{ + retrieve_header_int(LOC_CHECK_SUM, &check_sum); +} + +void +calculate_check_sum(void) +{ +/* + if (check_sum_specified == FALSE) { + not_yet_done("checksum calculation"); + } +*/ +} + + +/* DESIGNSIZE */ + +void +init_design_size() +{ + design_size = 10*UNITY; + design_size_specified = FALSE; +} + +void +set_design_size(fix ds) +{ + if (design_size_specified==TRUE) + warning_0("DESIGNSIZE previously defined; old value ignored"); + if (ds<1) { + warning_0("DESIGNSIZE value must be at least 1; set to 10"); + design_size = 10*UNITY; + } else { + design_size = ds; + } + design_size_specified = TRUE; +} + +void +store_design_size(void) +{ + store_header_int(LOC_DESIGN_SIZE, design_size); +} + +void +retrieve_design_size(void) +{ + retrieve_header_int(LOC_DESIGN_SIZE, (unsigned *) &design_size); +} + + +/* DESIGNUNITS */ + +void +init_design_units(void) +{ + design_units = UNITY; + design_units_specified = FALSE; +} + +void +set_design_units(fix du) +{ + if (design_units_specified==TRUE) + warning_0("DESIGNUNITS previously defined; old value ignored"); + if (du<=0) { + warning_0("DESIGNUNITS value must be positive; set to 1"); + design_units = UNITY; + } else { + design_units = du; + } + design_units_specified = TRUE; +} + + +/* CODINGSCHEME */ + +void +init_coding_scheme(void) +{ + coding_scheme = "UNSPECIFIED"; + coding_scheme_specified = FALSE; +} + +void +set_coding_scheme(string sval) +{ + if (coding_scheme_specified==TRUE) { + warning_0("CODINGSCHEME previously defined; old value ignored"); + free(coding_scheme); coding_scheme=NULL; + } + coding_scheme = sval; + + if (!strncmp(coding_scheme, "TEX MATH SY", 11) || + !strncmp(coding_scheme, "TeX math sy", 11)) + font_type = FT_MATHSY; + else if (!strncmp(coding_scheme, "TEX MATH EX", 11) || + !strncmp(coding_scheme, "TeX math ex", 11)) + font_type = FT_MATHEX; + else font_type = FT_VANILLA; + + coding_scheme_specified = TRUE; +} + +void +store_coding_scheme(void) +{ + register unsigned i=0, j=LOC_CODING_SCHEME, len=strlen(coding_scheme); + + header[j] = len; + for (j++; i<len; i++,j++) header[j] = coding_scheme[i]; + for (; j<(LOC_CODING_SCHEME+LEN_CODING_SCHEME); j++) + header[j] = '\0';; +} + + +void +retrieve_coding_scheme(void) +{ + register unsigned i=0, j=LOC_CODING_SCHEME, len=header[LOC_CODING_SCHEME]; + + coding_scheme = (string) xmalloc(len+1); + for (j++; i<len; i++,j++) { + coding_scheme[i] = header[j]; + if ((text_format == TEXT_CODE_UPPER) && + (coding_scheme[i] >= 'a') && + (coding_scheme[i] <= 'z')) { + coding_scheme[i] += 'A' - 'a'; + } + } + coding_scheme[i] = '\0'; + if (!strncmp(coding_scheme, "TEX MATH SY", 11) || + !strncmp(coding_scheme, "TeX math sy", 11)) + font_type = FT_MATHSY; + else if (!strncmp(coding_scheme, "TEX MATH EX", 11) || + !strncmp(coding_scheme, "TeX math ex", 11)) + font_type = FT_MATHEX; + else font_type = FT_VANILLA; +} + +/* FAMILY */ + +void +init_family(void) +{ + family = "UNSPECIFIED"; + family_specified = FALSE; +} + +void +set_family(string sval) +{ + if (family_specified==TRUE) { + warning_0("FAMILY previously defined; old value ignored"); + free(family); family=NULL; + } + family = sval; + family_specified = TRUE; +} + +void +store_family(void) +{ + register unsigned i=0, j=LOC_FAMILY, len=strlen(family); + + if (len>LEN_FAMILY) internal_error_1("store_family (len=%d)", len); + header[j] = len; + for (j++; i<len; i++,j++) header[j] = family[i]; + for (; j<=(LOC_FAMILY+LEN_FAMILY); j++) + header[j] = '\0';; +} + + +void +retrieve_family(void) +{ + register unsigned i=0, j=LOC_FAMILY, len=header[LOC_FAMILY]; + + family = (string) xmalloc(len+1); + for (j++; i<len; i++,j++) { + family[i] = header[j]; + if ((text_format == TEXT_CODE_UPPER) && + (family[i] >= 'a') && + (family[i] <= 'z')) { + family[i] += 'A' - 'a'; + } + } + family[i] = '\0'; +} + +/* FACE */ + +void +init_face() +{ + face = 0; + face_specified = FALSE; +} + +void +set_face(unsigned f) +{ + if (face_specified==TRUE) + warning_0("FACE previously defined; old value ignored"); + if (face>255) { + warning_0("FACE value must be less than 256"); + } else { + face = f; + } + face_specified = TRUE; +} + +void +store_face(void) +{ + store_header_byte(LOC_FACE, face); +} + +void +retrieve_face(void) +{ + unsigned char face_byte; + retrieve_header_byte(LOC_FACE, &face_byte); + face = face_byte; +} + +/* OFMLEVEL */ + +void +init_ofm_level() +{ + ofm_level = OFM_TFM; + ofm_level_specified = FALSE; +} + +void +set_ofm_level(unsigned level) +{ + if (ofm_level_specified==TRUE) + warning_0("OFMLEVEL previously defined; old value ignored"); + /* Fix from Joel Riou <joel.riou@normalesup.org> */ + if ((level != 0) && (level != 1)) { + warning_0("OFMLEVEL value must be D 0 or D 1"); + } else { + ofm_level = level ? OFM_LEVEL1 : OFM_LEVEL0; + } + ofm_level_specified = TRUE; +} + +/* FONTDIR */ + +void +init_font_dir() +{ + font_dir = DIR_ORD+DIR_TL; + font_dir_specified = FALSE; +} + +void +set_font_dir(unsigned direction) +{ + if (font_dir_specified==TRUE) + warning_0("FONTDIR previously defined; old value ignored"); + if ((direction < DIR_MIN) || (direction > DIR_MAX)) { + warning_0("bad FONTDIR value; ignored"); + } else { + font_dir = direction; + } + font_dir_specified = TRUE; +} + +/* SEVENBITSAFEFLAG */ + +void +init_seven_bit_safe_flag() +{ + seven_bit = 0; + seven_bit_calculated = 1; + seven_bit_specified = FALSE; +} + +void +set_seven_bit_safe_flag(unsigned f) +{ + if (seven_bit_specified==TRUE) + warning_0("SEVENBITSAFEFLAG previously defined; " + "old value ignored"); + if ((f!=FALSE) && (f!=TRUE)) { + internal_error_1("set_seven_bit_safe_flag (f=%d)", f); + } + seven_bit = f; + seven_bit_specified = TRUE; +} + +void +store_seven_bit_safe_flag(void) +{ + store_header_byte(LOC_SEVEN_FLAG, seven_bit); +} + +void +retrieve_seven_bit_safe_flag(void) +{ + unsigned char seven_bit_byte; + retrieve_header_byte(LOC_SEVEN_FLAG, &seven_bit_byte); + seven_bit = (seven_bit_byte != 0); +} + +void +calculate_seven_bit_safe_flag(void) +{ + if ((seven_bit_specified == TRUE) && (seven_bit == 1) && + (seven_bit_calculated == 0)) { + warning_0("SEVENBITSAFEFLAG value specified TRUE; " + "really FALSE"); + } + seven_bit = seven_bit_calculated; +} + +void +init_header(void) +{ + init_header_word(); + init_check_sum(); + init_design_size(); + init_design_units(); + init_coding_scheme(); + init_family(); + init_face(); + init_seven_bit_safe_flag(); +} + +void +store_header(void) +{ + + store_header_word(); + store_check_sum(); + store_design_size(); + store_coding_scheme(); + store_family(); + store_face(); + store_seven_bit_safe_flag(); + +/* + { int i; + for (i=0; i<(4*(header_max+1)); i++) { + if (!(i%4)) fprintf(stdout, "\n"); + fprintf(stdout, "%d: %c (%d, %2x) ", + i, header[i], header[i], header[i]); + } + fprintf(stdout, "\n"); +*/ + if (header_list!=NULL) { + av_list L1 = header_list, L2; + while (L1 != NULL) { + L2 = L1->ptr; + free(L1); + L1 = L2; + } + } + lh = header_max; + header_list = NULL; + header_max = HEADER_MIN-1; + + retrieve_header(); +} + +void +retrieve_header(void) +{ + retrieve_header_word(); + retrieve_check_sum(); + retrieve_design_size(); + retrieve_coding_scheme(); + retrieve_family(); + retrieve_face(); + retrieve_seven_bit_safe_flag(); +} + +void +output_ofm_header(void) +{ + unsigned i=0, j, k1, k2; + + av_list L = header_list; + + out_ofm_4(check_sum); i++; + out_ofm_4(design_size); i++; + k1 = strlen(coding_scheme); + out_ofm(k1); + for (j=0; j<k1; j++) out_ofm(coding_scheme[j]); + for (j=k1; j<LEN_CODING_SCHEME; j++) out_ofm(0); + k2 = strlen(family); + out_ofm(k2); + for (j=0; j<k2; j++) out_ofm(family[j]); + for (j=k2; j<LEN_FAMILY; j++) out_ofm(0); + if ((ofm_level==OFM_TFM) && (seven_bit_specified==TRUE)) + out_ofm(seven_bit); + else + out_ofm(0); + out_ofm(0); out_ofm(0); out_ofm(face); + i = 1 + LOC_SEVEN_FLAG / 4; + lh = header_max + 1; + while(L != NULL) { + j=lattr(L); + while (i<j) { + out_ofm_4(0); + i++; + } + out_ofm_4(lval(L)); + L = L->ptr; i++; + } + while (i<lh) {out_ofm_4(0); i++;} +} diff --git a/Build/source/texk/web2c/omegafonts/header_routines.h b/Build/source/texk/web2c/omegafonts/header_routines.h new file mode 100644 index 00000000000..44b2483e03a --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/header_routines.h @@ -0,0 +1,109 @@ +/* header_routines.h: Headers of font metric files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern string header; + +extern unsigned check_sum; +extern boolean check_sum_specified; + +extern fix design_size; +extern boolean design_size_specified; + +extern fix design_units; +extern boolean design_units_specified; + +extern string coding_scheme; +extern boolean coding_scheme_specified; + +extern string family; +extern boolean family_specified; + +extern unsigned face; +extern boolean face_specified; + +extern unsigned ofm_level; +extern boolean ofm_level_specified; + +extern unsigned font_dir; +extern boolean font_dir_specified; + +extern boolean seven_bit; +extern boolean seven_bit_specified; +extern boolean seven_bit_calculated; + +extern unsigned font_type; + +extern unsigned header_max; +extern unsigned lh; + +extern void store_header_int(unsigned, unsigned); +extern void store_header_byte(unsigned, unsigned); +extern void retrieve_header_int(unsigned, unsigned *); +extern void retrieve_header_byte(unsigned, unsigned char *); +extern void set_header_word(unsigned, unsigned); + +extern void init_check_sum(void); +extern void set_check_sum(unsigned); +extern void store_check_sum(void); +extern void retrieve_check_sum(void); +extern void calculate_check_sum(void); + +extern void init_design_size(void); +extern void set_design_size(fix); +extern void store_design_size(void); +extern void retrieve_design_size(void); + +extern void init_design_units(void); +extern void set_design_units(fix); + +extern void init_coding_scheme(void); +extern void set_coding_scheme(string ); +extern void store_coding_scheme(void); +extern void retrieve_coding_scheme(void); + +extern void init_family(void); +extern void set_family(string ); +extern void store_family(void); +extern void retrieve_family(void); + +extern void init_face(); +extern void set_face(unsigned); +extern void store_face(void); +extern void retrieve_face(void); + +extern void init_seven_bit_safe_flag(); +extern void set_seven_bit_safe_flag(unsigned); +extern void store_seven_bit_safe_flag(void); +extern void retrieve_seven_bit_safe_flag(void); +extern void calculate_seven_bit_safe_flag(void); + +extern void init_header(void); +extern void store_header(void); +extern void retrieve_header(void); +extern void print_header(void); + +extern void output_ofm_header(void); + +extern void set_ofm_level(unsigned); +extern void set_font_dir(unsigned); +extern void output_ofm_header(void); diff --git a/Build/source/texk/web2c/omegafonts/lex.yy.c-dist b/Build/source/texk/web2c/omegafonts/lex.yy.c-dist new file mode 100644 index 00000000000..8e546c1e762 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/lex.yy.c-dist @@ -0,0 +1,3390 @@ + +#line 3 "lex.yy.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 31 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart(yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE yylex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-yylineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + int yyl;\ + for ( yyl = n; yyl < yyleng; ++yyl )\ + if ( yytext[yyl] == '\n' )\ + --yylineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef unsigned int yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); + +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + +typedef int yy_state_type; + +#define YY_FLEX_LEX_COMPAT +extern int yylineno; + +int yylineno = 1; + +extern char yytext[]; + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + if ( yyleng + (yy_more_offset) >= YYLMAX ) \ + YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ + yy_flex_strncpy( &yytext[(yy_more_offset)], (yytext_ptr), yyleng + 1 ); \ + yyleng += (yy_more_offset); \ + (yy_prev_more_offset) = (yy_more_offset); \ + (yy_more_offset) = 0; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 197 +#define YY_END_OF_BUFFER 198 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_acclist[258] = + { 0, + 9, 9, 198, 196, 197, 1, 196, 197, 2, 197, + 3, 196, 197, 4, 196, 197, 196, 197, 196, 197, + 196, 197, 196, 197, 196, 197, 196, 197, 196, 197, + 196, 197, 196, 197, 196, 197, 196, 197, 196, 197, + 196, 197, 196, 197, 196, 197, 196, 197, 196, 197, + 196, 197, 196, 197, 196, 197, 196, 197, 196, 197, + 196, 197, 1, 172, 42, 8, 8, 6, 171, 7, + 31, 44, 102, 41, 5, 107, 9, 43, 40, 46, + 163, 23, 170, 143, 45, 77, 78, 79, 106, 75, + 9, 142, 33, 32, 85, 86, 82, 83, 84, 173, + + 47, 49, 164, 61, 67, 55, 60, 66, 54, 63, + 69, 57, 62, 68, 56, 59, 65, 53, 58, 64, + 52, 169, 30, 48, 180, 179, 181, 178, 70, 71, + 50, 38, 37, 39, 36, 167, 89, 90, 80, 81, + 11, 100, 139, 151, 24, 138, 110, 140, 174, 150, + 149, 148, 73, 12, 51, 16, 98, 141, 104, 105, + 15, 72, 88, 87, 35, 74, 175, 162, 161, 20, + 176, 165, 166, 14, 137, 13, 136, 156, 155, 154, + 27, 111, 109, 112, 177, 115, 28, 26, 101, 145, + 144, 114, 108, 146, 29, 193, 113, 91, 158, 157, + + 159, 168, 21, 76, 120, 122, 119, 117, 123, 121, + 116, 118, 133, 132, 134, 153, 34, 147, 186, 191, + 194, 189, 103, 160, 22, 135, 152, 184, 187, 182, + 17, 25, 10, 99, 195, 93, 94, 95, 96, 97, + 188, 192, 190, 17, 185, 183, 128, 130, 127, 125, + 131, 129, 124, 126, 92, 18, 19 + } ; + +static yyconst flex_int16_t yy_accept[784] = + { 0, + 1, 2, 3, 4, 6, 9, 11, 14, 17, 19, + 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, + 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, + 61, 63, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 66, 66, 67, 68, + + 68, 68, 68, 68, 68, 68, 68, 68, 68, 69, + 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, + 70, 70, 70, 70, 71, 71, 71, 72, 72, 73, + 74, 75, 75, 75, 75, 75, 75, 75, 76, 76, + 76, 76, 77, 77, 77, 77, 78, 78, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 80, 80, 80, 80, 80, 80, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 82, 82, 82, 82, 83, 83, 84, 84, 84, + + 85, 85, 85, 85, 86, 86, 86, 86, 86, 86, + 86, 86, 86, 87, 88, 89, 89, 89, 89, 89, + 90, 91, 92, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, + 95, 95, 96, 97, 97, 98, 99, 100, 100, 100, + 101, 101, 101, 101, 101, 102, 103, 103, 103, 103, + 103, 103, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + + 120, 121, 122, 122, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 124, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, + 125, 125, 125, 125, 125, 125, 125, 126, 127, 128, + 128, 128, 129, 129, 129, 129, 129, 129, 130, 131, + 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, + 132, 132, 132, 132, 132, 132, 133, 133, 133, 134, + 135, 135, 135, 135, 135, 135, 136, 136, 137, 137, + 137, 137, 137, 137, 137, 138, 139, 140, 141, 141, + + 141, 142, 142, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 144, 144, 144, 144, 144, 144, + 145, 146, 147, 147, 147, 147, 147, 147, 147, 148, + 149, 149, 149, 150, 150, 150, 150, 150, 150, 150, + 150, 151, 152, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 154, 154, 154, 154, 154, 154, 154, 155, + 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + + 157, 157, 157, 157, 157, 157, 158, 158, 158, 158, + 158, 158, 158, 158, 158, 158, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 160, 161, 161, + 162, 163, 164, 165, 165, 166, 167, 167, 168, 168, + 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, + 170, 171, 172, 172, 173, 174, 174, 174, 174, 174, + 175, 175, 175, 175, 175, 175, 176, 176, 176, 177, + 177, 178, 178, 179, 180, 180, 180, 181, 181, 182, + 182, 183, 184, 184, 184, 184, 184, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + + 185, 185, 185, 185, 186, 186, 186, 187, 187, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, + 188, 189, 189, 189, 189, 189, 190, 190, 190, 190, + 190, 191, 191, 191, 192, 193, 194, 195, 195, 195, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, + 197, 197, 197, 197, 197, 198, 199, 199, 199, 200, + 201, 202, 202, 203, 203, 203, 204, 204, 205, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 216, 217, 217, 217, 218, 219, 219, 219, 220, + 220, 220, 220, 221, 222, 223, 224, 224, 224, 224, + + 224, 225, 225, 225, 226, 226, 227, 228, 228, 228, + 229, 230, 231, 231, 231, 231, 231, 232, 232, 233, + 234, 234, 235, 235, 235, 235, 235, 236, 236, 236, + 236, 236, 237, 238, 239, 240, 241, 241, 241, 242, + 242, 242, 243, 244, 244, 245, 245, 245, 246, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 255, + 255, 255, 255, 255, 255, 255, 256, 256, 256, 256, + 257, 258, 258 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 4, + 5, 1, 6, 1, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 9, 9, 15, 15, 1, 1, 1, + 1, 16, 1, 1, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 1, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[42] = + { 0, + 1, 2, 3, 1, 1, 4, 4, 1, 5, 5, + 5, 5, 5, 5, 6, 1, 7, 7, 7, 7, + 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 + } ; + +static yyconst flex_int16_t yy_base[791] = + { 0, + 0, 0, 837, 838, 834, 838, 838, 838, 808, 15, + 18, 53, 42, 795, 44, 806, 43, 795, 798, 32, + 35, 61, 45, 68, 794, 69, 85, 799, 799, 33, + 29, 825, 801, 804, 799, 800, 23, 820, 794, 45, + 787, 71, 66, 798, 816, 73, 782, 97, 68, 789, + 786, 797, 777, 810, 794, 793, 780, 790, 784, 775, + 785, 767, 786, 767, 762, 767, 771, 796, 769, 763, + 766, 763, 768, 758, 774, 111, 759, 762, 95, 755, + 762, 769, 102, 40, 108, 754, 759, 750, 757, 760, + 759, 756, 761, 743, 746, 758, 745, 838, 771, 736, + + 738, 751, 740, 750, 750, 741, 737, 735, 761, 745, + 736, 730, 734, 725, 102, 103, 104, 736, 731, 728, + 719, 726, 731, 749, 730, 722, 838, 727, 123, 725, + 729, 724, 717, 707, 707, 713, 130, 134, 713, 722, + 721, 838, 709, 712, 715, 0, 147, 838, 713, 141, + 712, 119, 711, 706, 699, 700, 709, 708, 695, 704, + 140, 152, 707, 688, 703, 686, 695, 702, 159, 698, + 693, 685, 696, 694, 692, 163, 686, 838, 690, 690, + 680, 687, 151, 671, 678, 677, 681, 686, 171, 174, + 178, 179, 184, 187, 838, 675, 674, 204, 664, 206, + + 678, 662, 670, 680, 678, 664, 674, 182, 656, 658, + 663, 672, 838, 838, 838, 667, 659, 659, 75, 838, + 838, 0, 190, 140, 654, 649, 664, 657, 651, 660, + 660, 654, 641, 647, 646, 838, 639, 652, 647, 838, + 636, 838, 838, 637, 838, 838, 838, 636, 649, 838, + 643, 639, 642, 644, 647, 838, 641, 640, 626, 640, + 641, 838, 638, 625, 618, 627, 618, 136, 615, 630, + 135, 630, 615, 621, 626, 623, 616, 617, 616, 615, + 123, 167, 612, 606, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, + + 838, 838, 599, 838, 149, 614, 188, 600, 609, 598, + 597, 616, 611, 595, 609, 605, 592, 195, 587, 606, + 592, 603, 838, 838, 605, 593, 602, 590, 598, 593, + 586, 595, 598, 597, 586, 575, 590, 575, 217, 584, + 578, 576, 571, 585, 570, 568, 838, 838, 838, 582, + 570, 838, 565, 582, 571, 579, 570, 838, 838, 578, + 575, 563, 562, 572, 573, 568, 564, 566, 570, 552, + 559, 552, 561, 548, 545, 838, 562, 542, 838, 838, + 560, 559, 546, 543, 546, 838, 536, 838, 538, 536, + 534, 533, 531, 531, 838, 838, 838, 838, 202, 534, + + 838, 543, 838, 542, 215, 537, 544, 524, 542, 541, + 529, 527, 528, 517, 536, 525, 518, 517, 518, 838, + 838, 511, 520, 511, 524, 506, 521, 519, 838, 504, + 513, 506, 838, 517, 502, 496, 501, 499, 513, 501, + 838, 838, 838, 510, 513, 218, 512, 506, 494, 505, + 500, 838, 497, 499, 491, 490, 499, 486, 838, 483, + 484, 838, 482, 492, 497, 484, 472, 490, 483, 488, + 481, 480, 489, 484, 483, 475, 468, 482, 838, 460, + 478, 465, 472, 467, 478, 477, 474, 471, 489, 449, + 462, 467, 460, 459, 464, 467, 462, 465, 448, 459, + + 454, 457, 456, 459, 454, 838, 445, 444, 437, 447, + 453, 447, 445, 440, 445, 428, 443, 446, 221, 445, + 427, 421, 429, 437, 418, 426, 838, 838, 420, 430, + 838, 838, 838, 424, 838, 838, 418, 838, 427, 431, + 414, 429, 414, 410, 838, 409, 408, 416, 425, 838, + 838, 838, 417, 838, 838, 404, 398, 413, 418, 838, + 410, 406, 244, 413, 397, 838, 396, 395, 838, 403, + 838, 402, 838, 838, 399, 392, 838, 399, 838, 390, + 838, 838, 389, 396, 392, 400, 838, 387, 402, 384, + 378, 386, 394, 375, 386, 387, 378, 377, 384, 379, + + 373, 385, 370, 838, 369, 378, 838, 378, 838, 380, + 379, 378, 363, 362, 375, 368, 373, 358, 371, 357, + 838, 223, 231, 233, 226, 838, 369, 368, 367, 352, + 838, 360, 366, 838, 838, 838, 838, 355, 350, 838, + 355, 354, 355, 346, 345, 352, 359, 341, 838, 339, + 339, 337, 354, 331, 838, 838, 340, 351, 838, 838, + 838, 327, 838, 338, 344, 838, 330, 838, 321, 838, + 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, + 316, 838, 325, 311, 838, 838, 328, 306, 838, 304, + 301, 305, 310, 838, 306, 838, 301, 320, 298, 287, + + 838, 298, 283, 838, 289, 838, 838, 296, 285, 293, + 838, 292, 274, 283, 281, 30, 106, 262, 838, 838, + 157, 838, 164, 181, 206, 227, 838, 220, 223, 238, + 0, 838, 838, 838, 838, 838, 236, 230, 838, 230, + 231, 838, 838, 240, 267, 251, 276, 838, 838, 263, + 255, 280, 260, 255, 258, 268, 269, 261, 287, 269, + 838, 838, 838, 838, 838, 838, 838, 838, 290, 259, + 278, 263, 263, 272, 264, 838, 267, 281, 284, 838, + 838, 838, 325, 331, 336, 342, 346, 348, 353, 356 + } ; + +static yyconst flex_int16_t yy_def[791] = + { 0, + 782, 1, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 783, 782, 782, + 782, 782, 782, 782, 784, 782, 782, 782, 782, 782, + 782, 782, 782, 785, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 786, 782, 782, + 782, 782, 782, 782, 782, 787, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 783, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 784, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 785, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 788, 787, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 788, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 789, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 790, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 789, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 0, 782, 782, 782, 782, 782, 782, 782, 782 + } ; + +static yyconst flex_int16_t yy_nxt[880] = + { 0, + 4, 5, 6, 7, 8, 4, 4, 9, 4, 4, + 4, 4, 4, 4, 4, 4, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 4, 31, 4, + 4, 34, 36, 45, 54, 48, 68, 37, 58, 88, + 730, 60, 90, 35, 38, 91, 59, 96, 97, 61, + 49, 101, 46, 55, 62, 102, 69, 89, 50, 159, + 76, 63, 160, 51, 76, 39, 40, 64, 41, 42, + 52, 65, 43, 44, 70, 106, 118, 104, 71, 77, + 66, 105, 339, 107, 110, 119, 67, 72, 48, 111, + + 73, 112, 340, 74, 78, 79, 113, 717, 80, 341, + 81, 82, 76, 150, 115, 83, 76, 146, 157, 84, + 85, 151, 158, 116, 117, 161, 189, 191, 193, 152, + 204, 153, 395, 396, 190, 192, 194, 232, 162, 213, + 214, 215, 138, 138, 138, 138, 138, 138, 782, 242, + 243, 233, 782, 146, 380, 384, 345, 205, 224, 244, + 225, 245, 246, 247, 226, 227, 255, 278, 228, 346, + 385, 248, 381, 279, 256, 229, 397, 398, 230, 263, + 737, 402, 264, 403, 265, 266, 267, 268, 738, 285, + 269, 286, 288, 270, 289, 271, 291, 294, 292, 295, + + 272, 328, 297, 287, 298, 300, 290, 301, 329, 342, + 293, 296, 405, 343, 330, 739, 299, 331, 417, 302, + 305, 406, 306, 307, 316, 308, 309, 344, 310, 418, + 740, 311, 312, 437, 313, 483, 314, 484, 317, 318, + 319, 523, 488, 320, 592, 563, 438, 489, 672, 670, + 674, 741, 676, 742, 524, 671, 743, 593, 677, 744, + 746, 622, 747, 748, 749, 673, 750, 675, 782, 751, + 623, 732, 733, 734, 735, 736, 624, 752, 625, 753, + 754, 752, 759, 760, 761, 763, 765, 767, 769, 770, + 762, 769, 773, 768, 774, 775, 776, 755, 777, 778, + + 779, 780, 764, 766, 781, 729, 756, 728, 727, 726, + 725, 771, 757, 724, 758, 723, 722, 721, 720, 719, + 718, 717, 716, 715, 772, 98, 98, 714, 98, 98, + 98, 98, 109, 713, 712, 109, 109, 124, 711, 710, + 124, 124, 124, 138, 709, 708, 138, 147, 707, 147, + 147, 147, 222, 222, 731, 706, 705, 731, 731, 731, + 745, 745, 745, 704, 703, 702, 701, 700, 699, 698, + 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, + 687, 686, 685, 684, 683, 682, 681, 680, 679, 678, + 669, 668, 667, 666, 665, 664, 663, 662, 661, 660, + + 659, 658, 657, 656, 655, 654, 653, 652, 651, 650, + 649, 648, 647, 646, 645, 644, 643, 642, 641, 640, + 639, 638, 637, 636, 635, 634, 633, 632, 631, 630, + 629, 628, 627, 626, 621, 620, 619, 618, 617, 616, + 615, 614, 613, 612, 611, 610, 609, 608, 607, 606, + 605, 604, 603, 602, 601, 600, 599, 598, 597, 596, + 595, 594, 591, 590, 589, 588, 587, 586, 585, 584, + 583, 582, 581, 580, 579, 578, 577, 576, 575, 574, + 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, + 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, + + 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, + 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, + 533, 532, 531, 530, 529, 528, 527, 526, 525, 522, + 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, + 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, + 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, + 491, 490, 487, 486, 485, 482, 481, 480, 479, 478, + 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, + 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, + 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, + + 447, 446, 445, 444, 443, 442, 441, 440, 439, 436, + 435, 434, 433, 432, 431, 430, 429, 428, 427, 426, + 425, 424, 423, 422, 421, 420, 419, 416, 415, 414, + 413, 412, 411, 410, 409, 408, 407, 404, 401, 400, + 399, 394, 393, 392, 391, 390, 389, 388, 387, 386, + 383, 382, 379, 378, 377, 376, 375, 374, 373, 372, + 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, + 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, + 351, 350, 349, 348, 347, 338, 337, 336, 335, 334, + 333, 332, 327, 326, 325, 324, 323, 322, 321, 315, + + 304, 303, 284, 283, 282, 281, 280, 277, 276, 275, + 274, 273, 262, 261, 260, 259, 258, 257, 254, 253, + 252, 251, 250, 249, 241, 240, 239, 238, 237, 236, + 235, 234, 231, 223, 221, 220, 219, 218, 217, 216, + 212, 211, 210, 209, 208, 207, 206, 203, 202, 201, + 782, 200, 199, 198, 197, 196, 195, 188, 187, 186, + 185, 184, 782, 183, 182, 181, 180, 179, 178, 177, + 176, 175, 99, 174, 173, 172, 171, 170, 169, 168, + 167, 166, 165, 164, 163, 156, 155, 154, 149, 148, + 145, 144, 143, 142, 141, 140, 139, 68, 137, 136, + + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, + 125, 54, 123, 122, 121, 120, 114, 45, 108, 103, + 100, 99, 95, 94, 93, 92, 32, 87, 86, 75, + 57, 56, 53, 47, 33, 32, 782, 3, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782 + } ; + +static yyconst flex_int16_t yy_chk[880] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 10, 11, 13, 17, 15, 23, 11, 20, 30, + 716, 21, 31, 10, 12, 31, 20, 37, 37, 21, + 15, 40, 13, 17, 21, 40, 23, 30, 15, 84, + 26, 21, 84, 15, 26, 12, 12, 22, 12, 12, + 15, 22, 12, 12, 24, 43, 49, 42, 24, 26, + 22, 42, 219, 43, 46, 49, 22, 24, 48, 46, + + 24, 46, 219, 24, 26, 27, 46, 717, 27, 219, + 27, 27, 76, 79, 48, 27, 76, 76, 83, 27, + 27, 79, 83, 48, 48, 85, 115, 116, 117, 79, + 129, 79, 281, 281, 115, 116, 117, 152, 85, 137, + 137, 137, 138, 138, 138, 138, 138, 138, 147, 161, + 161, 152, 147, 147, 268, 271, 224, 129, 150, 161, + 150, 162, 162, 162, 150, 150, 169, 183, 150, 224, + 271, 162, 268, 183, 169, 150, 282, 282, 150, 176, + 721, 305, 176, 305, 176, 176, 176, 176, 723, 189, + 176, 189, 190, 176, 190, 176, 191, 192, 191, 192, + + 176, 208, 193, 189, 193, 194, 190, 194, 208, 223, + 191, 192, 307, 223, 208, 724, 193, 208, 318, 194, + 198, 307, 198, 198, 200, 198, 198, 223, 198, 318, + 725, 198, 198, 339, 198, 399, 198, 399, 200, 200, + 200, 446, 405, 200, 519, 563, 339, 405, 623, 622, + 624, 726, 625, 728, 446, 622, 729, 519, 625, 730, + 737, 563, 738, 740, 741, 623, 744, 624, 745, 746, + 563, 718, 718, 718, 718, 718, 563, 747, 563, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 755, 769, 770, 758, 771, 772, 773, 752, 774, 775, + + 777, 778, 756, 757, 779, 715, 752, 714, 713, 712, + 710, 769, 752, 709, 752, 708, 705, 703, 702, 700, + 699, 698, 697, 695, 769, 783, 783, 693, 783, 783, + 783, 783, 784, 692, 691, 784, 784, 785, 690, 688, + 785, 785, 785, 786, 687, 684, 786, 787, 683, 787, + 787, 787, 788, 788, 789, 681, 669, 789, 789, 789, + 790, 790, 790, 667, 665, 664, 662, 658, 657, 654, + 653, 652, 651, 650, 648, 647, 646, 645, 644, 643, + 642, 641, 639, 638, 633, 632, 630, 629, 628, 627, + 620, 619, 618, 617, 616, 615, 614, 613, 612, 611, + + 610, 608, 606, 605, 603, 602, 601, 600, 599, 598, + 597, 596, 595, 594, 593, 592, 591, 590, 589, 588, + 586, 585, 584, 583, 580, 578, 576, 575, 572, 570, + 568, 567, 565, 564, 562, 561, 559, 558, 557, 556, + 553, 549, 548, 547, 546, 544, 543, 542, 541, 540, + 539, 537, 534, 530, 529, 526, 525, 524, 523, 522, + 521, 520, 518, 517, 516, 515, 514, 513, 512, 511, + 510, 509, 508, 507, 505, 504, 503, 502, 501, 500, + 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, + 489, 488, 487, 486, 485, 484, 483, 482, 481, 480, + + 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, + 468, 467, 466, 465, 464, 463, 461, 460, 458, 457, + 456, 455, 454, 453, 451, 450, 449, 448, 447, 445, + 444, 440, 439, 438, 437, 436, 435, 434, 432, 431, + 430, 428, 427, 426, 425, 424, 423, 422, 419, 418, + 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, + 407, 406, 404, 402, 400, 394, 393, 392, 391, 390, + 389, 387, 385, 384, 383, 382, 381, 378, 377, 375, + 374, 373, 372, 371, 370, 369, 368, 367, 366, 365, + 364, 363, 362, 361, 360, 357, 356, 355, 354, 353, + + 351, 350, 346, 345, 344, 343, 342, 341, 340, 338, + 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, + 327, 326, 325, 322, 321, 320, 319, 317, 316, 315, + 314, 313, 312, 311, 310, 309, 308, 306, 303, 284, + 283, 280, 279, 278, 277, 276, 275, 274, 273, 272, + 270, 269, 267, 266, 265, 264, 263, 261, 260, 259, + 258, 257, 255, 254, 253, 252, 251, 249, 248, 244, + 241, 239, 238, 237, 235, 234, 233, 232, 231, 230, + 229, 228, 227, 226, 225, 218, 217, 216, 212, 211, + 210, 209, 207, 206, 205, 204, 203, 202, 201, 199, + + 197, 196, 188, 187, 186, 185, 184, 182, 181, 180, + 179, 177, 175, 174, 173, 172, 171, 170, 168, 167, + 166, 165, 164, 163, 160, 159, 158, 157, 156, 155, + 154, 153, 151, 149, 145, 144, 143, 141, 140, 139, + 136, 135, 134, 133, 132, 131, 130, 128, 126, 125, + 124, 123, 122, 121, 120, 119, 118, 114, 113, 112, + 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, + 101, 100, 99, 97, 96, 95, 94, 93, 92, 91, + 90, 89, 88, 87, 86, 82, 81, 80, 78, 77, + 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, + + 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, + 55, 54, 53, 52, 51, 50, 47, 45, 44, 41, + 39, 38, 36, 35, 34, 33, 32, 29, 28, 25, + 19, 18, 16, 14, 9, 5, 3, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782, 782, + 782, 782, 782, 782, 782, 782, 782, 782, 782 + } ; + +/* Table of booleans, true if rule could match eol. */ +static yyconst flex_int32_t yy_rule_can_match_eol[198] = + { 0, +0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ +yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ +++(yy_lp); \ +goto find_rule; \ +} + +static int yy_more_offset = 0; +static int yy_prev_more_offset = 0; +#define yymore() ((yy_more_offset) = yy_flex_strlen( yytext )) +#define YY_NEED_STRLEN +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET \ + { \ + (yy_more_offset) = (yy_prev_more_offset); \ + yyleng -= (yy_more_offset); \ + } +#ifndef YYLMAX +#define YYLMAX 8192 +#endif + +char yytext[YYLMAX]; +char *yytext_ptr; +#line 1 "./pl.l" +#line 2 "./pl.l" +/* pl.l: Lexical analysis of property list files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous +Copyright (c) 2002 Roozbeh Pournader + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include <string.h> +#ifdef WIN32 +#include <win32lib.h> +#endif +#include "parser.h" +#include "kpathsea/types.h" +#include "y_tab.h" +#include "manifests.h" +#include "error_routines.h" +#ifdef __cplusplus +#define yyinput input +#endif + +int line_number = 1; +extern YYSTYPE yylval; + +/* POTENTIAL BUG: saved_text could be run over; should check */ +#define MAX_PTR 10000 +char saved_text[MAX_PTR]; + +extern void scan_int(unsigned); +extern void scan_char(void); +extern void scan_fix(void); +extern void scan_string(char *, unsigned, unsigned); +extern void scan_hex_string(); + +/* from kpathsea, but avoid including kpathsea header files */ +extern char *xstrdup (const char *); + +#define KEEP_MIN 0 +#define KEEP_NONE 0 +#define KEEP_ALL 1 +#define KEEP_CONVERT 2 +#define KEEP_MAX 2 + +#define BASE_MIN 2 +#define BASE_MAX 16 + +/* For Solaris's lex, to increase tables sizes --RP */ +/* Space before number keeps ancient flex happy. */ +#line 1036 "lex.yy.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include <unistd.h> +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap (void ); +#else +extern int yywrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 80 "./pl.l" + + +#line 1190 "lex.yy.c" + + if ( (yy_init) ) + { + (yy_init) = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_state_buf) ) + (yy_state_buf) = (yy_state_type *)yyalloc(YY_BUF_SIZE + 2 ); + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + + (yy_state_ptr) = (yy_state_buf); + *(yy_state_ptr)++ = yy_current_state; + +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 783 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *(yy_state_ptr)++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 838 ); + +yy_find_action: + yy_current_state = *--(yy_state_ptr); + (yy_lp) = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[(yy_lp)]; + { + (yy_full_match) = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--(yy_state_ptr); + (yy_lp) = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + int yyl; + for ( yyl = (yy_prev_more_offset); yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + + yylineno++; +; + } + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +#line 82 "./pl.l" +{} + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 83 "./pl.l" +{line_number++; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 85 "./pl.l" +return(LEFT); + YY_BREAK +case 4: +YY_RULE_SETUP +#line 86 "./pl.l" +return(RIGHT); + YY_BREAK +case 5: +YY_RULE_SETUP +#line 88 "./pl.l" +{scan_int(8); return(NUMBER); } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 89 "./pl.l" +{scan_int(10); return(NUMBER); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 90 "./pl.l" +{scan_int(16); return(NUMBER); } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 91 "./pl.l" +{scan_char(); return(NUMBER); } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 92 "./pl.l" +{scan_fix(); return(FIX); } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 94 "./pl.l" +{scan_string("CODINGSCHEME", KEEP_CONVERT, LEN_CODING_SCHEME); + return(CODINGSCHEME); } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 96 "./pl.l" +{scan_string("FAMILY", KEEP_CONVERT, LEN_FAMILY); + return(FAMILY); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 98 "./pl.l" +{scan_string("VTITLE", KEEP_ALL, LEN_VTITLE); + return(VTITLE); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 100 "./pl.l" +{scan_string("FONTNAME", KEEP_ALL, LEN_FONT_NAME); + return(FONTNAME); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 102 "./pl.l" +{scan_string("FONTAREA", KEEP_ALL, LEN_FONT_AREA); + return(FONTAREA); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 104 "./pl.l" +{scan_string("SPECIAL", KEEP_ALL, 0); + return(SPECIAL); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 106 "./pl.l" +{scan_string("COMMENT", KEEP_NONE, 0); + return(COMMENT); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 109 "./pl.l" +{scan_hex_string(); return(SPECIALHEX); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 112 "./pl.l" +{yylval.yint=1; return(SEVENBITSAFEFLAG); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 113 "./pl.l" +{yylval.yint=0; return(SEVENBITSAFEFLAG); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 115 "./pl.l" +return(CHECKSUM); + YY_BREAK +case 21: +YY_RULE_SETUP +#line 116 "./pl.l" +return(DESIGNSIZE); + YY_BREAK +case 22: +YY_RULE_SETUP +#line 117 "./pl.l" +return(DESIGNUNITS); + YY_BREAK +case 23: +YY_RULE_SETUP +#line 118 "./pl.l" +return(FACE); + YY_BREAK +case 24: +YY_RULE_SETUP +#line 119 "./pl.l" +return(HEADER); + YY_BREAK +case 25: +YY_RULE_SETUP +#line 120 "./pl.l" +return(BOUNDARYCHAR); + YY_BREAK +case 26: +YY_RULE_SETUP +#line 121 "./pl.l" +return(FONTDIMEN); + YY_BREAK +case 27: +YY_RULE_SETUP +#line 122 "./pl.l" +return(LIGTABLE); + YY_BREAK +case 28: +YY_RULE_SETUP +#line 123 "./pl.l" +return(CHARACTER); + YY_BREAK +case 29: +YY_RULE_SETUP +#line 125 "./pl.l" +return(PARAMETER); + YY_BREAK +case 30: +YY_RULE_SETUP +#line 126 "./pl.l" +return(LABEL); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 127 "./pl.l" +return(KRN); + YY_BREAK +case 32: +YY_RULE_SETUP +#line 128 "./pl.l" +return(STOP); + YY_BREAK +case 33: +YY_RULE_SETUP +#line 129 "./pl.l" +return(SKIP); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 130 "./pl.l" +return(NEXTLARGER); + YY_BREAK +case 35: +YY_RULE_SETUP +#line 131 "./pl.l" +return(VARCHAR); + YY_BREAK +case 36: +YY_RULE_SETUP +#line 133 "./pl.l" +{yylval.yint = C_WD; return(CHARMEASURE); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 134 "./pl.l" +{yylval.yint = C_HT; return(CHARMEASURE); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 135 "./pl.l" +{yylval.yint = C_DP; return(CHARMEASURE); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 136 "./pl.l" +{yylval.yint = C_IC; return(CHARMEASURE); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 138 "./pl.l" +{yylval.yint = E_TOP; return(EXTEN); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 139 "./pl.l" +{yylval.yint = E_MID; return(EXTEN); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 140 "./pl.l" +{yylval.yint = E_BOT; return(EXTEN); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 141 "./pl.l" +{yylval.yint = E_REP; return(EXTEN); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 143 "./pl.l" +{yylval.yint = L_0; return(LIG); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 144 "./pl.l" +{yylval.yint = L_B; return(LIG); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 145 "./pl.l" +{yylval.yint = L_A; return(LIG); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 146 "./pl.l" +{yylval.yint = L_AB; return(LIG); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 147 "./pl.l" +{yylval.yint = L_Bx; return(LIG); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 148 "./pl.l" +{yylval.yint = L_Ax; return(LIG); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 149 "./pl.l" +{yylval.yint = L_ABx; return(LIG); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 150 "./pl.l" +{yylval.yint = L_ABxx; return(LIG); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 152 "./pl.l" +{yylval.yint = F_MRR; return(NUMBER); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 153 "./pl.l" +{yylval.yint = F_MIR; return(NUMBER); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 154 "./pl.l" +{yylval.yint = F_BRR; return(NUMBER); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 155 "./pl.l" +{yylval.yint = F_BIR; return(NUMBER); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 156 "./pl.l" +{yylval.yint = F_LRR; return(NUMBER); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 157 "./pl.l" +{yylval.yint = F_LIR; return(NUMBER); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 158 "./pl.l" +{yylval.yint = F_MRC; return(NUMBER); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 159 "./pl.l" +{yylval.yint = F_MIC; return(NUMBER); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 160 "./pl.l" +{yylval.yint = F_BRC; return(NUMBER); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 161 "./pl.l" +{yylval.yint = F_BIC; return(NUMBER); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 162 "./pl.l" +{yylval.yint = F_LRC; return(NUMBER); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 163 "./pl.l" +{yylval.yint = F_LIC; return(NUMBER); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 164 "./pl.l" +{yylval.yint = F_MRE; return(NUMBER); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 165 "./pl.l" +{yylval.yint = F_MIE; return(NUMBER); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 166 "./pl.l" +{yylval.yint = F_BRE; return(NUMBER); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 167 "./pl.l" +{yylval.yint = F_BIE; return(NUMBER); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 168 "./pl.l" +{yylval.yint = F_LRE; return(NUMBER); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 169 "./pl.l" +{yylval.yint = F_LIE; return(NUMBER); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 171 "./pl.l" +{yylval.yint = P_SLANT; return(NAMEDPARAMETER); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 172 "./pl.l" +{yylval.yint = P_SPACE; return(NAMEDPARAMETER); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 173 "./pl.l" +{yylval.yint = P_STRETCH; return(NAMEDPARAMETER); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 174 "./pl.l" +{yylval.yint = P_SHRINK; return(NAMEDPARAMETER); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 175 "./pl.l" +{yylval.yint = P_XHEIGHT; return(NAMEDPARAMETER); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 176 "./pl.l" +{yylval.yint = P_QUAD; return(NAMEDPARAMETER); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 177 "./pl.l" +{yylval.yint = P_EXTRASPACE; return(NAMEDPARAMETER); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 178 "./pl.l" +{yylval.yint = P_NUM1; return(NAMEDPARAMETER); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 179 "./pl.l" +{yylval.yint = P_NUM2; return(NAMEDPARAMETER); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 180 "./pl.l" +{yylval.yint = P_NUM3; return(NAMEDPARAMETER); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 181 "./pl.l" +{yylval.yint = P_DENOM1; return(NAMEDPARAMETER); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 182 "./pl.l" +{yylval.yint = P_DENOM2; return(NAMEDPARAMETER); } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 183 "./pl.l" +{yylval.yint = P_SUP1; return(NAMEDPARAMETER); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 184 "./pl.l" +{yylval.yint = P_SUP2; return(NAMEDPARAMETER); } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 185 "./pl.l" +{yylval.yint = P_SUP3; return(NAMEDPARAMETER); } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 186 "./pl.l" +{yylval.yint = P_SUB1; return(NAMEDPARAMETER); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 187 "./pl.l" +{yylval.yint = P_SUB2; return(NAMEDPARAMETER); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 188 "./pl.l" +{yylval.yint = P_SUPDROP; return(NAMEDPARAMETER); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 189 "./pl.l" +{yylval.yint = P_SUBDROP; return(NAMEDPARAMETER); } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 190 "./pl.l" +{yylval.yint = P_DELIM1; return(NAMEDPARAMETER); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 191 "./pl.l" +{yylval.yint = P_DELIM2; return(NAMEDPARAMETER); } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 192 "./pl.l" +{yylval.yint = P_AXISHEIGHT; return(NAMEDPARAMETER); } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 194 "./pl.l" +{yylval.yint = P_DEFAULTRULETHICKNESS; + return(NAMEDPARAMETER); } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 196 "./pl.l" +{yylval.yint = P_BIGOPSPACING1; return(NAMEDPARAMETER); } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 197 "./pl.l" +{yylval.yint = P_BIGOPSPACING2; return(NAMEDPARAMETER); } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 198 "./pl.l" +{yylval.yint = P_BIGOPSPACING3; return(NAMEDPARAMETER); } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 199 "./pl.l" +{yylval.yint = P_BIGOPSPACING4; return(NAMEDPARAMETER); } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 200 "./pl.l" +{yylval.yint = P_BIGOPSPACING5; return(NAMEDPARAMETER); } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 202 "./pl.l" +{return(MAPFONT); } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 203 "./pl.l" +{return(FONTCHECKSUM); } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 204 "./pl.l" +{return(FONTAT); } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 205 "./pl.l" +{return(FONTDSIZE); } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 206 "./pl.l" +{return(MAP); } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 207 "./pl.l" +{return(SELECTFONT); } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 208 "./pl.l" +{return(SETCHAR); } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 209 "./pl.l" +{return(SETRULE); } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 210 "./pl.l" +{return(PUSH); } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 211 "./pl.l" +{return(POP); } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 213 "./pl.l" +{yylval.yint = M_RIGHT; return(MOVE); } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 214 "./pl.l" +{yylval.yint = M_LEFT; return(MOVE); } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 215 "./pl.l" +{yylval.yint = M_UP; return(MOVE); } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 216 "./pl.l" +{yylval.yint = M_DOWN; return(MOVE); } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 218 "./pl.l" +return(OFMLEVEL); + YY_BREAK +case 113: +YY_RULE_SETUP +#line 219 "./pl.l" +{yylval.yint = ACC_TOP; return(ACCENT); } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 220 "./pl.l" +{yylval.yint = ACC_MID; return(ACCENT); } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 221 "./pl.l" +{yylval.yint = ACC_BOT; return(ACCENT); } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 223 "./pl.l" +{yylval.yint = DIR_ORD+DIR_TL; return(FONTDIR);} + YY_BREAK +case 117: +YY_RULE_SETUP +#line 224 "./pl.l" +{yylval.yint = DIR_ORD+DIR_LT; return(FONTDIR);} + YY_BREAK +case 118: +YY_RULE_SETUP +#line 225 "./pl.l" +{yylval.yint = DIR_ORD+DIR_TR; return(FONTDIR);} + YY_BREAK +case 119: +YY_RULE_SETUP +#line 226 "./pl.l" +{yylval.yint = DIR_ORD+DIR_LB; return(FONTDIR);} + YY_BREAK +case 120: +YY_RULE_SETUP +#line 227 "./pl.l" +{yylval.yint = DIR_ORD+DIR_BL; return(FONTDIR);} + YY_BREAK +case 121: +YY_RULE_SETUP +#line 228 "./pl.l" +{yylval.yint = DIR_ORD+DIR_RT; return(FONTDIR);} + YY_BREAK +case 122: +YY_RULE_SETUP +#line 229 "./pl.l" +{yylval.yint = DIR_ORD+DIR_BR; return(FONTDIR);} + YY_BREAK +case 123: +YY_RULE_SETUP +#line 230 "./pl.l" +{yylval.yint = DIR_ORD+DIR_RB; return(FONTDIR);} + YY_BREAK +case 124: +YY_RULE_SETUP +#line 231 "./pl.l" +{yylval.yint = DIR_NAT+DIR_TL; return(FONTDIR);} + YY_BREAK +case 125: +YY_RULE_SETUP +#line 232 "./pl.l" +{yylval.yint = DIR_NAT+DIR_LT; return(FONTDIR);} + YY_BREAK +case 126: +YY_RULE_SETUP +#line 233 "./pl.l" +{yylval.yint = DIR_NAT+DIR_TR; return(FONTDIR);} + YY_BREAK +case 127: +YY_RULE_SETUP +#line 234 "./pl.l" +{yylval.yint = DIR_NAT+DIR_LB; return(FONTDIR);} + YY_BREAK +case 128: +YY_RULE_SETUP +#line 235 "./pl.l" +{yylval.yint = DIR_NAT+DIR_BL; return(FONTDIR);} + YY_BREAK +case 129: +YY_RULE_SETUP +#line 236 "./pl.l" +{yylval.yint = DIR_NAT+DIR_RT; return(FONTDIR);} + YY_BREAK +case 130: +YY_RULE_SETUP +#line 237 "./pl.l" +{yylval.yint = DIR_NAT+DIR_BR; return(FONTDIR);} + YY_BREAK +case 131: +YY_RULE_SETUP +#line 238 "./pl.l" +{yylval.yint = DIR_NAT+DIR_RB; return(FONTDIR);} + YY_BREAK +case 132: +YY_RULE_SETUP +#line 240 "./pl.l" +return(FONTIVALUE); + YY_BREAK +case 133: +YY_RULE_SETUP +#line 241 "./pl.l" +return(FONTFVALUE); + YY_BREAK +case 134: +YY_RULE_SETUP +#line 242 "./pl.l" +return(FONTMVALUE); + YY_BREAK +case 135: +YY_RULE_SETUP +#line 243 "./pl.l" +return(FONTPENALTY); + YY_BREAK +case 136: +YY_RULE_SETUP +#line 244 "./pl.l" +return(FONTRULE); + YY_BREAK +case 137: +YY_RULE_SETUP +#line 245 "./pl.l" +return(FONTGLUE); + YY_BREAK +case 138: +YY_RULE_SETUP +#line 247 "./pl.l" +return(IVALUE); + YY_BREAK +case 139: +YY_RULE_SETUP +#line 248 "./pl.l" +return(FVALUE); + YY_BREAK +case 140: +YY_RULE_SETUP +#line 249 "./pl.l" +return(MVALUE); + YY_BREAK +case 141: +YY_RULE_SETUP +#line 250 "./pl.l" +return(PENALTY); + YY_BREAK +case 142: +YY_RULE_SETUP +#line 251 "./pl.l" +return(RULE); + YY_BREAK +case 143: +YY_RULE_SETUP +#line 252 "./pl.l" +return(GLUE); + YY_BREAK +case 144: +YY_RULE_SETUP +#line 254 "./pl.l" +return(IVALUEVAL); + YY_BREAK +case 145: +YY_RULE_SETUP +#line 255 "./pl.l" +return(FVALUEVAL); + YY_BREAK +case 146: +YY_RULE_SETUP +#line 256 "./pl.l" +return(MVALUEVAL); + YY_BREAK +case 147: +YY_RULE_SETUP +#line 257 "./pl.l" +return(PENALTYVAL); + YY_BREAK +case 148: +YY_RULE_SETUP +#line 259 "./pl.l" +{ yylval.yint = RULE_WD; return(RULEMEASURE); } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 260 "./pl.l" +{ yylval.yint = RULE_HT; return(RULEMEASURE); } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 261 "./pl.l" +{ yylval.yint = RULE_DP; return(RULEMEASURE); } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 263 "./pl.l" +return(GLUEWD); + YY_BREAK +case 152: +YY_RULE_SETUP +#line 264 "./pl.l" +{ yylval.yint = GLUE_STRETCH; return(GLUESHRINKSTRETCH); } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 265 "./pl.l" +{ yylval.yint = GLUE_SHRINK; return(GLUESHRINKSTRETCH); } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 267 "./pl.l" +return(GLUETYPE); + YY_BREAK +case 155: +YY_RULE_SETUP +#line 268 "./pl.l" +return(GLUERULE); + YY_BREAK +case 156: +YY_RULE_SETUP +#line 269 "./pl.l" +return(GLUECHAR); + YY_BREAK +case 157: +YY_RULE_SETUP +#line 271 "./pl.l" +return(CHARIVALUE); + YY_BREAK +case 158: +YY_RULE_SETUP +#line 272 "./pl.l" +return(CHARFVALUE); + YY_BREAK +case 159: +YY_RULE_SETUP +#line 273 "./pl.l" +return(CHARMVALUE); + YY_BREAK +case 160: +YY_RULE_SETUP +#line 274 "./pl.l" +return(CHARPENALTY); + YY_BREAK +case 161: +YY_RULE_SETUP +#line 275 "./pl.l" +return(CHARRULE); + YY_BREAK +case 162: +YY_RULE_SETUP +#line 276 "./pl.l" +return(CHARGLUE); + YY_BREAK +case 163: +YY_RULE_SETUP +#line 278 "./pl.l" +return(CKRN); + YY_BREAK +case 164: +YY_RULE_SETUP +#line 279 "./pl.l" +return(CGLUE); + YY_BREAK +case 165: +YY_RULE_SETUP +#line 280 "./pl.l" +return(CPENALTY); + YY_BREAK +case 166: +YY_RULE_SETUP +#line 281 "./pl.l" +return(CPENGLUE); + YY_BREAK +case 167: +YY_RULE_SETUP +#line 282 "./pl.l" +return(CLABEL); + YY_BREAK +case 168: +YY_RULE_SETUP +#line 284 "./pl.l" +return(CHARREPEAT); + YY_BREAK +case 169: +YY_RULE_SETUP +#line 287 "./pl.l" +{yylval.yint = O_FILLL; return(GLUEORDER); } + YY_BREAK +case 170: +YY_RULE_SETUP +#line 288 "./pl.l" +{yylval.yint = O_FILL; return(GLUEORDER); } + YY_BREAK +case 171: +YY_RULE_SETUP +#line 289 "./pl.l" +{yylval.yint = O_FIL; return(GLUEORDER); } + YY_BREAK +case 172: +YY_RULE_SETUP +#line 290 "./pl.l" +{yylval.yint = O_FI; return(GLUEORDER); } + YY_BREAK +case 173: +YY_RULE_SETUP +#line 291 "./pl.l" +{yylval.yint = O_UNIT; return(GLUEORDER); } + YY_BREAK +case 174: +YY_RULE_SETUP +#line 293 "./pl.l" +{yylval.yint = K_NORMAL; return(GLUEKIND); } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 294 "./pl.l" +{yylval.yint = K_ALEADERS; return(GLUEKIND); } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 295 "./pl.l" +{yylval.yint = K_CLEADERS; return(GLUEKIND); } + YY_BREAK +case 177: +YY_RULE_SETUP +#line 296 "./pl.l" +{yylval.yint = K_XLEADERS; return(GLUEKIND); } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 298 "./pl.l" +{yylval.yint = C_SECWD; return(CHARMEASURE); } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 299 "./pl.l" +{yylval.yint = C_SECHT; return(CHARMEASURE); } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 300 "./pl.l" +{yylval.yint = C_SECDP; return(CHARMEASURE); } + YY_BREAK +case 181: +YY_RULE_SETUP +#line 301 "./pl.l" +{yylval.yint = C_SECIC; return(CHARMEASURE); } + YY_BREAK +case 182: +YY_RULE_SETUP +#line 303 "./pl.l" +{yylval.yint = C_P_TOPAXIS; return(CHARMEASURE); } + YY_BREAK +case 183: +YY_RULE_SETUP +#line 304 "./pl.l" +{yylval.yint = C_P_TOPAXISBIs; return(CHARMEASURE); } + YY_BREAK +case 184: +YY_RULE_SETUP +#line 305 "./pl.l" +{yylval.yint = C_P_BOTAXIS; return(CHARMEASURE); } + YY_BREAK +case 185: +YY_RULE_SETUP +#line 306 "./pl.l" +{yylval.yint = C_P_BOTAXISBIS; return(CHARMEASURE); } + YY_BREAK +case 186: +YY_RULE_SETUP +#line 307 "./pl.l" +{yylval.yint = C_P_MIDHOR; return(CHARMEASURE); } + YY_BREAK +case 187: +YY_RULE_SETUP +#line 308 "./pl.l" +{yylval.yint = C_P_MIDVERT; return(CHARMEASURE); } + YY_BREAK +case 188: +YY_RULE_SETUP +#line 309 "./pl.l" +{yylval.yint = C_P_BASESLANT; return(CHARMEASURE); } + YY_BREAK +case 189: +YY_RULE_SETUP +#line 311 "./pl.l" +{yylval.yint = C_S_TOPAXIS; return(CHARMEASURE); } + YY_BREAK +case 190: +YY_RULE_SETUP +#line 312 "./pl.l" +{yylval.yint = C_S_TOPAXISBIs; return(CHARMEASURE); } + YY_BREAK +case 191: +YY_RULE_SETUP +#line 313 "./pl.l" +{yylval.yint = C_S_BOTAXIS; return(CHARMEASURE); } + YY_BREAK +case 192: +YY_RULE_SETUP +#line 314 "./pl.l" +{yylval.yint = C_S_BOTAXISBIS; return(CHARMEASURE); } + YY_BREAK +case 193: +YY_RULE_SETUP +#line 315 "./pl.l" +{yylval.yint = C_S_MIDHOR; return(CHARMEASURE); } + YY_BREAK +case 194: +YY_RULE_SETUP +#line 316 "./pl.l" +{yylval.yint = C_S_MIDVERT; return(CHARMEASURE); } + YY_BREAK +case 195: +YY_RULE_SETUP +#line 317 "./pl.l" +{yylval.yint = C_S_BASESLANT; return(CHARMEASURE); } + YY_BREAK +case 196: +YY_RULE_SETUP +#line 319 "./pl.l" +{lex_error_1("unexpected character (%x); ignored", + yytext[0]);} + YY_BREAK +case 197: +YY_RULE_SETUP +#line 321 "./pl.l" +ECHO; + YY_BREAK +#line 2284 "lex.yy.c" + case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + (yy_state_ptr) = (yy_state_buf); + *(yy_state_ptr)++ = yy_current_state; + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 783 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *(yy_state_ptr)++ = yy_current_state; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 783 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 782); + if ( ! yy_is_jam ) + *(yy_state_ptr)++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ){ + --yylineno; + } + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + if ( c == '\n' ) + + yylineno++; +; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); + + yyfree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param str a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str ) +{ + + return yy_scan_bytes(yy_str,strlen(yy_str) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + yyfree ( (yy_state_buf) ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef yytext_ptr +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif +#line 321 "./pl.l" + + + +/* added by Thomas Esser, suggested by Olaf Weber */ +#ifdef yywrap +#undef yywrap +#endif + +int +yywrap (void) +{ return 1; } + +void +scan_int(unsigned base) +{ + register unsigned j, q = 0x10000 / base, c0=0, c1=0, i=1; + + if ((base<BASE_MIN) || (base>BASE_MAX)) + internal_error_1("scan_int (base=%d)", base); + while ((yytext[i]==' ') || (yytext[i]=='\t')) { + yytext[i] = ' '; + i++; + } + for (; i<yyleng; i++) { + j = yytext[i]; + if (j>='A') j = j + '0' + 10 - 'A' ; + c0 = base*c0 + (c1 / q); + c1 = base*(c1 % q) + j - '0'; + if (c0 > 0xffff) { + lex_error_s("numeric value (%s) too large; set to 0", yytext); + c0=0; c1=0; break; + } + } + yylval.yint = c0 * 0x10000 + c1; +} + +void +scan_fix(void) +{ + unsigned i=1; + unsigned sign = 1; + unsigned j=0; + unsigned acc=0; + unsigned int_part; + unsigned fraction_digits[7]; + + while ((yytext[i]==' ') || (yytext[i]=='\t') || + (yytext[i]=='+') || (yytext[i]=='-')) { + if (yytext[i]=='\t') yytext[i] = ' '; + if (yytext[i]=='-') sign *= -1; + i++; + } + acc=0; + while ((i<yyleng) && (yytext[i]!='.')) { + acc = acc*10 + yytext[i]-'0'; + i++; + if (acc >=0x800 ) { + lex_error_s("fix value (%s) too large; set to 0", yytext); + yylval.yfix = 0; + return; + } + } + int_part = acc; acc = 0; + if (i < yyleng) { + i++; + while ((i<yyleng) && j<7) { + fraction_digits[j] = 0x200000*(yytext[i]-'0'); + i++; j++; + } + while (j>0) {acc = fraction_digits[--j] + acc / 10;} + acc = (acc + 10) / 20; + } + if ((acc > UNITY) && (int_part=2047)) { + lex_error_s("fix value (%s) too large; set to 0", yytext); + yylval.yfix = 0; + return; + } + yylval.yfix = sign * (int_part*UNITY + acc); +} + +void +scan_char(void) +{ + register unsigned i=1; + + while ((yytext[i]==' ') || (yytext[i]=='\t')) i++; + if ((yytext[i]<041) || (yytext[i]>0176) || + (yytext[i]=='(') || (yytext[i]==')')) { + lex_error_1("C value (H %X) must be ASCII (not paren); " + "set to 'A'", yytext[i]); + yylval.yint = 'A'; + } else yylval.yint = yytext[i]; +} + +void +scan_string(char *attribute, unsigned keep, unsigned length) +{ + register unsigned c, saved_ptr = 0, paren_level = 0; + unsigned error_msg = FALSE; + + if ((keep<KEEP_MIN) || (keep>KEEP_MAX)) + internal_error_1("scan_string (keep=%d)", keep); + while (((c = input()) != EOF) && + ((c == ' ') || (c == '\t') || (c == '\n'))) { + if (c == '\n') {line_number++;} + } + if (c==EOF) fatal_error_s("EOF while scanning %s", attribute); + while ((c != EOF) && + ((c != ')') || (paren_level>0))) { + if (c==')') { + paren_level--; + if (keep==KEEP_CONVERT) { + lex_error_s_1("%s character (H %X) converted to slash", + attribute, c); + c = '/'; + } + } else if (c=='(') { + paren_level++; + if (keep==KEEP_CONVERT) { + lex_error_s_1("%s character (H %X) converted to slash", + attribute, c); + c = '/'; + } + } else if ((c<' ') || (c>='~')) { + if (c=='\n') line_number++; + if (keep==KEEP_CONVERT) { + lex_error_s_1("%s character (H %X) converted to blank", + attribute, c); + c = ' '; + } + } + if (saved_ptr<(MAX_PTR-3)) + saved_text[saved_ptr++] = c; + else if (error_msg == FALSE) { + lex_error_s_1("%s string longer than %d characters; truncating", + attribute, MAX_PTR); + error_msg = TRUE; + } + c = input(); + } + if (c==EOF) fatal_error_s("EOF while scanning %s", attribute); + unput(')'); + saved_text[saved_ptr++] = '\0'; + if (keep!=KEEP_NONE) { + if ((length != 0) && (strlen(saved_text)>length)) { + lex_error_s_1("%s string limited to %d characters; truncated", + attribute, length); + saved_text[length] = '\0'; + } + yylval.ystring = xstrdup(saved_text); + } else { + yylval.ystring = NULL; + } +} + +void +scan_hex_string(void) +{ + register unsigned i=10; + + while ((yytext[i]==' ') || (yytext[i]=='\t')) i++; + yylval.ystring = xstrdup(yytext+i); +} + diff --git a/Build/source/texk/web2c/omegafonts/ligkern_routines.c b/Build/source/texk/web2c/omegafonts/ligkern_routines.c new file mode 100644 index 00000000000..6f8fbf3d76b --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/ligkern_routines.c @@ -0,0 +1,576 @@ +/* ligkern_routines.c: The ligature/kerning table. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "manifests.h" +#include "list_routines.h" +#include "ligkern_routines.h" +#include "char_routines.h" +#include "out_routines.h" +#include "print_routines.h" +#include "error_routines.h" +#include "header_routines.h" +#include "out_ofm.h" + +unsigned nk=0; +unsigned nl=0; + +fix *kern_table; +av_list kern_list = NULL; +unsigned no_kerns = 0; + +unsigned min_nl=0; +unsigned bchar = CHAR_BOUNDARY; +unsigned bchar_label = 0; +unsigned bchar_remainder; +unsigned lk_step_ended=FALSE; + +four_entries lig_kern_table[100000]; + +void +set_boundary_character(unsigned c) +{ + /* What checks are required ? */ + bchar = c; +} + +void +init_ligkern(void) +{ + lk_step_ended = FALSE; + nl = 0; + min_nl = 0; +} + +void +set_label_command(unsigned c) +{ + if (c==CHAR_BOUNDARY) { /* BOUNDARYCHAR */ + bchar_label = nl; + } else { + check_char_tag(c); + set_char_tag(c, TAG_LIG); + if (nl==0) set_char_remainder(c, 0); + else set_char_remainder(c, nl); + } + if (min_nl <= nl) { min_nl = nl+1; } + lk_step_ended = FALSE; + no_labels++; +} + +void +set_stop_command(void) +{ + if (lk_step_ended == TRUE) { + lig_kern_table[nl-1].entries[0] = + lig_kern_table[nl-1].entries[0] / 256 * 256 + STOP_FLAG; + } else { + warning_0("STOP must follow LIG or KRN; ignored"); + } + lk_step_ended = FALSE; +} + +void +set_skip_command(unsigned val) +{ + if (lk_step_ended == TRUE) { + if (val>128) { + warning_0("Maximum SKIP amount is 127; ignored"); + } else { + lig_kern_table[nl-1].entries[0] = val; + if (min_nl <= (nl+val)) { min_nl = nl+val+1; } + } + } else { + warning_0("SKIP must follow LIG or KRN; ignored"); + } + lk_step_ended = FALSE; +} + +void +set_ligature_command(unsigned lig, unsigned c, unsigned val) +{ + lig_kern_table[nl].entries[0] = 0; + lig_kern_table[nl].entries[1] = c; + lig_kern_table[nl].entries[2] = lig; + lig_kern_table[nl].entries[3] = val; + nl++; + lk_step_ended = TRUE; + +} + +void +set_kerning_command(unsigned c, fix fval) +{ + unsigned k = set_new_kern(fval); + + lig_kern_table[nl].entries[0] = 0; + lig_kern_table[nl].entries[1] = c; + if (ofm_level==OFM_TFM) { + lig_kern_table[nl].entries[2] = KERN_FLAG + (k/256); + lig_kern_table[nl].entries[3] = k % 256; + } else { + lig_kern_table[nl].entries[2] = KERN_FLAG + (k/65536); + lig_kern_table[nl].entries[3] = k % 65536; + } + nl++; + lk_step_ended = TRUE; +} + +void +set_c_label_command(unsigned new_class) +{ + fatal_error_0("CLABEL not currently supported"); +} + +void +set_c_kerning_command(unsigned new_class, fix fval) +{ + fatal_error_0("CKRN not currently supported"); +} + +void +set_c_glue_command(unsigned new_class, unsigned glue_index) +{ + fatal_error_0("CGLUE not currently supported"); +} + +void +set_c_penalty_command(unsigned new_class, unsigned pen_index) +{ + fatal_error_0("CPEN not currently supported"); +} + +void +set_c_penglue_command(unsigned new_class, unsigned pen_index, unsigned glue_index) +{ + fatal_error_0("CPENGLUE not currently supported"); +} + +int +set_new_kern(fix fval) +{ + unsigned index; + av_list L1, L2; + + L1 = kern_list; + if (L1 == NULL) { + index = nk++; + kern_list = av_list1(index, fval); + } else { + L2 = L1->ptr; + while ((lval(L1) != fval) && (L2 != NULL)) { + L1 = L2; + L2 = L2->ptr; + } + if (fval == lval(L1)) { + index = lattr(L1); + } else { + index = nk++; + L2 = av_list1(index, fval); + L1->ptr = L2; + } + } + return index; +} + + +void +build_kern_table(void) +{ + av_list L1 = kern_list, L2; + unsigned i = 0; + + kern_table = (fix *) xmalloc((nk+1)*sizeof(int)); + while (L1 != NULL) { + kern_table[i] = lval(L1); + L2 = L1->ptr; + free(L1); L1 = L2; + i++; + } +} + +void +print_kerns(void) +{ + unsigned i; + + if (nk>0) { + left(); out("COMMENT"); out_ln(); + for (i=0; i<nk; i++) { + left(); out("KERN_ENTRY"); + out(" "); out_int(i,10); + out(" "); out_fix(kern_table[i]); + right(); + } + right(); + } +} + +void +print_ligkern_table(void) +{ + unsigned i; + four_entries *entry; + + sort_ptr = 1; + if (nl>0) { + left(); out("LIGTABLE"); out_ln(); + for (i=0; i<nl; i++) { + while ((sort_ptr<=label_ptr) && (i==label_table[sort_ptr].rr)) { + print_label_command(label_table[sort_ptr].cc); + sort_ptr++; + } + entry = lig_kern_table+i; + print_one_lig_kern_entry(lig_kern_table+i, TRUE); + } + right(); + } +} + +void +print_one_lig_kern_entry(four_entries *lentry, boolean show_stop) +{ + if (lentry->entries[2] >= KERN_FLAG) { + if (ofm_level==OFM_TFM) { + print_kerning_command(lentry->entries[1], + kern_table[256*(lentry->entries[2]-KERN_FLAG)+lentry->entries[3]]); + } else { + print_kerning_command(lentry->entries[1], + kern_table[65536*(lentry->entries[2]-KERN_FLAG)+lentry->entries[3]]); + } + } else { + print_ligature_command(lentry->entries[2], + lentry->entries[1], + lentry->entries[3]); + } + if ((show_stop == TRUE) && (lentry->entries[0] > 0)) { + if (lentry->entries[0] >= STOP_FLAG) { + print_stop_command(); + } else { + print_skip_command(0); + } + } +} + +hash_list hash_table[PRIME]; + +unsigned x_lig_cycle; +unsigned y_lig_cycle = CHAR_BOUNDARY; + +int +l_f(hash_list h, unsigned x, unsigned y) +{ + switch(h->new_class) { + case LIG_SIMPLE: {break;} + case LIG_LEFT_Z: { + h->new_class = LIG_PENDING; + h->lig_z = l_eval(h->lig_z, y); + h->new_class = LIG_SIMPLE; + break; + } + case LIG_RIGHT_Z: { + h->new_class = LIG_PENDING; + h->lig_z = l_eval(x, h->lig_z); + h->new_class = LIG_SIMPLE; + break; + } + case LIG_BOTH_Z: { + h->new_class = LIG_PENDING; + h->lig_z = l_eval(l_eval(x,h->lig_z), y); + h->new_class = LIG_SIMPLE; + break; + } + case LIG_PENDING: { + x_lig_cycle = x; + y_lig_cycle = y; + h->lig_z = CHAR_ERROR; + h->new_class = LIG_SIMPLE; + break; + } + default: { + internal_error_1("f (new_class=%d)", h->new_class); + } + } + return (h->lig_z); +} + +int +l_eval(unsigned x, unsigned y) +{ + hash_list h; + + if ((x==CHAR_ERROR) || (y==CHAR_ERROR)) return CHAR_ERROR; + h = l_hash_lookup(x, y); + if (h == NULL) return y; + return l_f(h, x, y); +} + +queue hash_entries; + +int +l_hash_input(unsigned p, unsigned c) +{ + + four_entries *entry = lig_kern_table+p; + unsigned y = entry->entries[1]; + unsigned t = entry->entries[2]; + unsigned cc = LIG_SIMPLE; + unsigned zz = entry->entries[3]; + unsigned key; + hash_list L1, L2; + + if (t >= KERN_FLAG) zz = y; + else { + switch(t) { + case L_0: + case L_Ax: { break; } + case L_Bx: + case L_ABxx: { zz = y; break; } + case L_B: + case L_ABx: { cc = LIG_LEFT_Z; break; } + case L_A: { cc = LIG_RIGHT_Z; break; } + case L_AB: { cc = LIG_BOTH_Z; break; } + default: { + internal_error_1("l_hash_input (case=%d)", t); + } + } + } + key = (c & 0x7fff)*(y & 0x7fff) % PRIME; + if (hash_table[key] == NULL) { + hash_table[key] = hash_list1(c,y,cc,zz); + append_to_queue(&hash_entries, hash_table[key]); + } else { + L1 = hash_table[key]; + L2 = L1->ptr; + while ((L2 != NULL) && + ((L2->x <= c) || ((L2->x == c) && (L2->y <= y)))) { + L1 = L2; + L2 = L2->ptr; + } + if (L2 == NULL) { + L2 = hash_list1(c,y,cc,zz); + append_to_queue(&hash_entries, L2); + L2->ptr = L1->ptr; + L1->ptr = L2; + } else if ((c < L2->x) || ((c == L2->x) && (y < L2->y))) { + hash_table[key] = hash_list1(c,y,cc,zz); + hash_table[key]->ptr = L1; + append_to_queue(&hash_entries, hash_table[key]); + } else if ((c == L2->x) && (y < L2->y)) { + return FALSE; /* unused ligature command */ + } else { + L2 = hash_list1(c,y,cc,zz); + append_to_queue(&hash_entries, L2); + L2->ptr = L1->ptr; + L1->ptr = L2; + } + } + return TRUE; +} + +hash_list +l_hash_lookup(unsigned x, unsigned y) +{ + unsigned key = (x & 0x7fff)*(y & 0x7fff) % PRIME; + hash_list L = hash_table[key]; + + if (L==NULL) return NULL; + while (L->x < x) L = L->ptr; + if (L->x != x) return NULL; + while ((L->x == x) && (L->y < y)) L = L->ptr; + if (L->y != y) return NULL; + return L; +} + +void +check_ligature_ends_properly(void) +{ + if (nl>0) { + if (bchar_label != 0) { + /* make room for it; the actual label will be stored later */ + nl++; + } + while (min_nl > nl) { + nl++; + } + if (lig_kern_table[nl].entries[0] == 0) { + lig_kern_table[nl].entries[0] = STOP_FLAG; + } + } +} + +void +check_ligature_program(unsigned c, unsigned lab) +{ + unsigned lig_ptr = lab; + four_entries *entry; + + while (lig_ptr < nl) { + entry = lig_kern_table+lig_ptr; + if (l_hash_input(lig_ptr,c)) { + if (entry->entries[2] < KERN_FLAG) { + if (entry->entries[1] != bchar) + check_existence_and_safety(c, entry->entries[1], + ligature_commands[entry->entries[2]], + "%s character examined by (H %X)"); + if (entry->entries[3] >= 128) +/* Needs fixing */ + if ((c < 128) || (c == -1)) + if ((entry->entries[1] < 128) || + (entry->entries[1] == bchar)) + seven_bit_calculated = 0; + check_existence_and_safety(c, entry->entries[3], + ligature_commands[entry->entries[2]], + "%s character generated by (H %X)"); + } else { + check_existence_and_safety(c, entry->entries[1], + "KRN", "%s character examined by (H %X)"); + } + } + if (entry->entries[0] >= STOP_FLAG) lig_ptr = nl; + else lig_ptr = lig_ptr + 1 + entry->entries[0]; + } +} + +void +check_ligature_infinite_loops(void) +{ + list entry = hash_entries.front; + hash_list tt; + unsigned new_class; + + while (entry != NULL) { + tt = (hash_list) entry->contents; + if (tt->new_class > LIG_SIMPLE) + new_class = l_f(tt, tt->x, tt->y); + entry = entry->ptr; + } + if (y_lig_cycle != 0x80000000) { + if (x_lig_cycle == CHAR_BOUNDARY) { + warning_1("Infinite ligature loop starting with boundary and %d", + y_lig_cycle); + } else { + warning_2("Infinite ligature loop starting with %d and %d", + x_lig_cycle, y_lig_cycle); + } + clear_ligature_entries(); + nl = 0; bchar = CHAR_BOUNDARY; bchar_label = 0; + } +} + +void +doublecheck_ligatures(void) +{ + unsigned i; + + if (nl>0) { + for (i=0; i<nl; i++) { + if (lig_kern_table[i].entries[2] < KERN_FLAG) { + if (lig_kern_table[i].entries[0] != CHAR_BOUNDARY) { + doublecheck_existence( + lig_kern_table[i].entries[1], + ligature_commands[lig_kern_table[i].entries[2]], + "Unused %s step refers to nonexistent character (H %X)"); + doublecheck_existence( + lig_kern_table[i].entries[3], + ligature_commands[lig_kern_table[i].entries[2]], + "Unused %s step refers to nonexistent character (H %X)"); + } + } else { + doublecheck_existence( + lig_kern_table[i].entries[1], + "KRN", + "Unused %s step refers to nonexistent character (H %X)"); + } + } + } +} + +void +output_ofm_ligkern(void) +{ + unsigned i; + four_entries *entry; + + if (ofm_level == OFM_TFM) { + for (i=0; i<nl; i++) { + entry = lig_kern_table+i; + out_ofm(entry->entries[0] & 0xff); + out_ofm(entry->entries[1] & 0xff); + out_ofm(entry->entries[2] & 0xff); + out_ofm(entry->entries[3] & 0xff); + } + } else { + for (i=0; i<nl; i++) { + entry = lig_kern_table+i; + out_ofm_2(entry->entries[0] & 0xffff); + out_ofm_2(entry->entries[1] & 0xffff); + out_ofm_2(entry->entries[2] & 0xffff); + out_ofm_2(entry->entries[3] & 0xffff); + } + } + for (i=0; i<nk; i++) { + out_ofm_4(kern_table[i]); + } +} + +void +retrieve_ligkern_table(unsigned char *ofm_lig_table, + unsigned char *ofm_kern_table) +{ + unsigned i; + four_entries *entry; + unsigned char *table_entry; + + if (ofm_level == OFM_TFM) { + for (i=0; i<nl; i++) { + entry = lig_kern_table+i; + table_entry = ofm_lig_table+(4*i); + entry->entries[0] = (*table_entry) & 0xff; + entry->entries[1] = (*(table_entry+1)) & 0xff; + entry->entries[2] = (*(table_entry+2)) & 0xff; + entry->entries[3] = (*(table_entry+3)) & 0xff; + } + } else { + for (i=0; i<nl; i++) { + entry = lig_kern_table+i; + table_entry = ofm_lig_table+(8*i); + entry->entries[0] = (((*table_entry) & 0xff) * 0x100) + + ((*(table_entry+1)) & 0xff); + entry->entries[1] = (((*(table_entry+2)) & 0xff) * 0x100) + + ((*(table_entry+3)) & 0xff); + entry->entries[2] = (((*(table_entry+4)) & 0xff) * 0x100) + + ((*(table_entry+5)) & 0xff); + entry->entries[3] = (((*(table_entry+6)) & 0xff) * 0x100) + + ((*(table_entry+7)) & 0xff); + } + } + kern_table = (fix *) xmalloc((nk+1)*sizeof(int)); + for (i=0; i<nk; i++) { + table_entry = ofm_kern_table+(4*i); + kern_table[i] = (((*table_entry) & 0xff) << 24) | + (((*(table_entry+1)) & 0xff) << 16) | + (((*(table_entry+2)) & 0xff) << 8) | + ((*(table_entry+3)) & 0xff); + } +} diff --git a/Build/source/texk/web2c/omegafonts/ligkern_routines.h b/Build/source/texk/web2c/omegafonts/ligkern_routines.h new file mode 100644 index 00000000000..66a9be31ca0 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/ligkern_routines.h @@ -0,0 +1,67 @@ +/* ligkern_routines.h: The ligature/kerning table. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern four_entries lig_kern_table[100000]; + +extern void init_ligkern_entry(void); +extern void set_label_command(unsigned); +extern void set_ligature_command(unsigned, unsigned, unsigned); +extern void set_kerning_command(unsigned, fix); +extern void set_stop_command(void); +extern void set_skip_command(unsigned); +extern int set_new_kern(fix); +extern void print_kerns(void); +extern void build_kern_table(void); +extern void set_boundary_character(unsigned); + +extern void check_ligature_program(unsigned,unsigned); +extern void check_ligature_ends_properly(void); +extern void check_ligature_infinite_loops(void); +extern void doublecheck_ligatures(void); + +extern void print_ligkern_table(void); +extern void init_ligkern(void); + +extern int l_f(hash_list, unsigned, unsigned); +extern int l_eval(unsigned, unsigned); +extern int l_hash_input(unsigned, unsigned); +extern hash_list l_hash_lookup(unsigned, unsigned); + +#define PRIME 1009 + +#define KERN_FLAG 128 +#define STOP_FLAG 128 + + +extern void set_c_label_command(unsigned); +extern void set_c_kerning_command(unsigned, fix); +extern void set_c_glue_command(unsigned, unsigned); +extern void set_c_penalty_command(unsigned, unsigned); +extern void set_c_penglue_command(unsigned, unsigned, unsigned); + +extern unsigned nl; +extern unsigned nk; + +extern void output_ofm_ligkern(void); +extern void retrieve_ligkern_table(unsigned char *, unsigned char *); +extern void print_one_lig_kern_entry(four_entries *, boolean); diff --git a/Build/source/texk/web2c/omegafonts/list_routines.c b/Build/source/texk/web2c/omegafonts/list_routines.c new file mode 100644 index 00000000000..35e390c0527 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/list_routines.c @@ -0,0 +1,256 @@ +/* list_routines.c: Types used in this program. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" + +list +cons (void *x, list L) +{ +list temp; +temp = (list) xmalloc(sizeof(cell)); +temp->contents = x; +temp->ptr = L; +return temp; +} + +list +list1 (void *x) +{ +list temp; +temp = (list) xmalloc(sizeof(cell)); +temp->contents = x; +temp->ptr = NULL; +return temp; +} + +list +list2 (void *x, void *y) +{ +list temp, temp1; +temp = (list) xmalloc(sizeof(cell)); +temp1 = (list) xmalloc(sizeof(cell)); +temp->contents = x; +temp->ptr = temp1; +temp1->contents = y; +temp1->ptr = NULL; +return temp; +} + +list +append (list K, list L) +{ +if (K==NULL) return L; +return cons(K->contents, append(K->ptr, L)); +} + +list +append1 (list L, void *x) +{ +return (append(L,list1(x))); +} + + +/* Attribute-value list functions */ + +av_list +av_cons (int attr, int val, av_list L) +{ +av_list temp; +temp = (av_list) xmalloc(sizeof(av_cell)); +temp->attribute = attr; +temp->value = val; +temp->ptr = L; +return temp; +} + +av_list +av_list1 (int attr, int val) +{ +av_list temp; +temp = (av_list) xmalloc(sizeof(av_cell)); +temp->attribute = attr; +temp->value = val; +temp->ptr = NULL; +return temp; +} + +av_list +av_list2 (int attr, int val, int attr1, int val1) +{ +av_list temp, temp1; +temp = (av_list) xmalloc(sizeof(av_cell)); +temp1 = (av_list) xmalloc(sizeof(av_cell)); +temp->attribute = attr; +temp->value = val; +temp->ptr = temp1; +temp1->attribute = attr1; +temp1->value = val1; +temp1->ptr = NULL; +return temp; +} + +av_list +av_append (av_list K, av_list L) +{ +if (K==NULL) return L; +return av_cons(K->attribute, K->value, av_append(K->ptr, L)); +} + +av_list +av_append1 (av_list L, int attr, int val) +{ +return (av_append(L,av_list1(attr, val))); +} + + +/* Index-value list functions */ + +in_list +in_cons (int val, in_list N, in_list L) +{ +in_list temp; +temp = (in_list) xmalloc(sizeof(in_cell)); +temp->value = val; +temp->actual = N; +temp->ptr = L; +return temp; +} + +in_list +in_list1 (int val, in_list N) +{ +in_list temp; +temp = (in_list) xmalloc(sizeof(in_cell)); +temp->value = val; +temp->actual = N; +temp->ptr = NULL; +return temp; +} + +in_list +in_list2 (int val, in_list N, int val1, in_list N1) +{ +in_list temp, temp1; +temp = (in_list) xmalloc(sizeof(in_cell)); +temp1 = (in_list) xmalloc(sizeof(in_cell)); +temp->value = val; +temp->ptr = temp1; +temp->actual = N; +temp1->value = val1; +temp->actual = N1; +temp1->ptr = NULL; +return temp; +} + +in_list +in_append (in_list K, in_list L) +{ +if (K==NULL) return L; +return in_cons(K->value, K->actual, in_append(K->ptr, L)); +} + +in_list +in_append1 (in_list L, int val, in_list N) +{ +return (in_append(L,in_list1(val, N))); +} + +/* Attribute-value list functions */ + +hash_list +hash_cons (int x, int y, int new_class, int lig_z, hash_list L) +{ +hash_list temp; +temp = (hash_list) xmalloc(sizeof(hash_cell)); +temp->x = x; +temp->y = y; +temp->new_class = new_class; +temp->lig_z = lig_z; +temp->ptr = L; +return temp; +} + +hash_list +hash_list1 (int x, int y, int new_class, int lig_z) +{ +hash_list temp; +temp = (hash_list) xmalloc(sizeof(hash_cell)); +temp->x = x; +temp->y = y; +temp->new_class = new_class; +temp->lig_z = lig_z; +temp->ptr = NULL; +return temp; +} + +hash_list +hash_list2(int x,int y,int new_class,int lig_z,int x1,int y1,int class1,int lig_z1) +{ +hash_list temp, temp1; +temp = (hash_list) xmalloc(sizeof(hash_cell)); +temp1 = (hash_list) xmalloc(sizeof(hash_cell)); +temp->x = x; +temp->y = y; +temp->new_class = new_class; +temp->lig_z = lig_z; +temp->ptr = temp1; +temp1->x = x1; +temp1->y = y1; +temp1->new_class = class1; +temp1->lig_z = lig_z1; +temp1->ptr = NULL; +return temp; +} + +hash_list +hash_append (hash_list K, hash_list L) +{ +if (K==NULL) return L; +return hash_cons(K->x, K->y, K->new_class, K->lig_z, hash_append(K->ptr, L)); +} + +hash_list +hash_append1 (hash_list L, int x, int y, int new_class, int lig_z) +{ +return (hash_append(L,hash_list1(x, y, new_class, lig_z))); +} + +void +init_queue(queue *q) +{ + q->front = NULL; + q->tail = NULL; +} + +void +append_to_queue(queue *q, void *content) +{ + if (q->front == NULL) { + q->front = list1(content); + q->tail = q->front; + } else { + q->tail->ptr = list1(content); + q->tail = q->tail->ptr; + } +} diff --git a/Build/source/texk/web2c/omegafonts/list_routines.h b/Build/source/texk/web2c/omegafonts/list_routines.h new file mode 100644 index 00000000000..c2ca6d654dd --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/list_routines.h @@ -0,0 +1,104 @@ +/* list_routines.h: Types used in this program. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +typedef int fix; + +typedef struct cell_struct { + struct cell_struct *ptr; + void *contents; +} cell; +typedef cell *list; + +typedef struct av_cell_struct { + struct av_cell_struct *ptr; + int attribute; + int value; +} av_cell; +typedef av_cell *av_list; + +typedef struct in_cell_struct { + struct in_cell_struct *ptr; + struct in_cell_struct *actual; + int value; + int index; +} in_cell; +typedef in_cell *in_list; + +typedef struct hash_cell_struct { + int x; + int y; + int new_class; + int lig_z; + struct hash_cell_struct *ptr; +} hash_cell; + +typedef hash_cell *hash_list; + +typedef struct queue_struct { + struct cell_struct *front; + struct cell_struct *tail; +} queue; + +extern list cons(void *, list); +extern list list1(void *); +extern list list2(void *, void *); +extern list append(list, list); +extern list append1(list, void *); + +extern av_list av_cons(int,int, av_list); +extern av_list av_list1(int,int); +extern av_list av_list2(int,int, int,int); +extern av_list av_append(av_list, av_list); +extern av_list av_append1(av_list, int,int); + +extern in_list in_cons(int,in_list, in_list); +extern in_list in_list1(int,in_list); +extern in_list in_list2(int,in_list, int,in_list); +extern in_list in_append(in_list, in_list); +extern in_list in_append1(in_list, int,in_list); + +extern hash_list hash_cons(int,int,int,int, hash_list); +extern hash_list hash_list1(int,int,int,int); +extern hash_list hash_list2(int,int,int,int, int,int,int,int); +extern hash_list hash_append(hash_list, hash_list); +extern hash_list hash_append1(hash_list, int,int,int,int); + +#define lattr(L) (L->attribute) +#define lval(L) (L->value) + +typedef struct four_pieces_struct { + unsigned int pieces[4]; +} four_pieces; + +typedef struct four_entries_struct { + int entries[4]; +} four_entries; + +#define lb0(L) (((four_entries *)((L)->contents))->entries[0]) +#define lb1(L) (((four_entries *)((L)->contents))->entries[1]) +#define lb2(L) (((four_entries *)((L)->contents))->entries[2]) +#define lb3(L) (((four_entries *)((L)->contents))->entries[3]) + + +extern void init_queue(queue *); +extern void append_to_queue(queue *, void *); diff --git a/Build/source/texk/web2c/omegafonts/manifests.h b/Build/source/texk/web2c/omegafonts/manifests.h new file mode 100644 index 00000000000..94a1a80141c --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/manifests.h @@ -0,0 +1,280 @@ +/* manifests.h: Various constants used everywhere. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +/* Character measures */ + +#define C_MIN 0 + +#define C_WD 0 +#define C_HT 1 +#define C_DP 2 +#define C_IC 3 + +#define C_SECWD 4 +#define C_SECHT 5 +#define C_SECDP 6 +#define C_SECIC 7 + +#define C_P_TOPAXIS 8 +#define C_P_TOPAXISBIs 9 +#define C_P_BOTAXIS 10 +#define C_P_BOTAXISBIS 11 +#define C_P_MIDHOR 12 +#define C_P_MIDVERT 13 +#define C_P_BASESLANT 14 + +#define C_S_TOPAXIS 16 +#define C_S_TOPAXISBIs 17 +#define C_S_BOTAXIS 18 +#define C_S_BOTAXISBIS 19 +#define C_S_MIDHOR 20 +#define C_S_MIDVERT 21 +#define C_S_BASESLANT 22 + +#define C_MAX 22 + +/* Extensible pieces */ + +#define E_MIN 0 + +#define E_TOP 0 +#define E_MID 1 +#define E_BOT 2 +#define E_REP 3 + +#define E_MAX 3 + +/* Ligature commands */ + +#define L_MIN 0 + +#define L_0 0 /* LIG */ +#define L_B 1 /* LIG/ */ +#define L_A 2 /* /LIG */ +#define L_AB 3 /* /LIG/ */ +#define L_Bx 5 /* LIG/> */ +#define L_Ax 6 /* /LIG> */ +#define L_ABx 7 /* /LIG/> */ +#define L_ABxx 11 /* /LIG/>> */ + +#define L_MAX 11 + +/* Xerox faces */ + +#define F_MIN 0 + +#define F_MRR 0 +#define F_MIR 1 +#define F_BRR 2 +#define F_BIR 3 +#define F_LRR 4 +#define F_LIR 5 +#define F_MRC 6 +#define F_MIC 7 +#define F_BRC 8 +#define F_BIC 9 +#define F_LRC 10 +#define F_LIC 11 +#define F_MRE 12 +#define F_MIE 13 +#define F_BRE 14 +#define F_BIE 15 +#define F_LRE 16 +#define F_LIE 17 + +#define F_MAX 17 + +/* Named parameters */ + +#define P_MIN 1 + +#define P_SLANT 1 +#define P_SPACE 2 +#define P_STRETCH 3 +#define P_SHRINK 4 +#define P_XHEIGHT 5 +#define P_QUAD 6 +#define P_EXTRASPACE 7 + +#define P_MAX 7 + +/* Named math symbol parameters */ + +#define P_MATHSY_MIN 8 + +#define P_NUM1 8 +#define P_NUM2 9 +#define P_NUM3 10 +#define P_DENOM1 11 +#define P_DENOM2 12 +#define P_SUP1 13 +#define P_SUP2 14 +#define P_SUP3 15 +#define P_SUB1 16 +#define P_SUB2 17 +#define P_SUPDROP 18 +#define P_SUBDROP 19 +#define P_DELIM1 20 +#define P_DELIM2 21 +#define P_AXISHEIGHT 22 + +#define P_MATHSY_MAX 22 + +/* Named math extension parameters */ + +#define P_MATHEX_MIN 8 + +#define P_DEFAULTRULETHICKNESS 8 +#define P_BIGOPSPACING1 9 +#define P_BIGOPSPACING2 10 +#define P_BIGOPSPACING3 11 +#define P_BIGOPSPACING4 12 +#define P_BIGOPSPACING5 13 + +#define P_MATHEX_MAX 13 + +/* Typesetting directions */ + +#define DIR_MIN 0 + +#define DIR_ORD 0 +#define DIR_NAT 8 + +#define DIR_TL 0 +#define DIR_LT 1 +#define DIR_TR 2 +#define DIR_LB 3 +#define DIR_BL 4 +#define DIR_RT 5 +#define DIR_BR 6 +#define DIR_RB 7 + +#define DIR_MAX 15 + +/* Kinds of accent */ + +#define ACC_NONE 0 +#define ACC_TOP 1 +#define ACC_MID 2 +#define ACC_BOT 3 + +/* Move directions */ + +#define M_MIN 0 + +#define M_RIGHT 0 +#define M_LEFT 1 +#define M_UP 2 +#define M_DOWN 3 + +#define M_MAX 3 + +/* Rule measures */ + +#define RULE_MIN 0 + +#define RULE_WD 0 +#define RULE_HT 1 +#define RULE_DP 2 + +#define RULE_MAX 2 + +/* Glue shrink or stretch */ + +#define GLUE_MIN 0 + +#define GLUE_SHRINK 0 +#define GLUE_STRETCH 1 + +#define GLUE_MAX 1 + +/* Glue orders */ + +#define O_MIN 0 + +#define O_UNIT 0 +#define O_FI 1 +#define O_FIL 2 +#define O_FILL 3 +#define O_FILLL 4 + +#define O_MAX 4 + + +/* Glue kinds */ + +#define K_MIN 0 + +#define K_NORMAL 0 +#define K_ALEADERS 1 +#define K_CLEADERS 2 +#define K_XLEADERS 3 + +#define K_MAX 3 + + +/* Font types */ + +#define FT_MIN 0 + +#define FT_VANILLA 0 +#define FT_MATHSY 1 +#define FT_MATHEX 2 + +#define FT_MAX 2 + + +#define UNITY 0x100000 +#define INFINITY 0x7fffffff + +#define LEN_CODING_SCHEME 39 +#define LEN_FAMILY 19 +#define LEN_VTITLE 255 +#define LEN_FONT_NAME 255 +#define LEN_FONT_AREA 255 + +#define TAG_NONE 0 +#define TAG_LIG 1 +#define TAG_LIST 2 +#define TAG_EXT 3 + +#define CHAR_MINIMUM 0x0 +#define CHAR_MAXIMUM 0x7fffffff +#define CHAR_BOUNDARY 0x80000000 +#define CHAR_ERROR 0x80000001 + +#define LIG_SIMPLE 0 /* f(x,y) = z */ +#define LIG_LEFT_Z 1 /* f(x,y) = f(z,y) */ +#define LIG_RIGHT_Z 2 /* f(x,y) = f(x,z) */ +#define LIG_BOTH_Z 3 /* f(x,y) = f(f(x,z),y) */ +#define LIG_PENDING 4 /* f(x,y) is being evaluated */ + +#define GLUEARG_NONE 0 +#define GLUEARG_CHAR 1 +#define GLUEARG_RULE 2 + +#define OFM_NOLEVEL 0 +#define OFM_TFM 1 +#define OFM_LEVEL0 2 +#define OFM_LEVEL1 3 +#define OFM_LEVEL2 4 diff --git a/Build/source/texk/web2c/omegafonts/omfonts.c b/Build/source/texk/web2c/omegafonts/omfonts.c new file mode 100644 index 00000000000..bfbbf7f429f --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/omfonts.c @@ -0,0 +1,323 @@ +/* omfonts.c: Main routine for ofm2opl, opl2ofm, ovf2ovp, ovp2ovf. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#define OFM2OPL +#define OPL2OFM +#define OVP2OVF +#define OVF2OVP +#include "cpascal.h" +#include "parser.h" +#include "manifests.h" +#include "omfonts.h" +#include "list_routines.h" +#include "error_routines.h" +#include "header_routines.h" +#include "font_routines.h" +#include "param_routines.h" +#include "char_routines.h" +#include "dimen_routines.h" +#include "parse_ofm.h" + +#define PROG_MIN 0 +#define PROG_OFM2OPL 0 +#define PROG_OVF2OVP 1 +#define PROG_OPL2OFM 2 +#define PROG_OVP2OVF 3 +#define PROG_MAX 3 + +extern FILE *yyin; + +#define cmdline(i) (argv[i]) + +int verbose_option; +int char_format = CHAR_CODE_NUM; +int num_format = NUM_CODE_HEX; +int text_format = TEXT_CODE_MIXED; + +int program; + +string name_ofm = NULL; +string name_opl = NULL; +string name_ovp = NULL; +string name_ovf = NULL; + +FILE *file_ofm = NULL; +FILE *file_opl = NULL; +FILE *file_ovp = NULL; +FILE *file_ovf = NULL; +FILE *file_output = NULL; + +unsigned char *ofm = NULL; +unsigned char *ovf = NULL; + +unsigned length_ofm = 0; +unsigned length_ovf = 0; + +const_string name_program; +const_string *name_help; +string name_msg; + +string name_empty = NULL; + +int no_files=0; +string *files[3] = {NULL, NULL, NULL}; +string suffixes[3] = {NULL, NULL, NULL}; +string full_suffixes[3] = {NULL, NULL, NULL}; + +static struct option long_options[] = { + {"verbose", 0, &verbose_option, 1}, + {"char-format", 1, 0, 0}, + {"num-format", 1, 0, 0}, + {"text-format", 1, 0, 0}, + {"help", 0, 0, 0}, + {"version", 0, 0, 0}, + {0, 0, 0, 0} +}; + +int +main (int argc, string *argv) +{ + int getopt_return_val; + int option_index = 0; + + name_program = xbasename(argv[0]); + if (!strcmp(name_program, "ofm2opl") || + !strcmp(name_program, "OFM2OPL.EXE")) { + program = PROG_OFM2OPL; + name_help = OFM2OPLHELP; + name_program = "ofm2opl"; + name_msg = "This is ofm2opl, Version 2.0"; + no_files = 2; + files[0] = &name_ofm; + files[1] = &name_opl; + suffixes[0] = "ofm"; + suffixes[1] = "opl"; + full_suffixes[0] = ".ofm"; + full_suffixes[1] = ".opl"; + } else if (!strcmp(name_program, "opl2ofm") || + !strcmp(name_program, "OPL2OFM.EXE")) { + program = PROG_OPL2OFM; + name_help = OPL2OFMHELP; + name_program = "opl2ofm"; + name_msg = "This is opl2ofm, Version 2.0"; + no_files = 2; + files[0] = &name_opl; + files[1] = &name_ofm; + suffixes[0] = "opl"; + suffixes[1] = "ofm"; + full_suffixes[0] = ".opl"; + full_suffixes[1] = ".ofm"; + } else if (!strcmp(name_program, "ovp2ovf") || + !strcmp(name_program, "OVP2OVF.EXE")) { + program = PROG_OVP2OVF; + name_help = OVP2OVFHELP; + name_program = "ovp2ovf"; + name_msg = "This is ovp2ovf, Version 2.0"; + no_files = 3; + files[0] = &name_ovp; + files[1] = &name_ovf; + files[2] = &name_ofm; + suffixes[0] = "ovp"; + suffixes[1] = "ovf"; + suffixes[2] = "ofm"; + full_suffixes[0] = ".ovp"; + full_suffixes[1] = ".ovf"; + full_suffixes[2] = ".ofm"; + } else if (!strcmp(name_program, "ovf2ovp") || + !strcmp(name_program, "OVF2OVP.EXE")) { + program = PROG_OVF2OVP; + name_help = OVF2OVPHELP; + name_program = "ovf2ovp"; + name_msg = "This is ovf2ovp, Version 2.0"; + no_files = 3; + files[0] = &name_ovf; + files[1] = &name_ofm; + files[2] = &name_ovp; + suffixes[0] = "ovf"; + suffixes[1] = "ofm"; + suffixes[2] = "ovp"; + full_suffixes[0] = ".ovf"; + full_suffixes[1] = ".ofm"; + full_suffixes[2] = ".ovp"; + } else { + fprintf(stderr , "Unrecognized program: %s\n", name_program); + fprintf(stderr , + "This binary supports ofm2opl, opl2ofm, ovf2ovp, and ovp2ovf\n"); + exit(1); + } + kpse_set_program_name(name_program, NULL); + kpse_init_prog(uppercasify(name_program), 0, nil, nil); + + do { + getopt_return_val = + getopt_long_only(argc, argv, "", long_options, &option_index) ; + if (getopt_return_val == -1) { ; } + else if ( getopt_return_val == 63 ) { + usage (name_program); + } else if (!strcmp(long_options[option_index].name, "help")) { + usagehelp (name_help, NULL); + } else if (!strcmp(long_options[option_index ].name, "version")) { + printversionandexit(name_msg, nil, + "J. Plaice, Y. Haralambous, D.E. Knuth"); + } else if (!strcmp(long_options[option_index ].name, "char-format")) { + if (!strcmp(optarg, "ascii")) char_format = CHAR_CODE_ASCII; + else if (!strcmp(optarg, "num")) char_format = CHAR_CODE_NUM; + else warning_s("Bad character code format (%s)", optarg); + } else if (!strcmp(long_options[option_index ].name, "num-format")) { + if (!strcmp(optarg, "hex")) num_format = NUM_CODE_HEX; + else if (!strcmp(optarg, "octal")) num_format = NUM_CODE_OCTAL; + else warning_s("Bad number code format (%s)", optarg); + } else if (!strcmp(long_options[option_index ].name, "text-format")) { + if (!strcmp(optarg, "upper")) text_format = TEXT_CODE_UPPER; + else if (!strcmp(optarg, "mixed")) text_format = TEXT_CODE_MIXED; + else warning_s("Bad text code format (%s)", optarg); + } + } while (getopt_return_val != -1); + if (((argc-optind) > no_files) || ((argc-optind) < 1)) { + fprintf(stderr , "%s: %s\n", name_program, + no_files == 2 ? "Need one or two file arguments." + : "Need one to three file arguments."); + usage (name_program); + } + *(files[0]) = extend_filename(cmdline(optind) , suffixes[0]); + if (optind+2 <= argc) { + *(files[1]) = extend_filename(cmdline(optind+1) , suffixes[1]); + if (no_files == 3) { + if (optind+3 <= argc) { + *(files[2]) = extend_filename(cmdline(optind+2) , suffixes[2]); + } else if (program == PROG_OVP2OVF) { + *(files[2]) = extend_filename(cmdline(optind+1), suffixes[2]); + } + } + } else if (program != PROG_OFM2OPL) { + *(files[1]) = basenamechangesuffix(*(files[0]), + full_suffixes[0], full_suffixes[1]); + if ((no_files == 3) && (program == PROG_OVP2OVF)) { + *(files[2]) = basenamechangesuffix(*(files[0]), + full_suffixes[0], full_suffixes[2]); + } + } + + switch(program) { + case PROG_OFM2OPL: { + file_ofm = kpse_open_file(name_ofm, kpse_ofm_format); + read_in_whole(&ofm, &length_ofm, file_ofm, name_ofm); + (void)fclose(file_ofm); + if (name_opl==NULL) file_opl = stdout; + else rewrite(file_opl, name_opl); + file_output = file_opl; + parse_ofm(FALSE); + break; + } + case PROG_OVF2OVP: { + file_ovf = kpse_open_file(name_ovf, kpse_ovf_format); + read_in_whole(&ovf, &length_ovf, file_ovf, name_ovf); + (void)fclose(file_ovf); + file_ofm = kpse_open_file(name_ofm, kpse_ofm_format); + read_in_whole(&ofm, &length_ofm, file_ofm, name_ofm); + (void)fclose(file_ofm); + if (name_ovp==NULL) file_ovp = stdout; + else rewrite(file_ovp, name_ovp); + file_output = file_ovp; + parse_ofm(TRUE); + break; + } + case PROG_OPL2OFM: { + file_opl = kpse_open_file(name_opl, kpse_opl_format); + rewritebin(file_ofm, name_ofm); + init_tables(); + yyin = file_opl; + (void)yyparse(); + output_ofm_file(); + (void)fclose(file_ofm); + break; + } + case PROG_OVP2OVF: { + file_ovp = kpse_open_file(name_ovp, kpse_ovp_format); + rewritebin(file_ovf, name_ovf); + rewritebin(file_ofm, name_ofm); + init_tables(); + yyin = file_ovp; + (void)yyparse(); + output_ofm_file(); + /*(void)fclose(file_ofm);*/ + output_ovf_file(); + (void)fclose(file_ovf); + break; + } + default: {exit(1);} + } + exit(0); +} + +#define BIG_BLOCK 0x20000 +#define LITTLE_BLOCK 0x1000 + +void +read_in_whole(unsigned char **contents_loc, + unsigned *length_loc, + FILE *file, + string name) +{ + unsigned no_read; + unsigned no_total_read = 0; + unsigned size = BIG_BLOCK; + string where; + string current_block; + + current_block = (char *) xmalloc(size); + where = current_block; + + while (1) { + no_read = fread(where, 1, LITTLE_BLOCK, file); + no_total_read += no_read; + if ((no_total_read+LITTLE_BLOCK) > size) { + size *= 2; + current_block = (char *) xrealloc(current_block, size); + } + where = current_block + no_total_read; + if (ferror(file)) { + fatal_error_s("Error while reading file %s", name); + } else if (feof(file)) { + break; + } + } + + *contents_loc = (unsigned char *) current_block; + *length_loc = no_total_read; +} + +void +init_tables(void) +{ + font_table_init(); /* subsidiary fonts in virtual fonts */ + init_header(); + init_planes(); + init_measures(); +} + +void +output_text_file(FILE *dest) +{ +} + diff --git a/Build/source/texk/web2c/omegafonts/omfonts.h b/Build/source/texk/web2c/omegafonts/omfonts.h new file mode 100644 index 00000000000..8889f501a41 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/omfonts.h @@ -0,0 +1,50 @@ +/* omfonts.h: Main routine for ofm2opl, opl2ofm, ovf2ovp, ovp2ovf. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#define CHAR_CODE_NUM 0 +#define CHAR_CODE_ASCII 1 +#define NUM_CODE_HEX 0 +#define NUM_CODE_OCTAL 1 +#define TEXT_CODE_UPPER 0 +#define TEXT_CODE_MIXED 1 + +extern FILE *file_ovf; +extern FILE *file_output; +extern int verbose_option; +extern int char_format; +extern int num_format; +extern int text_format; + +extern unsigned length_ofm; +extern unsigned length_ovf; + +extern unsigned char *ofm; +extern unsigned char *ovf; + +extern int main(int, string *); +extern void read_in_whole(unsigned char **, unsigned *, FILE *, string ); +extern void init_tables(void); +extern void output_ofm_file(void); +extern void output_ovf_file(void); +extern void output_text_file(FILE *); + diff --git a/Build/source/texk/web2c/omegafonts/out_ofm.c b/Build/source/texk/web2c/omegafonts/out_ofm.c new file mode 100644 index 00000000000..300b7c66c98 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/out_ofm.c @@ -0,0 +1,209 @@ +/* out_ofm.c: Outputting to an OFM file. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "header_routines.h" +#include "manifests.h" +#include "char_routines.h" +#include "ligkern_routines.h" +#include "out_ofm.h" +#include "extra_routines.h" +#include "param_routines.h" +#include "dimen_routines.h" +#include "error_routines.h" +#include "parse_ofm.h" + +void +output_ofm_file(void) +{ + check_and_correct(); + compute_ofm_character_info(); + compute_ofm_subsizes(); + output_ofm_subsizes(); + output_ofm_header(); + compute_ofm_extra_stuff(); + output_ofm_extra_stuff(); + output_ofm_character_info(); + output_ofm_dimension(); + output_ofm_ligkern(); + output_ofm_extensible(); + output_ofm_parameter(); +} + +extern unsigned header_ptr; +extern unsigned mw,mh,md,mi; + +void +compute_ofm_subsizes(void) +{ + switch(ofm_level) { + case OFM_TFM: { + lh = header_max + 1; + if (bc > ec) bc = 1; + if (ec>255) + fatal_error_1( + "Char (%x) too big for TFM (max ff); use OFM file",ec); + nw++; nh++; nd++; ni++; + compute_ligkern_offset(); + lf = 6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+lk_offset+nk+ne+np; + /*lf = 6+lh+(ec-bc+1)+nw+nh+nd+ni+nl-1+lk_offset+nk+ne+np;*/ + break; + } + case OFM_LEVEL0: { + lh = header_max + 1; + if (ec>65535) + fatal_error_1( + "Char (%x) too big for OFM level-0 (max ffff); use level-2", + ec); + if (bc > ec) bc = 1; + nw++; nh++; nd++; ni++; + compute_ligkern_offset(); + lf = 14+lh+2*(ec-bc+1)+nw+nh+nd+ni+2*(nl+lk_offset)+nk+2*ne+np; + break; + } + case OFM_LEVEL1: { + lh = header_max + 1; + if (ec>65535) + fatal_error_1( + "Char (%x) too big for OFM level-1 (max ffff); use level-2", + ec); + if (bc > ec) bc = 1; + nw++; nh++; nd++; ni++; + compute_ligkern_offset(); + lf = 29+lh+ncw+nw+nh+nd+ni+2*(nl+lk_offset)+nk+2*ne+np+ + nki+nwi+nkf+nwf+nkm+nwm+nkr+nwr+nkg+nwg+nkp+nwp; + nco = 29+lh+nki+nwi+nkf+nwf+nkm+nwm+nkr+nwr+nkg+nwg+nkp+nwp; + break; + } + default: { internal_error_0("output_ofm_subfiles"); } + } +} + +void +output_ofm_subsizes(void) +{ + switch(ofm_level) { + case OFM_TFM: { + out_ofm_2(lf); out_ofm_2(lh); out_ofm_2(bc); out_ofm_2(ec); + out_ofm_2(nw); out_ofm_2(nh); out_ofm_2(nd); out_ofm_2(ni); + out_ofm_2(nl+lk_offset); out_ofm_2(nk); + out_ofm_2(ne); out_ofm_2(np); + break; + } + case OFM_LEVEL0: { + out_ofm_4(0); + out_ofm_4(lf); out_ofm_4(lh); out_ofm_4(bc); out_ofm_4(ec); + out_ofm_4(nw); out_ofm_4(nh); out_ofm_4(nd); out_ofm_4(ni); + out_ofm_4(nl+lk_offset); out_ofm_4(nk); + out_ofm_4(ne); out_ofm_4(np); out_ofm_4(font_dir); + break; + } + case OFM_LEVEL1: { + out_ofm_4(1); + out_ofm_4(lf); out_ofm_4(lh); out_ofm_4(bc); out_ofm_4(ec); + out_ofm_4(nw); out_ofm_4(nh); out_ofm_4(nd); out_ofm_4(ni); + out_ofm_4(nl+lk_offset); out_ofm_4(nk); + out_ofm_4(ne); out_ofm_4(np); out_ofm_4(font_dir); + out_ofm_4(nco); out_ofm_4(ncw); out_ofm_4(npc); + out_ofm_4(nki); out_ofm_4(nwi); + out_ofm_4(nkf); out_ofm_4(nwf); + out_ofm_4(nkm); out_ofm_4(nwm); + out_ofm_4(nkr); out_ofm_4(nwr); + out_ofm_4(nkg); out_ofm_4(nwg); + out_ofm_4(nkp); out_ofm_4(nwp); + break; + } + default: { internal_error_0("output_ofm_subfiles"); } + } +} + +extern FILE *file_ofm; +unsigned file_ofm_count = 0; + +void +out_ofm(unsigned i) +{ + fputc(i,file_ofm); + file_ofm_count++; +} + +void +out_ofm_2(unsigned i) +{ + + fputc((i>>8)&0xff, file_ofm); + fputc(i&0xff, file_ofm); + file_ofm_count += 2; +} + +void +out_ofm_4(unsigned i) +{ + fputc((i>>24)&0xff, file_ofm); + fputc((i>>16)&0xff, file_ofm); + fputc((i>>8)&0xff, file_ofm); + fputc(i&0xff, file_ofm); + file_ofm_count += 4; +} + +void +out_ofm_char(unsigned i) +{ + if (ofm_level == OFM_NOLEVEL) { + internal_error_1("out_ofm_char.1 (ofm_level=%d)", ofm_level); + } + if (ofm_level == OFM_TFM) { + if (i>=0x100) internal_error_1("out_ofm_char.2 (i=%x)", i); + out_ofm(i); + } else { + if (i>=0x10000) internal_error_1("out_ofm_char.3 (i=%x)", i); + out_ofm_2(i); + } +} + +#define dabs(x) ((x)>=0?(x):-(x)) + +void +out_ofm_scaled(fix fval) +{ + if (dabs((double)fval/(double)design_units) >= 16.0) { + warning_2("The relative dimension %d is too large.\n" + "Must be less than 16*designsize = %d designunits", + fval/0x100000, design_units/0x10000); + fval = 0; + } + if (design_units != UNITY) { + fval = zround(((double)fval/(double)design_units) * 1048576.0); + } + if (fval < 0) { + out_ofm(255); fval = fval + 0x1000000; + if (fval <= 0) fval = 1; + } else { + out_ofm(0); + if (fval >= 0x1000000) fval = 0xffffff; + } + out_ofm((fval >> 16) & 0xff); + out_ofm((fval >> 8) & 0xff); + out_ofm(fval & 0xff); +} diff --git a/Build/source/texk/web2c/omegafonts/out_ofm.h b/Build/source/texk/web2c/omegafonts/out_ofm.h new file mode 100644 index 00000000000..3a519f79a4b --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/out_ofm.h @@ -0,0 +1,36 @@ +/* out_ofm.h: Outputting to an OFM file. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern void output_ofm_file(void); +extern void out_ofm_4(unsigned); +extern void out_ofm_2(unsigned); +extern void out_ofm_char(unsigned); +extern void out_ofm_scaled(fix); +extern void out_ofm(unsigned); + +extern void compute_ofm_subsizes(void); +extern void output_ofm_subsizes(void); +extern void output_ofm_header(void); +extern void output_ofm_extra_stuff(void); +extern void compute_ofm_character_info(void); +extern void output_ofm_character_info(void); diff --git a/Build/source/texk/web2c/omegafonts/out_routines.c b/Build/source/texk/web2c/omegafonts/out_routines.c new file mode 100644 index 00000000000..7282d607a40 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/out_routines.c @@ -0,0 +1,381 @@ +/* out_routines.c: Low-level routines for outputting OPL and OVP files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "manifests.h" +#include "omfonts.h" +#include "out_routines.h" +#include "error_routines.h" +#include "header_routines.h" +#include "char_routines.h" + +/* Character measures */ + +string character_measures[] = + { "CHARWD", "CHARHT", "CHARDP", "CHARIC", + "SECWD", "SECHT", "SECDP", "SECIC", + "PRIMTOPAXIS", "PRIMTOPAXISBIS", "PRIMBOTAXIS", "PRIMBOTAXISBIS", + "PRIMMIDHOR", "PRIMMIDVERT", "PRIMBASESLANT", NULL, + "SECTOPAXIS", "SECTOPAXISBIS", "SECBOTAXIS", "SECBOTAXISBIS", + "SECMIDHOR", "SECMIDVERT", "SECBASESLANT", NULL}; + +void +out_character_measure(unsigned measure) +{ + if ((measure < C_MIN) || (measure > C_MAX) || + (character_measures[measure]==NULL)) { + internal_error_1("out_character_measure (measure=%d)", measure); + } + out(character_measures[measure]); +} + +/* Extensible pieces */ + +string extensible_pieces[] = + { "TOP", "MID", "BOT", "REP", NULL }; + +void +out_extensible_piece(unsigned piece) +{ + if ((piece < E_MIN) || (piece > E_MAX)) { + internal_error_1("out_extensible_piece (piece=%d)", piece); + } + out(extensible_pieces[piece]); +} + +/* Ligature commands */ + +string ligature_commands[] = + { "LIG", "LIG/", "/LIG", "/LIG/", NULL, + "LIG/>", "/LIG>", "/LIG/>", NULL, NULL, + NULL, "/LIG/>>", NULL }; + +void +out_ligature_command(unsigned command) +{ + if ((command < L_MIN) || (command > L_MAX) || + (ligature_commands[command]==NULL)) { + internal_error_1("out_ligature_command (command=%d)", command); + } + out(ligature_commands[command]); +} + +/* Xerox faces */ + +string xerox_faces[] = + { "MRR", "MIR", "BRR", "BIR", "LRR", "LIR", + "MRC", "MIC", "BRC", "BIC", "LRC", "LIC", + "MRE", "MIE", "BRE", "BIE", "LRE", "LIE", NULL }; + +void +print_xerox_face(int face) +{ + if ((face < F_MIN) || (face > F_MAX)) { + internal_error_1("print_xerox_face (face=%d)", face); + } + out("F "); out(xerox_faces[face]); +} + +/* Named parameters */ + +string named_parameters[] = + { NULL, "SLANT", "SPACE", "STRETCH", "SHRINK", "XHEIGHT", + "QUAD", "EXTRASPACE", NULL }; + +void +out_named_parameter(unsigned parameter) +{ + if ((parameter < P_MIN) || (parameter > P_MAX)) { + internal_error_1("out_named_parameter (parameter = %d)", parameter); + } + out(named_parameters[parameter]); +} + +/* Named math symbol parameters */ + +string named_mathsy_parameters[] = + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "NUM1", "NUM2", "NUM3", "DENOM1", + "DENOM2", "SUP1", "SUP2", "SUP3", "SUB1", "SUB2", + "SUPDROP", "SUBDROP", "DELIM1", "DELIM2", "AXISHEIGHT", NULL }; + +void +out_named_mathsy_parameter(unsigned parameter) +{ + if ((parameter < P_MATHSY_MIN) || (parameter > P_MATHSY_MAX) || + (named_mathsy_parameters[parameter]==NULL)) { + internal_error_1("out_named_mathsy_parameter (parameter=%d)",parameter); + } + out(named_mathsy_parameters[parameter]); +} + +/* Named math extension parameters */ + +string named_mathex_parameters[] = + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "DEFAULTRULETHICKNESS", "BIGOPSPACING1", + "BIGOPSPACING2", "BIGOPSPACING3", + "BIGOPSPACING4", "BIGOPSPACING5", NULL }; + +void +out_named_mathex_parameter(unsigned parameter) +{ + if ((parameter < P_MATHEX_MIN) || (parameter > P_MATHEX_MAX) || + (named_mathex_parameters[parameter]==NULL)) { + internal_error_1("out_named_mathex_parameter (parameter=%d)",parameter); + } + out(named_mathex_parameters[parameter]); +} + +/* Typesetting directions */ + +string type_directions[] = + { "FONTDIR", "NATURALFONTDIR", NULL }; + +string actual_directions[] = + { "TL", "LT", "TR", "RT", "LB", "BL", "BR", "RB", NULL }; + +void +out_type_direction(unsigned direction) +{ + if ((direction < DIR_MIN) || (direction > DIR_MAX)) { + internal_error_1("out_type_direction (direction=%d)", direction); + } + out(type_directions[direction/8]); out(" "); + out(actual_directions[direction%8]); +} + +/* Kinds of accents */ + +string accent_kinds[] = + { NULL, "TOPACCENT", "MIDACCENT", "BOTACCENT", NULL }; + +void +out_accent_kind(unsigned kind) +{ + if ((kind < ACC_TOP) || (kind > ACC_BOT)) { + internal_error_1("out_accent_kind (kind=%d)", kind); + } + out(accent_kinds[kind]); +} + +/* Move directions */ + +string move_directions[] = + { "MOVERIGHT", "MOVELEFT", "MOVEUP", "MOVEDOWN", NULL }; + +void +out_move_direction(unsigned direction) +{ + if ((direction < M_MIN) || (direction > M_MAX)) { + internal_error_1("out_move_direction (direction=%d)", direction); + } + out(move_directions[direction]); +} + +/* Rule measures */ + +string rule_measures[] = + { "RULEWD", "RULEHT", "RULEDP", NULL }; + +void +out_rule_measure(unsigned measure) +{ + if ((measure < RULE_MIN) || (measure > RULE_MAX)) { + internal_error_1("out_rule_measure (measure=%d)", measure); + } + out(rule_measures[measure]); +} + +/* Glue shrink or stretch */ + +string glue_shrink_stretch[] = + { "GLUESHRINK", "GLUESTRETCH", NULL }; + +void +out_shrink_stretch(unsigned shrink_stretch) +{ + if ((shrink_stretch < GLUE_MIN) || (shrink_stretch > GLUE_MAX)) { + internal_error_1("out_shrink_stretch (shrink_stretch=%d)", + shrink_stretch); + } + out(glue_shrink_stretch[shrink_stretch]); +} + +/* Glue orders */ + +string glue_orders[] = + { "UNIT", "FI", "FIL", "FILL", "FILLL", NULL }; + +void +out_glue_order(unsigned order) +{ + if ((order < O_MIN) || (order > O_MAX)) { + internal_error_1("out_glue_order (order=%d)", order); + } + out(glue_orders[order]); +} + +/* Glue kinds */ + +string glue_kinds[] = + { "NORMAL", "ALEADERS", "CLEADERS", "ALEADERS", "XLEADERS", NULL }; + +void +out_glue_kind(unsigned kind) +{ + if ((kind < K_MIN) || (kind > K_MAX)) { + internal_error_1("out_glue_kind (kind=%d)", kind); + } + out(glue_kinds[kind]); +} + +unsigned parenthesis_level=0; +unsigned digits[12]; + +/* Basic routines used by everyone */ + +void +out_ln(void) +{ + unsigned i; + out("\n"); + for (i = 0; i < parenthesis_level; i++) out(" "); +} + +void +left(void) +{ + parenthesis_level++; out("("); +} + +void +right(void) +{ + if (parenthesis_level==0) internal_error_0("right"); + parenthesis_level--; out(")"); out_ln(); +} + +void +out_char(unsigned val) +{ + if (char_format==CHAR_CODE_NUM) out_num(val); + else if (font_type!=FT_VANILLA) out_num(val); + else if (((val>='0') && (val<='9')) || + ((val>='A') && (val<='Z')) || + ((val>='a') && (val<='z'))) + fprintf(file_output, "C %c", val); + else out_num(val); +} + +void +out_num(unsigned val) +{ + if (num_format==NUM_CODE_OCTAL) out_int(val, 8); + else out_int(val, 16); +} + +void +out_int(unsigned val, unsigned base) +{ + register unsigned j=0, acc=val; + if (val < 0) internal_error_1("out_int (val=%d)", val); + if (base==16) out("H "); + else if (base==10) out("D "); + else if (base==8) out("O "); + else internal_error_1("out_int (base=%d)", base); + do { + digits[j] = acc % base; + j++; + acc = acc / base; + } while (acc > 0); +/* + if ((base==16) && (ec>=0x100)) { + while (j<4) { digits[j] = 0; j++; } + } +*/ + out_digits(j); +} + +void +out_as_fix(fix fval) +{ + register fix x=0; + + if (fval<0) { + x = 0xff000000; + fval = fval + 0x1000000; + } + x = x | (fval & 0xff); + fval = fval % 0x100; + x = x | ((fval & 0xff) << 8); + fval = fval % 0x100; + x = x | ((fval & 0xff) << 16); + out_fix(x); +} + +void +out_fix(fix fval) +{ + register int a = (fval & 0xfff00000) >> 20, f = fval & 0xfffff, j=0; + register int delta; + + out("R "); + if (a>0x7ff) { + out("-"); a = 0x1000 - a; + if (f>0) { + f = 0x100000 - f; a--; + } + } + do { + digits[j] = a % 10; + j++; + a = a / 10; + } while (a > 0); + out_digits(j); + out("."); + f = 10*f + 5; delta = 10; + do { + if (delta>0x100000) f = f + 0x80000 - (delta / 2); + fprintf(file_output, "%c", (f / 0x100000) + '0'); + f = 10 * (f % 0x100000); delta = delta*10; + } while (f>delta); +} + +void +out_digits(unsigned counter) +{ + register unsigned j=counter, c; + while (j>0) { + c = digits[--j]; + if (c<10) fprintf(file_output, "%c", c+'0'); + else fprintf(file_output, "%c", c+'A'-10); + } +} + +void +out(string sval) +{ + fprintf(file_output, sval); +} diff --git a/Build/source/texk/web2c/omegafonts/out_routines.h b/Build/source/texk/web2c/omegafonts/out_routines.h new file mode 100644 index 00000000000..ff4f0a85869 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/out_routines.h @@ -0,0 +1,50 @@ +/* out_routines.h: Low-level routines for outputting OPL and OVP files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern string extensible_pieces[]; +extern string ligature_commands[]; + +extern void out_character_measure(unsigned); +extern void out_extensible_piece(unsigned); +extern void out_ligature_command(unsigned); +extern void out_named_parameter(unsigned); +extern void out_named_mathsy_parameter(unsigned); +extern void out_named_mathex_parameter(unsigned); +extern void out_move_direction(unsigned); +extern void out_glue_order(unsigned); +extern void out_glue_kind(unsigned); +extern void out_ln(void); +extern void out_char(unsigned); +extern void out_num(unsigned); +extern void out_int(unsigned,unsigned); +extern void out_as_fix(fix); +extern void out_fix(fix); +extern void out_digits(unsigned); +extern void out(string); +extern void right(void); +extern void left(void); +extern void print_xerox_face(int); +extern void out_rule_measure(unsigned); +extern void out_shrink_stretch(unsigned); +extern void out_type_direction(unsigned); +extern void out_accent_kind(unsigned); diff --git a/Build/source/texk/web2c/omegafonts/param_routines.c b/Build/source/texk/web2c/omegafonts/param_routines.c new file mode 100644 index 00000000000..959d4019d98 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/param_routines.c @@ -0,0 +1,154 @@ +/* param_routines.c: Data structures for parameter lists. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "manifests.h" +#include "header_routines.h" +#include "param_routines.h" +#include "print_routines.h" +#include "out_routines.h" +#include "error_routines.h" +#include "out_ofm.h" + +#define PARAM_MIN 1 + +av_list param_list = NULL; +int param_max = PARAM_MIN-1; +int param_started = FALSE; + +unsigned np=0; + +void +init_parameters(void) +{ + if (param_started==TRUE) + warning_0("FONTDIMEN previously defined; all old parameters ignored"); + if (param_list!=NULL) { + av_list L1 = param_list, L2; + while (L1 != NULL) { + L2 = L1->ptr; + free(L1); + L1 = L2; + } + } + param_list = NULL; + param_max = PARAM_MIN-1; + np=param_max; + param_started = TRUE; +} + +void +set_param_word(int index, int val) +{ + av_list L1, L2; + + if (index < PARAM_MIN) { + warning_0("PARAMETER index must be at least 1; ignored"); + return; + } + L1 = param_list; + if (L1 == NULL) { + param_list = av_list1(index, val); + param_max = index; + np=param_max; + } else { + L2 = L1->ptr; + while ((L2 != NULL) && (lattr(L2) <= index)) { + L1 = L2; + L2 = L2->ptr; + } + if (index < lattr(L1)) { + param_list = av_list1(index, val); + param_list->ptr = L1; + } else if (index == lattr(L1)) { + warning_1("PARAMETER index (%d) previously defined; " + "old value ignored", index); + lval(L1) = val; + } else { + if (L2==NULL) {param_max=index; np=param_max;} + L2 = av_list1(index, val); + L2->ptr = L1->ptr; + L1->ptr = L2; + } + } +} + +void +retrieve_parameters(unsigned char *table) +{ + int value; + unsigned i; + unsigned np_prime = np; + + param_list = NULL; + for (i=1; i<=np_prime; i++) { + value = ((table[4*i] & 0xff) << 24) | + ((table[4*i+1] & 0xff) << 16) | + ((table[4*i+2] & 0xff) << 8) | + (table[4*i+3] & 0xff); + if ((i<=7) | (value != 0)) { + set_param_word(i, value); + } + } + np = np_prime; +} + +void +print_parameters(void) +{ + av_list L = param_list; + + print_font_dimension(); + while (L != NULL) { + print_parameter(lattr(L), lval(L)); + L = L->ptr; + } + right(); +} + + +void +output_ofm_parameter(void) +{ + unsigned i=1, j; + + av_list L = param_list; + + while(L != NULL) { + j=lattr(L); + while (i<j) { + output_ofm_one_parameter(i, 0); + i++; + } + output_ofm_one_parameter(i, lval(L)); + L = L->ptr; i++; + } +} + +void +output_ofm_one_parameter(unsigned i, fix param) +{ + if (i==P_SLANT) out_ofm_4(param); + else out_ofm_scaled(param); +} diff --git a/Build/source/texk/web2c/omegafonts/param_routines.h b/Build/source/texk/web2c/omegafonts/param_routines.h new file mode 100644 index 00000000000..a3025d7c7ec --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/param_routines.h @@ -0,0 +1,30 @@ +/* param_routines.h: Data structures for parameter lists. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ +extern void init_parameters(void); +extern void set_param_word(int, int); +extern void retrieve_parameters(unsigned char *); +extern void print_parameters(void); +extern void output_ofm_parameter(void); +extern void output_ofm_one_parameter(unsigned, fix); + +extern unsigned np; diff --git a/Build/source/texk/web2c/omegafonts/parse_ofm.c b/Build/source/texk/web2c/omegafonts/parse_ofm.c new file mode 100644 index 00000000000..9dc839d382d --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/parse_ofm.c @@ -0,0 +1,594 @@ +/* parse_ofm.h: Checking an existent OFM file + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "header_routines.h" +#include "manifests.h" +#include "char_routines.h" +#include "ligkern_routines.h" +#include "out_ofm.h" +#include "extra_routines.h" +#include "param_routines.h" +#include "dimen_routines.h" +#include "error_routines.h" +#include "print_routines.h" +#include "out_routines.h" +#include "font_routines.h" +#include "parse_ofm.h" +#include "omfonts.h" +#include "manifests.h" + +unsigned top_char, top_width, top_height, top_depth, top_italic; +unsigned start_ptr, check_sum_pos, design_size_pos, scheme_pos; +unsigned seven_bit_flag_pos; +unsigned random_word_pos, header_length; + +unsigned ivalues_start,fvalues_start,mvalues_start, + rules_start,glues_start,penalties_start; +unsigned ivalues_base,fvalues_base,mvalues_base, + rules_base,glues_base,penalties_base; +unsigned char_base,width_base,height_base,depth_base,italic_base; +unsigned lig_kern_base,kern_base,exten_base,param_base; + /* base addresses for the subfiles */ +unsigned char_start; +unsigned bytes_per_entry; + +unsigned lf; +boolean ofm_on; +unsigned start_pos; +unsigned family_pos; +unsigned ofm_ptr; +unsigned ncw; +unsigned ncl; +unsigned nce; +unsigned nco; +unsigned npc; + +void +eval_two_bytes(unsigned *pos) { + if (ofm[ofm_ptr]>127) + fatal_error_0("One of the subfile sizes (2) is negative"); + *pos = ofm[ofm_ptr]*0x100 + ofm[ofm_ptr+1]; + ofm_ptr += 2; +} + +void +eval_four_bytes(unsigned *pos) { + if (ofm[ofm_ptr]>127) + fatal_error_0("One of the subfile sizes (4) is negative"); + *pos = ofm[ofm_ptr]*0x1000000 + ofm[ofm_ptr+1]*0x10000 + + ofm[ofm_ptr+2]*0x100 + ofm[ofm_ptr+3]; + ofm_ptr += 4; +} + +void +parse_ofm(boolean read_ovf) +{ + ofm_organize(); + if (read_ovf == TRUE) input_ovf_file(); + ofm_read_simple(); + if (read_ovf == TRUE) input_ovf_fonts(); + ofm_read_rest(); + if (read_ovf == TRUE) input_ovf_chars(); + print_characters(read_ovf); +} + +/* parse_ofm ensures that all of the header entries are consistent. + The file is assumed to have been read in already, with the + contents in the ofm array (length_ofm bytes). +*/ + +void +ofm_organize(void) +{ + unsigned char_ptr,copies,i,j; + + ofm_on = false; ofm_level = OFM_NOLEVEL; lf = 0; lh = 0; + nco = 0; ncw = 0; npc = 0; + bc = 0; ec = 0; nw = 0; nh = 0; nd = 0; ni = 0; + nl = 0; nk = 0; ne = 0; np = 0; + nki = 0; nwi = 0; nkf = 0; nwf = 0; + nkm = 0; nwm = 0; + nkr = 0; nwr = 0; nkg = 0; nwg = 0; + nkp = 0; nwp = 0; font_dir = 0; + + if (length_ofm < 8) + fatal_error_0("File too short"); + lf = ofm[0]*256 + ofm[1]; + if (lf==0) { /* This is not a TFM file, it is an OFM-file */ + ofm_on = TRUE; + + /* next line edited by Thomas Esser, based on a patch send + * by Hossein Movahhedian. The old code had " + 1" + * instead of "+ 2" and caused lots of segfaults */ + ofm_level = ofm[2]*0x100 + ofm[3] + 2; + if (ofm[4]>127) + fatal_error_0("File length is negative"); + lf = ofm[4]*0x1000000 + ofm[5]*0x10000 + ofm[6]*0x100 + ofm[7]; + } else { + ofm_on = FALSE; + ofm_level = OFM_TFM; + } + if ((lf*4)!=length_ofm) + fatal_error_2("Stated (%d) and actual (%d) file length do not match", + lf*4, length_ofm); + + switch(ofm_level) { + case OFM_TFM: { start_pos = 2; check_sum_pos = 24; break; } + case OFM_LEVEL0: { start_pos = 8; check_sum_pos = 56; break; } + case OFM_LEVEL1: { start_pos = 8; check_sum_pos = 116; break; } + default: { fatal_error_1("OFMLEVEL %d not supported", ofm_level-1); + break; } + } + design_size_pos = check_sum_pos+4; + scheme_pos = design_size_pos+4; + family_pos = scheme_pos+40; + random_word_pos = family_pos+20; + + ofm_ptr = start_pos; + + if (ofm_on==FALSE) { + eval_two_bytes(&lh); + eval_two_bytes(&bc); + eval_two_bytes(&ec); + eval_two_bytes(&nw); + eval_two_bytes(&nh); + eval_two_bytes(&nd); + eval_two_bytes(&ni); + eval_two_bytes(&nl); + eval_two_bytes(&nk); + eval_two_bytes(&ne); + eval_two_bytes(&np); + ncw = (ec-bc+1); + ncl = nl; + nce = ne; + header_length = 6; + top_char = 255; + top_width = 255; + top_height = 15; + top_depth = 15; + top_italic = 63; + } else { + eval_four_bytes(&lh); + eval_four_bytes(&bc); + eval_four_bytes(&ec); + eval_four_bytes(&nw); + eval_four_bytes(&nh); + eval_four_bytes(&nd); + eval_four_bytes(&ni); + eval_four_bytes(&nl); + eval_four_bytes(&nk); + eval_four_bytes(&ne); + eval_four_bytes(&np); + eval_four_bytes(&font_dir); + top_char = 65535; + top_width = 65535; + top_height = 255; + top_depth = 255; + top_italic = 255; + ncl = nl*2; + nce = ne*2; + if (ofm_level==OFM_LEVEL0) { + header_length = 14; + ncw = 2*(ec-bc+1); + } else { + header_length = 29; + eval_four_bytes(&nco); + eval_four_bytes(&ncw); + eval_four_bytes(&npc); + eval_four_bytes(&nki); /* Kinds of font ivalues */ + eval_four_bytes(&nwi); /* Words of font ivalues */ + eval_four_bytes(&nkf); /* Kinds of font fvalues */ + eval_four_bytes(&nwf); /* Words of font fvalues */ + eval_four_bytes(&nkm); /* Kinds of font mvalues */ + eval_four_bytes(&nwm); /* Words of font mvalues */ + eval_four_bytes(&nkr); /* Kinds of font rules */ + eval_four_bytes(&nwr); /* Words of font rules */ + eval_four_bytes(&nkg); /* Kinds of font glues */ + eval_four_bytes(&nwg); /* Words of font glues */ + eval_four_bytes(&nkp); /* Kinds of font penalties */ + eval_four_bytes(&nwp); /* Words of font penalties */ + } + } + if (lf != (header_length+lh+ncw+nw+nh+nd+ni+ncl+nk+nce+np+ + nki+nwi+nkf+nwf+nkm+nwm+nkr+nwr+nkg+nwg+nkp+nwp)) + fatal_error_0("Subfile sizes do not add up to the stated total"); + if (lh < 2) + fatal_error_1("The header length is only %d", lh); + if ((bc > (ec+1)) || (ec > top_char)) + fatal_error_2("The character code range %d .. %d is illegal", bc, ec); + if ((nw==0) || (nh==0) || (nd==0) || (ni==0)) + fatal_error_0("Incomplete subfiles for character dimensions"); + ivalues_start = header_length+lh; + fvalues_start = ivalues_start+nki; + mvalues_start = fvalues_start+nkf; + rules_start = mvalues_start+nkm; + glues_start = rules_start+nkr; + penalties_start = glues_start+nkg; + ivalues_base = penalties_start+nkp; + fvalues_base = ivalues_base+nwi; + mvalues_base = fvalues_base+nwf; + rules_base = mvalues_base+nwm; + glues_base = rules_base+nwr; + penalties_base = glues_base+nwg; + char_base = penalties_base+nwp; + bytes_per_entry = (12 + 2*npc) / 4 * 4; + init_planes(); + no_labels = 0; + switch (ofm_level) { + case OFM_TFM: { + for(i=bc; i<=ec; i++) { + init_character(i,NULL); + char_start = 4*char_base+4*(i-bc); + current_character->index_indices[C_WD] = + ofm[char_start] & 0xff; + current_character->index_indices[C_HT] = + (ofm[char_start+1] & 0xf0) >> 4; + current_character->index_indices[C_DP] = + ofm[char_start+1] & 0xf; + current_character->index_indices[C_IC] = + (ofm[char_start+2] & 0xfc) >> 2; + current_character->tag = + ofm[char_start+2] & 0x3; + if (current_character->tag == TAG_LIG) no_labels++; + current_character->remainder = + ofm[char_start+3] & 0xff; + } + break; + } + case OFM_LEVEL0: { + for(i=bc; i<=ec; i++) { + init_character(i,NULL); + char_start = 4*char_base+8*(i-bc); + current_character->index_indices[C_WD] = + ((ofm[char_start] & 0xff) << 8) | + (ofm[char_start+1] & 0xff); + current_character->index_indices[C_HT] = + ofm[char_start+2] & 0xff; + current_character->index_indices[C_DP] = + ofm[char_start+3] & 0xff; + current_character->index_indices[C_IC] = + ofm[char_start+4] & 0xff; + current_character->tag = + ofm[char_start+5] & 0x3; + if (current_character->tag == TAG_LIG) no_labels++; + current_character->remainder = + ((ofm[char_start+6] & 0xff) << 8) | + (ofm[char_start+7] & 0xff); + } + break; + } + case OFM_LEVEL1: { + char_ptr = 4*char_base; + i = bc; + while (i<=ec) { + init_character(i,NULL); + copies = 1+256*ofm[char_ptr+8]+ofm[char_ptr+9]; + for (j=1; j<=copies; j++) { + char_start = char_ptr; + i++; + } + char_ptr = char_ptr + bytes_per_entry; + } + if (char_ptr != (4*(char_base+ncw))) + fatal_error_0("Length of char info table does not " + "correspond to specification"); + break; + } + default: { + fatal_error_1("Inappropriate font level (%d)", ofm_level-1); + } + } + width_base = char_base+ncw; + height_base = width_base+nw; + depth_base = height_base+nh; + italic_base = depth_base+nd; + lig_kern_base = italic_base+ni; + if (ofm_level==OFM_TFM) { + kern_base = lig_kern_base+nl; + } else { + kern_base = lig_kern_base+2*nl; + } + exten_base = kern_base+nk; + if (ofm_level==OFM_TFM) { + param_base = exten_base+ne-1; + } else { + param_base = exten_base+2*ne-1; + } +} + +void +ofm_read_simple(void) +{ + + if (ofm_on==TRUE) { + print_ofm_level(ofm_level-1); + print_font_dir(font_dir); + } + header = (char *) ofm+check_sum_pos; + retrieve_header(); + print_family(); + print_face(); + print_coding_scheme(); + print_design_size(); + out("(COMMENT DESIGNSIZE IS IN POINTS)"); out_ln(); + out("(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)"); out_ln(); + print_check_sum(); + if ((seven_bit == TRUE) || (ofm_level != OFM_TFM)) + print_seven_bit_safe_flag(); + retrieve_parameters(ofm+(4*param_base)); + print_parameters(); +} + +void +ofm_read_rest(void) +{ + retrieve_dimen_tables(); + if (verbose_option==TRUE) print_dimen_tables(); + retrieve_ligkern_table(ofm+(4*lig_kern_base), ofm+(4*kern_base)); + adjust_labels(FALSE); + if (verbose_option==TRUE) print_labels(); + print_ligkern_table(); + retrieve_exten_table(ofm+(4*exten_base)); + if (verbose_option==TRUE) print_extens(); +} + +/* +@ Once the input data successfully passes these basic checks, +\.{TFtoPL} believes that it is a \.{TFM} file, and the conversion +to \.{PL} format will take place. Access to the various subfiles +is facilitated by computing the following base addresses. For example, +the |char_info| for character |c| in a \.{TFM} file will start in location +|4*(char_base+c)| of the |tfm| array. + +@<Globals...@>= + +@ Of course we want to define macros that suppress the detail of how the +font information is actually encoded. Each word will be referred to by +the |tfm| index of its first byte. For example, if |c| is a character +code between |bc| and |ec|, then |tfm[char_info(c)]| will be the +first byte of its |char_info|, i.e., the |width_index|; furthermore +|width(c)| will point to the |fix_word| for |c|'s width. +*/ + +#if 0 +#define char_info(c) char_start[c] +#define nonexistent(c) ((c<bc)or(c>ec)or(width_index(c)=0)) +#define width(c) 4*(width_base+width_index(c)) +#define height(c) 4*(height_base+height_index(c)) +#define depth(c) 4*(depth_base+depth_index(c)) +#define italic(c) 4*(italic_base+italic_index(c)) +#define kern(i) 4*(kern_base+i) /* i is an index, not a char */ +#define param(i) 4*(param_base+i) /* likewise */ +#endif + +/* +unsigned +width_index(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[char_info(c)]; +else + return 256*ofm[char_info(c)]+ofm[char_info(c)+1]; +} + +unsigned +height_index(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[char_info(c)+1] / 16; +else + return ofm[char_info(c)+2]; +} + +unsigned +depth_index(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[char_info(c)+1] % 16; +else + return ofm[char_info(c)+3]; +} + +unsigned +italic_index(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[char_info(c)+2] / 4; +else if (ofm_level == OFM_TFM) + return ofm[char_info(c)+4]*64 + ofm[char_info(c)+5] / 4; +else + return ofm[char_info(c)+4]; +} + +unsigned +tag(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[char_info(c)+2] % 4; +else + return ofm[char_info(c)+5] % 4; +} + +void +set_no_tag(unsigned c) +{ +if (ofm_on==FALSE) + ofm[char_info(c)+2] = (ofm[char_info(c)+2] / 64)*64 + TAG_NONE; +else + ofm[char_info(c)+5] = (ofm[char_info(c)+5] / 64)*64 + TAG_NONE; +} + +boolean +ctag(unsigned c) +{ +if (ofm_level != OFM_LEVEL1) + return FALSE; +else + return ofm[char_info(c)+5] / 4 % 2; +} + +void +set_no_ctag(unsigned c) +{ +if (ofm_level != OFM_LEVEL1) + ofm[char_info(c)+5] = + ofm[char_info(c)+5] / 8 * 8 + ofm[char_info(c)+5] % 4; +} + +unsigned +no_repeats(unsigned c) +{ +if (ofm_level == OFM_NOLEVEL) + return 0; +else + return 256*ofm[char_info(c)+8]+ofm[char_info(c)+9]; +} + +unsigned +char_param(unsigned c, unsigned i) +{ + return 256*ofm[char_info(c)+2*i+10]+ofm[char_info(c)+2*i+11]; +} + +unsigned +rremainder(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[char_info(c)+3]; +else + return 256*ofm[char_info(c)+6]+ofm[char_info(c)+7]; +} + +unsigned +lig_step(unsigned c) +{ +if (ofm_on==FALSE) + return 4*(lig_kern_base+c); +else + return 4*(lig_kern_base+2*c); +} + +unsigned +exten(unsigned c) +{ +if (ofm_on==FALSE) + return 4*(exten_base+rremainder(c)); +else + return 4*(exten_base+2*rremainder(c)); +} + +unsigned +l_skip_byte(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[c]; +else + return 256*ofm[c]+ofm[c+1]; +} + +void +set_l_skip_byte(unsigned c, unsigned newc) +{ +if (ofm_on==FALSE) + ofm[c] = newc; +else { + ofm[c] = newc / 256; + ofm[c+1] = newc % 256; +} +} + +unsigned +l_next_char(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[c+1]; +else + return 256*ofm[c+2]+ofm[c+3]; +} + +void +set_l_next_char(unsigned c, unsigned newc) +{ +if (ofm_on==FALSE) + ofm[c+1] = newc; +else { + ofm[c+2] = newc / 256; + ofm[c+3] = newc % 256; +} +} + +unsigned +l_op_byte(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[c+2]; +else + return 256*ofm[c+4]+ofm[c+5]; +} + +void +set_l_op_byte(unsigned c, unsigned newc) +{ +if (ofm_on==FALSE) + ofm[c+2] = newc; +else { + ofm[c+2] = newc / 256; + ofm[c+3] = newc % 256; +} +} + +unsigned +l_remainder(unsigned c) +{ +if (ofm_on==FALSE) + return ofm[c+3]; +else + return 256*ofm[c+6]+ofm[c+7]; +} + +void +set_l_remainder(unsigned c, unsigned newc) +{ +if (ofm_on==FALSE) + ofm[c+3] = newc; +else { + ofm[c+6] = newc / 256; + ofm[c+7] = newc % 256; +} +} + +unsigned +ofm_get_4(unsigned c) +{ + return (ofm[c]<<24) | (ofm[c+1]<<16) | (ofm[c+2]<<8) | ofm[c+3]; +} + +unsigned +ofm_get_1(unsigned c) +{ + return ofm[c]; +} + +*/ diff --git a/Build/source/texk/web2c/omegafonts/parse_ofm.h b/Build/source/texk/web2c/omegafonts/parse_ofm.h new file mode 100644 index 00000000000..de4d275cc33 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/parse_ofm.h @@ -0,0 +1,58 @@ +/* parse_ofm.h: Checking an existent OFM file + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern unsigned char_base,width_base,height_base,depth_base,italic_base; +extern unsigned npc,nco,ncw,lf; + +extern void parse_ofm(boolean); +extern void ofm_organize(void); +extern void ofm_read_simple(void); +extern void ofm_read_rest(void); + +extern void eval_two_bytes(unsigned *); +extern void eval_four_bytes(unsigned *); + +extern unsigned width_index(unsigned); +extern unsigned height_index(unsigned); +extern unsigned depth_index(unsigned); +extern unsigned italic_index(unsigned); +extern unsigned tag(unsigned); +extern void set_no_tag(unsigned); +extern boolean ctag(unsigned); +extern void set_no_ctag(unsigned); +extern unsigned no_repeats(unsigned); +extern unsigned char_param(unsigned, unsigned); +extern unsigned rremainder(unsigned); +extern unsigned lig_step(unsigned); +extern unsigned exten(unsigned); +extern unsigned l_skip_byte(unsigned); +extern void set_l_skip_byte(unsigned, unsigned); +extern unsigned l_next_char(unsigned); +extern void set_l_next_char(unsigned, unsigned); +extern unsigned l_op_byte(unsigned); +extern void set_l_op_byte(unsigned, unsigned); +extern unsigned l_remainder(unsigned); +extern void set_l_remainder(unsigned, unsigned); + +extern unsigned ofm_get_4(unsigned); +extern unsigned ofm_get_1(unsigned); diff --git a/Build/source/texk/web2c/omegafonts/parser.h b/Build/source/texk/web2c/omegafonts/parser.h new file mode 100644 index 00000000000..c5ff2cae708 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/parser.h @@ -0,0 +1,35 @@ +/* parser.h: Definitions for the property lists parser. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#define YYSTYPE yystype +typedef union { + unsigned yint; + int yfix; + char *ystring ; +} yystype; + +extern YYSTYPE yylval; +extern int line_number; +extern FILE *yyin; +extern int yylex(void); +extern int yyparse(void); diff --git a/Build/source/texk/web2c/omegafonts/pl.l b/Build/source/texk/web2c/omegafonts/pl.l new file mode 100644 index 00000000000..beed1ace77f --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/pl.l @@ -0,0 +1,482 @@ +%{ +/* pl.l: Lexical analysis of property list files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous +Copyright (c) 2002 Roozbeh Pournader + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include <string.h> +#ifdef WIN32 +#include <win32lib.h> +#endif +#include "parser.h" +#include "kpathsea/types.h" +#include "y_tab.h" +#include "manifests.h" +#include "error_routines.h" +#ifdef __cplusplus +#define yyinput input +#endif + +int line_number = 1; +extern YYSTYPE yylval; + +/* POTENTIAL BUG: saved_text could be run over; should check */ +#define MAX_PTR 10000 +char saved_text[MAX_PTR]; + +extern void scan_int(unsigned); +extern void scan_char(void); +extern void scan_fix(void); +extern void scan_string(char *, unsigned, unsigned); +extern void scan_hex_string(); + +/* from kpathsea, but avoid including kpathsea header files */ +extern char *xstrdup (const char *); + +#define KEEP_MIN 0 +#define KEEP_NONE 0 +#define KEEP_ALL 1 +#define KEEP_CONVERT 2 +#define KEEP_MAX 2 + +#define BASE_MIN 2 +#define BASE_MAX 16 + +%} + +/* For Solaris's lex, to increase tables sizes --RP */ +/* Space before number keeps ancient flex happy. */ +%e 4000 +%p 7000 +%n 1000 + +ws [ \t]+ +hexnumber H{ws}[A-F0-9]+ +octnumber O{ws}[0-7]+ +decnumber D{ws}[0-9]+ +realnumber R[ \t+-]+[0-9]*("."[0-9]*){0,1} +charnumber C{ws}. +hexstring ([A-F0-9][A-F0-9])* + +%% + +{ws} {} +\n {line_number++; } + +"(" return(LEFT); +")" return(RIGHT); + +{octnumber} {scan_int(8); return(NUMBER); } +{decnumber} {scan_int(10); return(NUMBER); } +{hexnumber} {scan_int(16); return(NUMBER); } +{charnumber} {scan_char(); return(NUMBER); } +{realnumber} {scan_fix(); return(FIX); } + +CODINGSCHEME {scan_string("CODINGSCHEME", KEEP_CONVERT, LEN_CODING_SCHEME); + return(CODINGSCHEME); } +FAMILY {scan_string("FAMILY", KEEP_CONVERT, LEN_FAMILY); + return(FAMILY); } +VTITLE {scan_string("VTITLE", KEEP_ALL, LEN_VTITLE); + return(VTITLE); } +FONTNAME {scan_string("FONTNAME", KEEP_ALL, LEN_FONT_NAME); + return(FONTNAME); } +FONTAREA {scan_string("FONTAREA", KEEP_ALL, LEN_FONT_AREA); + return(FONTAREA); } +SPECIAL {scan_string("SPECIAL", KEEP_ALL, 0); + return(SPECIAL); } +COMMENT {scan_string("COMMENT", KEEP_NONE, 0); + return(COMMENT); } + +SPECIALHEX{ws}{hexstring} {scan_hex_string(); return(SPECIALHEX); } + + +SEVENBITSAFEFLAG{ws}TRUE {yylval.yint=1; return(SEVENBITSAFEFLAG); } +SEVENBITSAFEFLAG{ws}FALSE {yylval.yint=0; return(SEVENBITSAFEFLAG); } + +CHECKSUM return(CHECKSUM); +DESIGNSIZE return(DESIGNSIZE); +DESIGNUNITS return(DESIGNUNITS); +FACE return(FACE); +HEADER return(HEADER); +BOUNDARYCHAR return(BOUNDARYCHAR); +FONTDIMEN return(FONTDIMEN); +LIGTABLE return(LIGTABLE); +CHARACTER return(CHARACTER); + +PARAMETER return(PARAMETER); +LABEL return(LABEL); +KRN return(KRN); +STOP return(STOP); +SKIP return(SKIP); +NEXTLARGER return(NEXTLARGER); +VARCHAR return(VARCHAR); + +CHARWD {yylval.yint = C_WD; return(CHARMEASURE); } +CHARHT {yylval.yint = C_HT; return(CHARMEASURE); } +CHARDP {yylval.yint = C_DP; return(CHARMEASURE); } +CHARIC {yylval.yint = C_IC; return(CHARMEASURE); } + +TOP {yylval.yint = E_TOP; return(EXTEN); } +MID {yylval.yint = E_MID; return(EXTEN); } +BOT {yylval.yint = E_BOT; return(EXTEN); } +REP {yylval.yint = E_REP; return(EXTEN); } + +LIG {yylval.yint = L_0; return(LIG); } +"LIG/" {yylval.yint = L_B; return(LIG); } +"/LIG" {yylval.yint = L_A; return(LIG); } +"/LIG/" {yylval.yint = L_AB; return(LIG); } +"LIG/>" {yylval.yint = L_Bx; return(LIG); } +"/LIG>" {yylval.yint = L_Ax; return(LIG); } +"/LIG/>" {yylval.yint = L_ABx; return(LIG); } +"/LIG/>>" {yylval.yint = L_ABxx; return(LIG); } + +F{ws}MRR {yylval.yint = F_MRR; return(NUMBER); } +F{ws}MIR {yylval.yint = F_MIR; return(NUMBER); } +F{ws}BRR {yylval.yint = F_BRR; return(NUMBER); } +F{ws}BIR {yylval.yint = F_BIR; return(NUMBER); } +F{ws}LRR {yylval.yint = F_LRR; return(NUMBER); } +F{ws}LIR {yylval.yint = F_LIR; return(NUMBER); } +F{ws}MRC {yylval.yint = F_MRC; return(NUMBER); } +F{ws}MIC {yylval.yint = F_MIC; return(NUMBER); } +F{ws}BRC {yylval.yint = F_BRC; return(NUMBER); } +F{ws}BIC {yylval.yint = F_BIC; return(NUMBER); } +F{ws}LRC {yylval.yint = F_LRC; return(NUMBER); } +F{ws}LIC {yylval.yint = F_LIC; return(NUMBER); } +F{ws}MRE {yylval.yint = F_MRE; return(NUMBER); } +F{ws}MIE {yylval.yint = F_MIE; return(NUMBER); } +F{ws}BRE {yylval.yint = F_BRE; return(NUMBER); } +F{ws}BIE {yylval.yint = F_BIE; return(NUMBER); } +F{ws}LRE {yylval.yint = F_LRE; return(NUMBER); } +F{ws}LIE {yylval.yint = F_LIE; return(NUMBER); } + +SLANT {yylval.yint = P_SLANT; return(NAMEDPARAMETER); } +SPACE {yylval.yint = P_SPACE; return(NAMEDPARAMETER); } +STRETCH {yylval.yint = P_STRETCH; return(NAMEDPARAMETER); } +SHRINK {yylval.yint = P_SHRINK; return(NAMEDPARAMETER); } +XHEIGHT {yylval.yint = P_XHEIGHT; return(NAMEDPARAMETER); } +QUAD {yylval.yint = P_QUAD; return(NAMEDPARAMETER); } +EXTRASPACE {yylval.yint = P_EXTRASPACE; return(NAMEDPARAMETER); } +NUM1 {yylval.yint = P_NUM1; return(NAMEDPARAMETER); } +NUM2 {yylval.yint = P_NUM2; return(NAMEDPARAMETER); } +NUM3 {yylval.yint = P_NUM3; return(NAMEDPARAMETER); } +DENOM1 {yylval.yint = P_DENOM1; return(NAMEDPARAMETER); } +DENOM2 {yylval.yint = P_DENOM2; return(NAMEDPARAMETER); } +SUP1 {yylval.yint = P_SUP1; return(NAMEDPARAMETER); } +SUP2 {yylval.yint = P_SUP2; return(NAMEDPARAMETER); } +SUP3 {yylval.yint = P_SUP3; return(NAMEDPARAMETER); } +SUB1 {yylval.yint = P_SUB1; return(NAMEDPARAMETER); } +SUB2 {yylval.yint = P_SUB2; return(NAMEDPARAMETER); } +SUPDROP {yylval.yint = P_SUPDROP; return(NAMEDPARAMETER); } +SUBDROP {yylval.yint = P_SUBDROP; return(NAMEDPARAMETER); } +DELIM1 {yylval.yint = P_DELIM1; return(NAMEDPARAMETER); } +DELIM2 {yylval.yint = P_DELIM2; return(NAMEDPARAMETER); } +AXISHEIGHT {yylval.yint = P_AXISHEIGHT; return(NAMEDPARAMETER); } + +DEFAULTRULETHICKNESS {yylval.yint = P_DEFAULTRULETHICKNESS; + return(NAMEDPARAMETER); } +BIGOPSPACING1 {yylval.yint = P_BIGOPSPACING1; return(NAMEDPARAMETER); } +BIGOPSPACING2 {yylval.yint = P_BIGOPSPACING2; return(NAMEDPARAMETER); } +BIGOPSPACING3 {yylval.yint = P_BIGOPSPACING3; return(NAMEDPARAMETER); } +BIGOPSPACING4 {yylval.yint = P_BIGOPSPACING4; return(NAMEDPARAMETER); } +BIGOPSPACING5 {yylval.yint = P_BIGOPSPACING5; return(NAMEDPARAMETER); } + +MAPFONT {return(MAPFONT); } +FONTCHECKSUM {return(FONTCHECKSUM); } +FONTAT {return(FONTAT); } +FONTDSIZE {return(FONTDSIZE); } +MAP {return(MAP); } +SELECTFONT {return(SELECTFONT); } +SETCHAR {return(SETCHAR); } +SETRULE {return(SETRULE); } +PUSH {return(PUSH); } +POP {return(POP); } + +MOVERIGHT {yylval.yint = M_RIGHT; return(MOVE); } +MOVELEFT {yylval.yint = M_LEFT; return(MOVE); } +MOVEUP {yylval.yint = M_UP; return(MOVE); } +MOVEDOWN {yylval.yint = M_DOWN; return(MOVE); } + +OFMLEVEL return(OFMLEVEL); +TOPACCENT {yylval.yint = ACC_TOP; return(ACCENT); } +MIDACCENT {yylval.yint = ACC_MID; return(ACCENT); } +BOTACCENT {yylval.yint = ACC_BOT; return(ACCENT); } + +FONTDIR{ws}TL {yylval.yint = DIR_ORD+DIR_TL; return(FONTDIR);} +FONTDIR{ws}LT {yylval.yint = DIR_ORD+DIR_LT; return(FONTDIR);} +FONTDIR{ws}TR {yylval.yint = DIR_ORD+DIR_TR; return(FONTDIR);} +FONTDIR{ws}LB {yylval.yint = DIR_ORD+DIR_LB; return(FONTDIR);} +FONTDIR{ws}BL {yylval.yint = DIR_ORD+DIR_BL; return(FONTDIR);} +FONTDIR{ws}RT {yylval.yint = DIR_ORD+DIR_RT; return(FONTDIR);} +FONTDIR{ws}BR {yylval.yint = DIR_ORD+DIR_BR; return(FONTDIR);} +FONTDIR{ws}RB {yylval.yint = DIR_ORD+DIR_RB; return(FONTDIR);} +NATURALFONTDIR{ws}TL {yylval.yint = DIR_NAT+DIR_TL; return(FONTDIR);} +NATURALFONTDIR{ws}LT {yylval.yint = DIR_NAT+DIR_LT; return(FONTDIR);} +NATURALFONTDIR{ws}TR {yylval.yint = DIR_NAT+DIR_TR; return(FONTDIR);} +NATURALFONTDIR{ws}LB {yylval.yint = DIR_NAT+DIR_LB; return(FONTDIR);} +NATURALFONTDIR{ws}BL {yylval.yint = DIR_NAT+DIR_BL; return(FONTDIR);} +NATURALFONTDIR{ws}RT {yylval.yint = DIR_NAT+DIR_RT; return(FONTDIR);} +NATURALFONTDIR{ws}BR {yylval.yint = DIR_NAT+DIR_BR; return(FONTDIR);} +NATURALFONTDIR{ws}RB {yylval.yint = DIR_NAT+DIR_RB; return(FONTDIR);} + +FONTIVALUE return(FONTIVALUE); +FONTFVALUE return(FONTFVALUE); +FONTMVALUE return(FONTMVALUE); +FONTPENALTY return(FONTPENALTY); +FONTRULE return(FONTRULE); +FONTGLUE return(FONTGLUE); + +IVALUE return(IVALUE); +FVALUE return(FVALUE); +MVALUE return(MVALUE); +PENALTY return(PENALTY); +RULE return(RULE); +GLUE return(GLUE); + +IVALUEVAL return(IVALUEVAL); +FVALUEVAL return(FVALUEVAL); +MVALUEVAL return(MVALUEVAL); +PENALTYVAL return(PENALTYVAL); + +RULEWD { yylval.yint = RULE_WD; return(RULEMEASURE); } +RULEHT { yylval.yint = RULE_HT; return(RULEMEASURE); } +RULEDP { yylval.yint = RULE_DP; return(RULEMEASURE); } + +GLUEWD return(GLUEWD); +GLUESTRETCH { yylval.yint = GLUE_STRETCH; return(GLUESHRINKSTRETCH); } +GLUESHRINK { yylval.yint = GLUE_SHRINK; return(GLUESHRINKSTRETCH); } + +GLUETYPE return(GLUETYPE); +GLUERULE return(GLUERULE); +GLUECHAR return(GLUECHAR); + +CHARIVALUE return(CHARIVALUE); +CHARFVALUE return(CHARFVALUE); +CHARMVALUE return(CHARMVALUE); +CHARPENALTY return(CHARPENALTY); +CHARRULE return(CHARRULE); +CHARGLUE return(CHARGLUE); + +CKRN return(CKRN); +CGLUE return(CGLUE); +CPENALTY return(CPENALTY); +CPENGLUE return(CPENGLUE); +CLABEL return(CLABEL); + +CHARREPEAT return(CHARREPEAT); + + +FILLL {yylval.yint = O_FILLL; return(GLUEORDER); } +FILL {yylval.yint = O_FILL; return(GLUEORDER); } +FIL {yylval.yint = O_FIL; return(GLUEORDER); } +FI {yylval.yint = O_FI; return(GLUEORDER); } +UNIT {yylval.yint = O_UNIT; return(GLUEORDER); } + +NORMAL {yylval.yint = K_NORMAL; return(GLUEKIND); } +ALEADERS {yylval.yint = K_ALEADERS; return(GLUEKIND); } +CLEADERS {yylval.yint = K_CLEADERS; return(GLUEKIND); } +XLEADERS {yylval.yint = K_XLEADERS; return(GLUEKIND); } + +SECWD {yylval.yint = C_SECWD; return(CHARMEASURE); } +SECHT {yylval.yint = C_SECHT; return(CHARMEASURE); } +SECDP {yylval.yint = C_SECDP; return(CHARMEASURE); } +SECIC {yylval.yint = C_SECIC; return(CHARMEASURE); } + +PRIMTOPAXIS {yylval.yint = C_P_TOPAXIS; return(CHARMEASURE); } +PRIMTOPAXISBIS {yylval.yint = C_P_TOPAXISBIs; return(CHARMEASURE); } +PRIMBOTAXIS {yylval.yint = C_P_BOTAXIS; return(CHARMEASURE); } +PRIMBOTAXISBIS {yylval.yint = C_P_BOTAXISBIS; return(CHARMEASURE); } +PRIMMIDHOR {yylval.yint = C_P_MIDHOR; return(CHARMEASURE); } +PRIMMIDVERT {yylval.yint = C_P_MIDVERT; return(CHARMEASURE); } +PRIMBASESLANT {yylval.yint = C_P_BASESLANT; return(CHARMEASURE); } + +SECTOPAXIS {yylval.yint = C_S_TOPAXIS; return(CHARMEASURE); } +SECTOPAXISBIS {yylval.yint = C_S_TOPAXISBIs; return(CHARMEASURE); } +SECBOTAXIS {yylval.yint = C_S_BOTAXIS; return(CHARMEASURE); } +SECBOTAXISBIS {yylval.yint = C_S_BOTAXISBIS; return(CHARMEASURE); } +SECMIDHOR {yylval.yint = C_S_MIDHOR; return(CHARMEASURE); } +SECMIDVERT {yylval.yint = C_S_MIDVERT; return(CHARMEASURE); } +SECBASESLANT {yylval.yint = C_S_BASESLANT; return(CHARMEASURE); } + +. {lex_error_1("unexpected character (%x); ignored", + yytext[0]);} +%% + +/* added by Thomas Esser, suggested by Olaf Weber */ +#ifdef yywrap +#undef yywrap +#endif + +int +yywrap (void) +{ return 1; } + +void +scan_int(unsigned base) +{ + register unsigned j, q = 0x10000 / base, c0=0, c1=0, i=1; + + if ((base<BASE_MIN) || (base>BASE_MAX)) + internal_error_1("scan_int (base=%d)", base); + while ((yytext[i]==' ') || (yytext[i]=='\t')) { + yytext[i] = ' '; + i++; + } + for (; i<yyleng; i++) { + j = yytext[i]; + if (j>='A') j = j + '0' + 10 - 'A' ; + c0 = base*c0 + (c1 / q); + c1 = base*(c1 % q) + j - '0'; + if (c0 > 0xffff) { + lex_error_s("numeric value (%s) too large; set to 0", yytext); + c0=0; c1=0; break; + } + } + yylval.yint = c0 * 0x10000 + c1; +} + +void +scan_fix(void) +{ + unsigned i=1; + unsigned sign = 1; + unsigned j=0; + unsigned acc=0; + unsigned int_part; + unsigned fraction_digits[7]; + + while ((yytext[i]==' ') || (yytext[i]=='\t') || + (yytext[i]=='+') || (yytext[i]=='-')) { + if (yytext[i]=='\t') yytext[i] = ' '; + if (yytext[i]=='-') sign *= -1; + i++; + } + acc=0; + while ((i<yyleng) && (yytext[i]!='.')) { + acc = acc*10 + yytext[i]-'0'; + i++; + if (acc >=0x800 ) { + lex_error_s("fix value (%s) too large; set to 0", yytext); + yylval.yfix = 0; + return; + } + } + int_part = acc; acc = 0; + if (i < yyleng) { + i++; + while ((i<yyleng) && j<7) { + fraction_digits[j] = 0x200000*(yytext[i]-'0'); + i++; j++; + } + while (j>0) {acc = fraction_digits[--j] + acc / 10;} + acc = (acc + 10) / 20; + } + if ((acc > UNITY) && (int_part=2047)) { + lex_error_s("fix value (%s) too large; set to 0", yytext); + yylval.yfix = 0; + return; + } + yylval.yfix = sign * (int_part*UNITY + acc); +} + +void +scan_char(void) +{ + register unsigned i=1; + + while ((yytext[i]==' ') || (yytext[i]=='\t')) i++; + if ((yytext[i]<041) || (yytext[i]>0176) || + (yytext[i]=='(') || (yytext[i]==')')) { + lex_error_1("C value (H %X) must be ASCII (not paren); " + "set to 'A'", yytext[i]); + yylval.yint = 'A'; + } else yylval.yint = yytext[i]; +} + +void +scan_string(char *attribute, unsigned keep, unsigned length) +{ + register unsigned c, saved_ptr = 0, paren_level = 0; + unsigned error_msg = FALSE; + + if ((keep<KEEP_MIN) || (keep>KEEP_MAX)) + internal_error_1("scan_string (keep=%d)", keep); + while (((c = input()) != EOF) && + ((c == ' ') || (c == '\t') || (c == '\n'))) { + if (c == '\n') {line_number++;} + } + if (c==EOF) fatal_error_s("EOF while scanning %s", attribute); + while ((c != EOF) && + ((c != ')') || (paren_level>0))) { + if (c==')') { + paren_level--; + if (keep==KEEP_CONVERT) { + lex_error_s_1("%s character (H %X) converted to slash", + attribute, c); + c = '/'; + } + } else if (c=='(') { + paren_level++; + if (keep==KEEP_CONVERT) { + lex_error_s_1("%s character (H %X) converted to slash", + attribute, c); + c = '/'; + } + } else if ((c<' ') || (c>='~')) { + if (c=='\n') line_number++; + if (keep==KEEP_CONVERT) { + lex_error_s_1("%s character (H %X) converted to blank", + attribute, c); + c = ' '; + } + } + if (saved_ptr<(MAX_PTR-3)) + saved_text[saved_ptr++] = c; + else if (error_msg == FALSE) { + lex_error_s_1("%s string longer than %d characters; truncating", + attribute, MAX_PTR); + error_msg = TRUE; + } + c = input(); + } + if (c==EOF) fatal_error_s("EOF while scanning %s", attribute); + unput(')'); + saved_text[saved_ptr++] = '\0'; + if (keep!=KEEP_NONE) { + if ((length != 0) && (strlen(saved_text)>length)) { + lex_error_s_1("%s string limited to %d characters; truncated", + attribute, length); + saved_text[length] = '\0'; + } + yylval.ystring = xstrdup(saved_text); + } else { + yylval.ystring = NULL; + } +} + +void +scan_hex_string(void) +{ + register unsigned i=10; + + while ((yytext[i]==' ') || (yytext[i]=='\t')) i++; + yylval.ystring = xstrdup(yytext+i); +} diff --git a/Build/source/texk/web2c/omegafonts/pl.y b/Build/source/texk/web2c/omegafonts/pl.y new file mode 100644 index 00000000000..2833db377cd --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/pl.y @@ -0,0 +1,544 @@ +%{ +/* pl.y: Grammar for reading property list files + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "parser.h" +#include "manifests.h" +#include "list_routines.h" +#include "error_routines.h" +#include "out_routines.h" +#include "char_routines.h" +#include "header_routines.h" +#include "param_routines.h" +#include "dimen_routines.h" +#include "ligkern_routines.h" +#include "print_routines.h" +#include "font_routines.h" +#include "extra_routines.h" + +%} + +/* Basic tokens */ + +%token LEFT +%token RIGHT +%token NUMBER +%token FIX +%token COMMENT + +/* Tokens found in PL, OPL, VF and OVF files */ + +%token CHECKSUM +%token DESIGNSIZE +%token DESIGNUNITS +%token CODINGSCHEME /* implicit string */ +%token FAMILY /* implicit string */ +%token FACE +%token SEVENBITSAFEFLAG /* implicit 0 (FALSE) or 1 (TRUE) */ +%token HEADER +%token FONTDIMEN +%token LIGTABLE +%token BOUNDARYCHAR +%token CHARACTER + +%token NAMEDPARAMETER /* implicit integer */ +%token PARAMETER + +%token CHARMEASURE /* implicit integer */ +%token NEXTLARGER +%token VARCHAR +%token EXTEN /* implicit integer */ + +%token LABEL +%token LIG /* implicit integer */ +%token KRN +%token STOP +%token SKIP + +/* Tokens found only in VF and OVF files */ + +%token VTITLE + +%token MAPFONT +%token FONTNAME +%token FONTAREA +%token FONTCHECKSUM +%token FONTAT +%token FONTDSIZE + +%token MAP +%token SELECTFONT +%token SETCHAR +%token SETRULE +%token MOVE +%token PUSH +%token POP +%token SPECIAL +%token SPECIALHEX + +/* Tokens found only in OPL and OVF files */ + +%token CHARREPEAT +%token FONTIVALUE +%token FONTFVALUE +%token FONTMVALUE +%token FONTPENALTY +%token FONTRULE +%token FONTGLUE + +%token CLABEL +%token CKRN +%token CGLUE +%token CPENALTY +%token CPENGLUE + +%token CHARIVALUE +%token CHARFVALUE +%token CHARMVALUE +%token CHARPENALTY +%token CHARRULE +%token CHARGLUE + +%token IVALUE +%token IVALUEVAL + +%token MVALUE +%token MVALUEVAL + +%token FVALUE +%token FVALUEVAL + +%token PENALTY +%token PENALTYVAL + +%token RULE +%token RULEMEASURE + +%token GLUE +%token GLUEWD +%token GLUETYPE +%token GLUEKIND /* Implicit integer */ +%token GLUERULE +%token GLUECHAR +%token GLUESHRINKSTRETCH +%token GLUEORDER /* Implicit integer */ + + +%token OFMLEVEL +%token FONTDIR +%token ACCENT + +%% + +File: + Entries +; + +Entries : + /* */ +| Entries + LEFT OneEntry RIGHT +; + +OneEntry : + +/* The following entries are found in PL, OPL, VP and OVP files */ + + CHECKSUM NUMBER + { set_check_sum($2.yint); } +| DESIGNSIZE FIX + { set_design_size($2.yfix); } +| DESIGNUNITS FIX + { set_design_units($2.yfix); } +| CODINGSCHEME + { set_coding_scheme($1.ystring); } +| FAMILY + { set_family($1.ystring); } +| FACE NUMBER + { set_face($2.yint); } +| SEVENBITSAFEFLAG + { set_seven_bit_safe_flag($1.yint); } +| HEADER NUMBER NUMBER + { set_header_word($2.yint, $3.yint); } +| FONTDIMEN + { init_parameters(); } + FontParameters +| LIGTABLE + { init_ligkern(); } + LigKernEntries +| BOUNDARYCHAR NUMBER + { set_boundary_character($2.yint); } +| CHARACTER NUMBER + { init_character($2.yint, NULL); } + CharacterEntries +| COMMENT + +/* The following entries are found only in VP and OVP files */ + +| VTITLE + { set_vtitle($1.ystring); } +| MAPFONT NUMBER + { init_map_font($2.yint); } + MapFontEntries + +/* The following entries are found only in OPL and OVP files */ + +| OFMLEVEL NUMBER + { set_ofm_level($2.yint); } +| FONTDIR + { set_font_dir($1.yint); } +| CHARREPEAT NUMBER NUMBER + { init_character($2.yint,NULL); } + CharacterEntries + { copy_characters($2.yint,$3.yint); } +| FONTIVALUE NUMBER + {init_font_ivalue($2.yint);} + FontIvalueEntries +| FONTMVALUE NUMBER + { init_font_mvalue($2.yint);} + FontMvalueEntries +| FONTFVALUE NUMBER + { init_font_fvalue($2.yint);} + FontFvalueEntries +| FONTPENALTY NUMBER + { init_font_penalty($2.yint);} + FontPenaltyEntries +| FONTRULE NUMBER + { init_font_rule($2.yint);} + FontRuleEntries +| FONTGLUE NUMBER + { init_font_glue($2.yint);} + FontGlueEntries +; + +FontParameters : + /* */ +| FontParameters + LEFT OneFontParameter RIGHT +; + +OneFontParameter : + NAMEDPARAMETER FIX + { set_param_word($1.yint, $2.yfix); } +| PARAMETER NUMBER FIX + { set_param_word($2.yint, $3.yfix); } +| COMMENT +; + +LigKernEntries : + /* */ +| LigKernEntries + LEFT OneLigKernEntry RIGHT +; + +OneLigKernEntry : + LABEL NUMBER + { set_label_command($2.yint); } +| LABEL BOUNDARYCHAR + { set_label_command(CHAR_BOUNDARY); } +| LIG NUMBER NUMBER + { set_ligature_command($1.yint, $2.yint, $3.yint); } +| KRN NUMBER FIX + { set_kerning_command($2.yint, $3.yfix); } +| STOP + { set_stop_command(); } +| SKIP NUMBER + { set_skip_command($2.yint); } +| COMMENT + +/* The following entries are found only in OPL and OVP files */ + +| CLABEL NUMBER + { set_c_label_command($2.yint); } +| CKRN NUMBER FIX + { set_c_kerning_command($2.yint, $3.yfix); } +| CGLUE NUMBER NUMBER + { set_c_glue_command($2.yint, $3.yint); } +| CPENALTY NUMBER NUMBER + { set_c_penalty_command($2.yint, $3.yint); } +| CPENGLUE NUMBER NUMBER NUMBER + { set_c_penglue_command($2.yint, $3.yint, $4.yint); } +; + +CharacterEntries : + /* */ +| CharacterEntries + LEFT OneCharacterEntry RIGHT +; + +OneCharacterEntry : + CHARMEASURE FIX + { set_character_measure($1.yint, $2.yfix); } +| NEXTLARGER NUMBER + { set_next_larger($2.yint); } +| VARCHAR + { init_var_character(); } + VarCharParameters +| COMMENT + +/* The following character entries are found only in VP and OVP files */ + +| MAP + { init_map(); } + MapEntries + { end_map(); } + +/* The following entries are found only in OPL and OVP files */ + +| ACCENT + { set_accent($1.yint); } +| CHARIVALUE NUMBER NUMBER + { set_character_ivalue($2.yint, $3.yint); } +| CHARMVALUE NUMBER NUMBER + { set_character_mvalue($2.yint, $3.yint); } +| CHARFVALUE NUMBER NUMBER + { set_character_fvalue($2.yint, $3.yint); } +| CHARPENALTY NUMBER NUMBER + { set_character_penalty($2.yint, $3.yint); } +| CHARRULE NUMBER NUMBER + { set_character_rule($2.yint, $3.yint); } +| CHARGLUE NUMBER NUMBER + { set_character_glue($2.yint, $3.yint); } + +; + +VarCharParameters : + /* */ +| VarCharParameters + LEFT OneVarCharParameter RIGHT +; + +OneVarCharParameter : + EXTEN NUMBER + { set_extensible_piece($1.yint, $2.yint); } +| COMMENT +; + + +/* The following four nonterminals are found only in VP and OVP files */ + +MapFontEntries : + /* */ +| MapFontEntries + LEFT OneMapFontEntry RIGHT +; + +OneMapFontEntry : + FONTNAME + { set_font_name($1.ystring); } +| FONTAREA + { set_font_area($1.ystring); } +| FONTCHECKSUM NUMBER + { set_font_check_sum($2.yint); } +| FONTAT FIX + { set_font_at($2.yfix); } +| FONTDSIZE FIX + { set_font_design_size($2.yfix); } +| COMMENT +; + +MapEntries : + /* */ +| MapEntries + LEFT OneMapEntry RIGHT +; + +OneMapEntry : + SELECTFONT NUMBER + { set_select_font($2.yint); } +| SETCHAR NUMBER + { set_set_char($2.yint); } +| SETRULE FIX FIX + { set_set_rule($2.yfix, $3.yfix); } +| MOVE FIX + { set_move($1.yint, $2.yfix); } +| PUSH + { set_push(); } +| POP + { set_pop(); } +| SPECIAL + { set_special($1.ystring); } +| SPECIALHEX + { set_special_hex($1.ystring); } +; + +/* The remaining nonterminals are found only in OPL and OVP files */ + +FontIvalueEntries : + /* */ +| FontIvalueEntries + LEFT OneFontIvalueEntry RIGHT +; + +OneFontIvalueEntry : + IVALUE NUMBER + { init_font_ivalue_entry($2.yint); } + IvalueDefinition +| COMMENT +; + +IvalueDefinition : + /* */ +| IvalueDefinition + LEFT OneIvalueDefinition RIGHT +; + +OneIvalueDefinition : + IVALUEVAL NUMBER + { set_font_ivalue_definition($2.yint); } +| COMMENT +; + +FontMvalueEntries : + /* */ +| FontMvalueEntries + LEFT OneFontMvalueEntry RIGHT +; + +OneFontMvalueEntry : + MVALUE NUMBER + { init_font_mvalue_entry($2.yint); } + MvalueDefinition +| COMMENT +; + +MvalueDefinition : + /* */ +| MvalueDefinition + LEFT OneMvalueDefinition RIGHT +; + +OneMvalueDefinition : + MVALUEVAL FIX + { set_font_mvalue_definition($2.yfix); } +| COMMENT +; + +FontFvalueEntries : + /* */ +| FontFvalueEntries + LEFT OneFontFvalueEntry RIGHT +; + +OneFontFvalueEntry : + FVALUE NUMBER + { init_font_fvalue_entry($2.yint); } + FvalueDefinition +| COMMENT +; + +FvalueDefinition : + /* */ +| FvalueDefinition + LEFT OneFvalueDefinition RIGHT +; + +OneFvalueDefinition : + FVALUEVAL FIX + { set_font_fvalue_definition($2.yfix); } +| COMMENT +; + +FontPenaltyEntries : + /* */ +| FontPenaltyEntries + LEFT OneFontPenaltyEntry RIGHT +; + +OneFontPenaltyEntry : + PENALTY NUMBER + { init_font_penalty_entry($2.yint); } + PenaltyDefinition +| COMMENT +; + +PenaltyDefinition : + /* */ +| PenaltyDefinition + LEFT OnePenaltyDefinition RIGHT +; + +OnePenaltyDefinition : + PENALTYVAL NUMBER + { set_font_penalty_definition($2.yint); } +| COMMENT +; + +FontRuleEntries : + /* */ +| FontRuleEntries + LEFT OneFontRuleEntry RIGHT +; + +OneFontRuleEntry : + RULE NUMBER + { init_font_rule_entry($2.yint); } + RuleDefinition +| COMMENT +; + +RuleDefinition : + /* */ +| RuleDefinition + LEFT OneRuleDefinition RIGHT +; + +OneRuleDefinition : + RULEMEASURE FIX + { set_font_rule_measure($1.yint, $2.yfix); } +| COMMENT +; + +FontGlueEntries : + /* */ +| FontGlueEntries + LEFT OneFontGlueEntry RIGHT +; + +OneFontGlueEntry : + GLUE NUMBER + { init_font_glue_entry($2.yint); } + GlueDefinition +| COMMENT +; + +GlueDefinition : + /* */ +| GlueDefinition + LEFT OneGlueDefinition RIGHT +; + +OneGlueDefinition : + GLUETYPE GLUEKIND + { set_font_glue_type($2.yint); } +| GLUEWD FIX + { set_font_glue_width($2.yfix); } +| GLUECHAR NUMBER + { set_font_glue_character($2.yint); } +| GLUERULE NUMBER NUMBER + { set_font_glue_rule($2.yint, $3.yint); } +| GLUESHRINKSTRETCH FIX GLUEORDER + { set_font_glue_shrink_stretch($1.yint, $2.yfix, $3.yint); } +| COMMENT +; diff --git a/Build/source/texk/web2c/omegafonts/print_routines.c b/Build/source/texk/web2c/omegafonts/print_routines.c new file mode 100644 index 00000000000..5bb2260c953 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/print_routines.c @@ -0,0 +1,727 @@ +/* print_routines.c: higher-level routines for printing OPL and OVP files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "list_routines.h" +#include "manifests.h" +#include "print_routines.h" +#include "header_routines.h" +#include "out_routines.h" +#include "error_routines.h" +#include "omfonts.h" + +void +print_check_sum(void) +{ + left(); + out("CHECKSUM"); + out(" "); out_num(check_sum); + right(); +} + +void +print_design_size(void) +{ + left(); + out("DESIGNSIZE"); + out(" "); out_fix(design_size); + right(); +} + +void +print_design_units(void) +{ + left(); + out("DESIGNUNITS"); + out(" "); out_fix(design_units); + right(); +} + +void +print_coding_scheme(void) +{ + left(); + out("CODINGSCHEME"); + out(" "); out(coding_scheme); + right(); +} + +void +print_family(void) +{ + left(); + out("FAMILY"); + out(" "); out(family); + right(); +} + +void +print_face(void) +{ + left(); + out("FACE"); + out(" "); + if ((face >= F_MIN) && (face <= F_MAX)) print_xerox_face(face); + else out_num(face); + right(); +} + +void +print_seven_bit_safe_flag(void) +{ + left(); + out("SEVENBITSAFEFLAG"); out(" "); + if (seven_bit == 1) out("TRUE"); + else if (seven_bit == 0) out("FALSE"); + else internal_error_1("print_seven_bit_safe_flag (seven_bit=%d)", seven_bit); + right(); + +} + +void +print_header_word(unsigned val1, unsigned val2) +{ + left(); + out("HEADER"); + out(" "); out_int(val1,10); + out(" "); out_num(val2); + right(); +} + +void +print_font_dimension(void) +{ + left(); + out("FONTDIMEN"); out_ln(); +} + +void +print_ligature_table(void) +{ + left(); + out("LIGTABLE"); out_ln(); +} + +void +print_boundary_character(unsigned val) +{ + left(); + out("BOUNDARYCHAR"); + out(" "); out_num(val); + right(); +} + +void +print_character(unsigned val) +{ + left(); + out("CHARACTER"); + out(" "); out_char(val); out_ln(); +} + +void +print_parameter(unsigned parameter, fix fval) +{ + left(); + if ((font_type==FT_MATHSY) && + (parameter>=P_MATHSY_MIN) && + (parameter<=P_MATHSY_MAX)) { + out_named_mathsy_parameter(parameter); + } else if ((font_type==FT_MATHEX) && + (parameter>=P_MATHEX_MIN) && + (parameter<=P_MATHEX_MAX)) { + out_named_mathex_parameter(parameter); + } else if (parameter<=P_MAX) { + out_named_parameter(parameter); + } else { + out("PARAMETER"); out(" "); out_int(parameter,10); + } + out(" "); out_fix(fval); + right(); +} + +void +print_label_command(unsigned val) +{ + left(); + out("LABEL"); out(" "); + if (val == -1) out("BOUNDARYCHAR"); + else out_char(val); + right(); +} + +void +print_ligature_command(unsigned command, unsigned val1, unsigned val2) +{ + left(); + out_ligature_command(command); + out(" "); out_char(val1); + out(" "); out_char(val2); + right(); +} + +void +print_kerning_command(unsigned val, fix fval) +{ + left(); + out("KRN"); + out(" "); out_char(val); + out(" "); out_fix(fval); + right(); +} + +void +print_stop_command(void) +{ + left(); + out("STOP"); + right(); +} + +void +print_skip_command(unsigned val) +{ + left(); + out("SKIP"); + out(" "); out_int(val,10); + right(); +} + +void +print_character_measure(unsigned measure, fix fval) +{ + left(); + out_character_measure(measure); + out(" "); out_fix(fval); + right(); +} + +void +print_next_larger(unsigned val) +{ + left(); + out("NEXTLARGER"); + out(" "); out_char(val); + right(); +} + +void +print_var_character(void) +{ + left(); out("VARCHAR"); out_ln(); +} + +void +print_extensible_piece(unsigned piece, unsigned val) +{ + left(); + out_extensible_piece(piece); + out(" "); out_char(val); + right(); +} + +/* Primitives used in VF and OVF files */ + +void +print_vtitle(string sval) +{ + left(); + out("VTITLE"); + out(" "); out(sval); + right(); +} + +void +print_map_font(unsigned val) +{ + left(); + out("MAPFONT"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_name(string sval) +{ + left(); + out("FONTNAME"); + out(" "); out(sval); + right(); +} + +void +print_font_area(string sval) +{ + left(); + out("FONTAREA"); + out(" "); out(sval); + right(); +} + +void +print_font_check_sum(unsigned val) +{ + left(); + out("FONTCHECKSUM"); + out(" "); out_num(val); + right(); +} + +void +print_font_at(fix fval) +{ + left(); + out("FONTAT"); + out(" "); out_fix(fval); + right(); +} + +void +print_font_design_size(fix fval) +{ + left(); + out("FONTDSIZE"); + out(" "); out_fix(fval); + right(); +} + +void +print_map(void) +{ + left(); out("MAP"); out_ln(); +} + +void +print_select_font(unsigned val) +{ + left(); + out("SELECTFONT"); + out(" "); out_int(val,10); + right(); +} + +void +print_set_char(unsigned val) +{ + left(); + out("SETCHAR"); + out(" "); out_char(val); + right(); +} + +void +print_put_char(unsigned val) +{ + left(); + out("PUTCHAR"); + out(" "); out_char(val); + right(); +} + +void +print_set_rule(fix fval1, fix fval2) +{ + left(); + out("SETRULE"); + out(" "); out_fix(fval1); + out(" "); out_fix(fval2); + right(); +} + +void +print_put_rule(fix fval1, fix fval2) +{ + left(); + out("PUTRULE"); + out(" "); out_fix(fval1); + out(" "); out_fix(fval2); + right(); +} + +void +print_push(void) +{ + left(); out("PUSH"); right(); +} + +void +print_pop(void) +{ + left(); out("POP"); right(); +} + +void +print_move(unsigned direction, fix fval) +{ + left(); + out_move_direction(direction); + out(" "); out_fix(fval); + right(); +} + +void +print_special(string sval) +{ + left(); + out("SPECIAL"); + out(" "); out(sval); + right(); +} + +void +print_special_hex(string sval) +{ + left(); + out("SPECIALHEX"); + out(" "); out(sval); + right(); +} + +/* Primitives used in OPL and OVF files */ + +void +print_character_repeat(unsigned val1, unsigned val2) +{ + left(); + out("CHARREPEAT"); + out(" "); out_char(val1); + out(" "); out_char(val2); out_ln(); +} + +void +print_font_ivalue(unsigned val) +{ + left(); + out("FONTIVALUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_mvalue(unsigned val) +{ + left(); + out("FONTMVALUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_fvalue(unsigned val) +{ + left(); + out("FONTFVALUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_penalty(unsigned val) +{ + left(); + out("FONTPENALTY"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_rule(unsigned val) +{ + left(); + out("FONTRULE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_glue(unsigned val) +{ + left(); + out("FONTGLUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_c_label_command(unsigned val) +{ + left(); + out("CLABEL"); out(" "); out_int(val,10); + right(); +} + +void +print_c_kerning_command(unsigned val1, unsigned val2) +{ + left(); + out("CKRN"); out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_c_glue_command(unsigned val1, unsigned val2) +{ + left(); + out("CGLUE"); out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_c_penalty_command(unsigned val1, unsigned val2) +{ + left(); + out("CPENALTY"); out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_c_penglue_command(unsigned val1, unsigned val2, unsigned val3) +{ + left(); + out("CPENGLUE"); out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + out(" "); out_int(val3,10); + right(); +} + +void +print_character_ivalue(unsigned val1, unsigned val2) +{ + left(); + out("CHARIVALUE"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_character_mvalue(unsigned val1, unsigned val2) +{ + left(); + out("CHARMVALUE"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_character_fvalue(unsigned val1, unsigned val2) +{ + left(); + out("CHARFVALUE"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_character_penalty(unsigned val1, unsigned val2) +{ + left(); + out("CHARPENALTY"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_character_rule(unsigned val1, unsigned val2) +{ + left(); + out("CHARRULE"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_character_glue(unsigned val1, unsigned val2) +{ + left(); + out("CHARGLUE"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_font_ivalue_entry(unsigned val) +{ + left(); + out("IVALUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_ivalue_definition(unsigned val) +{ + left(); + out("IVALUEVAL"); + out(" "); out_int(val,10); + right(); +} + +void +print_font_mvalue_entry(unsigned val) +{ + left(); + out("MVALUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_mvalue_definition(fix fval) +{ + left(); + out("MVALUEVAL"); + out(" "); out_fix(fval); + right(); +} + +void +print_font_fvalue_entry(unsigned val) +{ + left(); + out("FVALUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_fvalue_definition(fix fval) +{ + left(); + out("FVALUEVAL"); + out(" "); out_fix(fval); + right(); +} + +void +print_font_penalty_entry(unsigned val) +{ + left(); + out("PENALTY"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_penalty_definition(unsigned val) +{ + left(); + out("PENALTYVAL"); + out(" "); out_int(val,10); + right(); +} + +void +print_font_rule_entry(unsigned val) +{ + left(); + out("RULE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_rule_measure(unsigned val, fix fval) +{ + left(); + out_rule_measure(val); + out(" "); out_fix(fval); + right(); +} + +void +print_font_glue_entry(unsigned val) +{ + left(); + out("GLUE"); + out(" "); out_int(val,10); out_ln(); +} + +void +print_font_glue_type(unsigned val) +{ + left(); + out("GLUETYPE"); + out(" "); out_glue_kind(val); + right(); +} + +void +print_font_glue_width(fix fval) +{ + left(); + out("GLUEWD"); + out(" "); out_fix(fval); + right(); +} + +void +print_font_glue_character(unsigned val) +{ + left(); + out("GLUECHAR"); + out(" "); out_char(val); + right(); +} + +void +print_font_glue_rule(unsigned val1, unsigned val2) +{ + left(); + out("GLUERULE"); + out(" "); out_int(val1,10); + out(" "); out_int(val2,10); + right(); +} + +void +print_font_glue_shrink_stretch(unsigned val1, fix fval, unsigned val2) +{ + left(); + out_shrink_stretch(val1); + out(" "); out_fix(fval); + out(" "); out_glue_order(val2); + right(); +} + +void +print_ofm_level(unsigned val) +{ + left(); + out("OFMLEVEL"); + out(" "); out_int(val,10); + right(); +} + +void +print_font_dir(unsigned val) +{ + left(); + out_type_direction(val); + right(); +} + +void +print_accent(unsigned val) +{ + left(); + out_accent_kind(val); + right(); +} + diff --git a/Build/source/texk/web2c/omegafonts/print_routines.h b/Build/source/texk/web2c/omegafonts/print_routines.h new file mode 100644 index 00000000000..1362b56bd18 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/print_routines.h @@ -0,0 +1,105 @@ +/* print_routines.h: higher-level routines for printing OPL and OVP files. + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +extern void print_check_sum(void); +extern void print_design_size(void); +extern void print_design_units(void); +extern void print_coding_scheme(void); +extern void print_family(void); +extern void print_face(void); +extern void print_seven_bit_safe_flag(void); +extern void print_header_word(unsigned, unsigned); +extern void print_font_dimension(void); +extern void print_ligature_table(void); +extern void print_boundary_character(unsigned); +extern void print_character(unsigned); +extern void print_parameter(unsigned, fix); +extern void print_label_command(unsigned); +extern void print_ligature_command(unsigned, unsigned, unsigned); +extern void print_kerning_command(unsigned, fix); +extern void print_stop_command(void); +extern void print_skip_command(unsigned); +extern void print_character_measure(unsigned, fix); +extern void print_next_larger(unsigned); +extern void print_var_character(void); +extern void print_extensible_piece(unsigned, unsigned); + +extern void print_vtitle(string); +extern void print_map_font(unsigned); +extern void print_font_name(string); +extern void print_font_area(string); +extern void print_font_check_sum(unsigned); +extern void print_font_at(fix); +extern void print_font_design_size(fix); +extern void print_map(void); +extern void print_select_font(unsigned); +extern void print_set_char(unsigned); +extern void print_put_char(unsigned); +extern void print_set_rule(fix, fix); +extern void print_put_rule(fix, fix); +extern void print_push(void); +extern void print_pop(void); +extern void print_move(unsigned, fix); +extern void print_special(string); +extern void print_special_hex(string); + +extern void print_character_repeat(unsigned, unsigned); +extern void print_font_ivalue(unsigned); +extern void print_font_mvalue(unsigned); +extern void print_font_fvalue(unsigned); +extern void print_font_penalty(unsigned); +extern void print_font_rule(unsigned); +extern void print_font_glue(unsigned); +extern void print_c_label_command(unsigned); +extern void print_c_kerning_command(unsigned, unsigned); +extern void print_c_glue_command(unsigned, unsigned); +extern void print_c_penalty_command(unsigned, unsigned); +extern void print_c_penglue_command(unsigned, unsigned, unsigned); +extern void print_character_ivalue(unsigned, unsigned); +extern void print_character_mvalue(unsigned, unsigned); +extern void print_character_fvalue(unsigned, unsigned); +extern void print_character_penalty(unsigned, unsigned); +extern void print_character_rule(unsigned, unsigned); +extern void print_character_glue(unsigned, unsigned); +extern void print_font_ivalue_entry(unsigned); +extern void print_font_ivalue_definition(unsigned); +extern void print_font_mvalue_entry(unsigned); +extern void print_font_mvalue_definition(fix); +extern void print_font_fvalue_entry(unsigned); +extern void print_font_fvalue_definition(fix); +extern void print_font_penalty_entry(unsigned); +extern void print_font_penalty_definition(unsigned); +extern void print_font_rule_entry(unsigned); +extern void print_font_rule_measure(unsigned, fix); +extern void print_font_rule_height(fix); +extern void print_font_rule_depth(fix); +extern void print_font_glue_entry(unsigned); +extern void print_font_glue_type(unsigned); +extern void print_font_glue_width(fix); +extern void print_font_glue_character(unsigned); +extern void print_font_glue_rule(unsigned,unsigned); +extern void print_font_glue_shrink_stretch(unsigned, fix, unsigned); +extern void print_ofm_level(unsigned); +extern void print_font_dir(unsigned); +extern void print_accent(unsigned); + diff --git a/Build/source/texk/web2c/omegafonts/win32.mak b/Build/source/texk/web2c/omegafonts/win32.mak new file mode 100644 index 00000000000..9e79707f5de --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/win32.mak @@ -0,0 +1,81 @@ +################################################################################ +# +# Makefile : Web2C / Omega / Omegafonts +# Author : Fabrice Popineau <Fabrice.Popineau@supelec.fr> +# Platform : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources +# Time-stamp: <04/01/07 11:10:43 popineau> +# +################################################################################ +root_srcdir = ..\..\.. +!ifdef DEVELOPMENT +INCLUDE=$(INCLUDE);$(root_srcdir)\texk.development +!else +INCLUDE=$(INCLUDE);$(root_srcdir)\texk +!endif + +USE_KPATHSEA = 1 +USE_GNUW32 = 1 + +# These get expanded from the parent directory, not this one. +!include <msvc/common.mak> + +DEFS = -I.. $(DEFS) -DHAVE_CONFIG_H + +LEX_OUTPUT_ROOT = lex_yy + +proglib = ..\lib\$(objdir)\lib.lib + +programs = $(objdir)\omfonts.exe +linked_programs = $(objdir)\ofm2opl.exe $(objdir)\opl2ofm.exe \ + $(objdir)\ovf2ovp.exe $(objdir)\ovp2ovf.exe + +omfonts_objects = $(objdir)\omfonts.obj $(objdir)\y_tab.obj \ + $(objdir)\$(LEX_OUTPUT_ROOT).obj $(objdir)\char_routines.obj \ + $(objdir)\dimen_routines.obj $(objdir)\error_routines.obj \ + $(objdir)\header_routines.obj $(objdir)\ligkern_routines.obj \ + $(objdir)\list_routines.obj $(objdir)\out_routines.obj \ + $(objdir)\param_routines.obj $(objdir)\print_routines.obj \ + $(objdir)\font_routines.obj $(objdir)\extra_routines.obj \ + $(objdir)\out_ofm.obj $(objdir)\parse_ofm.obj + +all: $(objdir) $(programs) + +$(objdir)\omfonts.exe: $(omfonts_objects) $(proglib) $(kpathsealib) + $(link) $(**) $(conlibs) + +$(objdir)\omfonts.obj: omfonts.c y_tab.h + +y_tab.c y_tab.h: pl.y + $(yacc) -d -v $(srcdir)\pl.y -o y_tab.c + +$(objdir)\$(LEX_OUTPUT_ROOT).obj: parser.h + +$(LEX_OUTPUT_ROOT).c: pl.l + $(lex) -t $(srcdir)\pl.l | sed "/^extern int isatty YY/d" > $(LEX_OUTPUT_ROOT).c + +!include <msvc/config.mak> +!include <msvc/install.mak> + +install:: install-exec + +install-programs: install-exec + +install-exec:: install-links + +install-links: $(programs) + -@echo $(verbose) & for %%i in ($(linked_programs)) do $(copy) $(programs) $(bindir)\%%~nxi $(redir_stdout) + +!include <msvc/clean.mak> + +clean:: + -@echo $(verbose) & ( \ + for %%i in (y_tab.c y_tab.h y.output yacc.* $(LEX_OUTPUT_ROOT).c) do $(del) %%i $(redir_stderr) \ + ) + +!include <msvc/rdepend.mak> +!include "./depend.mak" + +# +# Local Variables: +# mode: makefile +# End: diff --git a/Build/source/texk/web2c/omegafonts/y_tab.c-dist b/Build/source/texk/web2c/omegafonts/y_tab.c-dist new file mode 100644 index 00000000000..10b79adf607 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/y_tab.c-dist @@ -0,0 +1,2030 @@ +/* A Bison parser, made by GNU Bison 1.875a. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + LEFT = 258, + RIGHT = 259, + NUMBER = 260, + FIX = 261, + COMMENT = 262, + CHECKSUM = 263, + DESIGNSIZE = 264, + DESIGNUNITS = 265, + CODINGSCHEME = 266, + FAMILY = 267, + FACE = 268, + SEVENBITSAFEFLAG = 269, + HEADER = 270, + FONTDIMEN = 271, + LIGTABLE = 272, + BOUNDARYCHAR = 273, + CHARACTER = 274, + NAMEDPARAMETER = 275, + PARAMETER = 276, + CHARMEASURE = 277, + NEXTLARGER = 278, + VARCHAR = 279, + EXTEN = 280, + LABEL = 281, + LIG = 282, + KRN = 283, + STOP = 284, + SKIP = 285, + VTITLE = 286, + MAPFONT = 287, + FONTNAME = 288, + FONTAREA = 289, + FONTCHECKSUM = 290, + FONTAT = 291, + FONTDSIZE = 292, + MAP = 293, + SELECTFONT = 294, + SETCHAR = 295, + SETRULE = 296, + MOVE = 297, + PUSH = 298, + POP = 299, + SPECIAL = 300, + SPECIALHEX = 301, + CHARREPEAT = 302, + FONTIVALUE = 303, + FONTFVALUE = 304, + FONTMVALUE = 305, + FONTPENALTY = 306, + FONTRULE = 307, + FONTGLUE = 308, + CLABEL = 309, + CKRN = 310, + CGLUE = 311, + CPENALTY = 312, + CPENGLUE = 313, + CHARIVALUE = 314, + CHARFVALUE = 315, + CHARMVALUE = 316, + CHARPENALTY = 317, + CHARRULE = 318, + CHARGLUE = 319, + IVALUE = 320, + IVALUEVAL = 321, + MVALUE = 322, + MVALUEVAL = 323, + FVALUE = 324, + FVALUEVAL = 325, + PENALTY = 326, + PENALTYVAL = 327, + RULE = 328, + RULEMEASURE = 329, + GLUE = 330, + GLUEWD = 331, + GLUETYPE = 332, + GLUEKIND = 333, + GLUERULE = 334, + GLUECHAR = 335, + GLUESHRINKSTRETCH = 336, + GLUEORDER = 337, + OFMLEVEL = 338, + FONTDIR = 339, + ACCENT = 340 + }; +#endif +#define LEFT 258 +#define RIGHT 259 +#define NUMBER 260 +#define FIX 261 +#define COMMENT 262 +#define CHECKSUM 263 +#define DESIGNSIZE 264 +#define DESIGNUNITS 265 +#define CODINGSCHEME 266 +#define FAMILY 267 +#define FACE 268 +#define SEVENBITSAFEFLAG 269 +#define HEADER 270 +#define FONTDIMEN 271 +#define LIGTABLE 272 +#define BOUNDARYCHAR 273 +#define CHARACTER 274 +#define NAMEDPARAMETER 275 +#define PARAMETER 276 +#define CHARMEASURE 277 +#define NEXTLARGER 278 +#define VARCHAR 279 +#define EXTEN 280 +#define LABEL 281 +#define LIG 282 +#define KRN 283 +#define STOP 284 +#define SKIP 285 +#define VTITLE 286 +#define MAPFONT 287 +#define FONTNAME 288 +#define FONTAREA 289 +#define FONTCHECKSUM 290 +#define FONTAT 291 +#define FONTDSIZE 292 +#define MAP 293 +#define SELECTFONT 294 +#define SETCHAR 295 +#define SETRULE 296 +#define MOVE 297 +#define PUSH 298 +#define POP 299 +#define SPECIAL 300 +#define SPECIALHEX 301 +#define CHARREPEAT 302 +#define FONTIVALUE 303 +#define FONTFVALUE 304 +#define FONTMVALUE 305 +#define FONTPENALTY 306 +#define FONTRULE 307 +#define FONTGLUE 308 +#define CLABEL 309 +#define CKRN 310 +#define CGLUE 311 +#define CPENALTY 312 +#define CPENGLUE 313 +#define CHARIVALUE 314 +#define CHARFVALUE 315 +#define CHARMVALUE 316 +#define CHARPENALTY 317 +#define CHARRULE 318 +#define CHARGLUE 319 +#define IVALUE 320 +#define IVALUEVAL 321 +#define MVALUE 322 +#define MVALUEVAL 323 +#define FVALUE 324 +#define FVALUEVAL 325 +#define PENALTY 326 +#define PENALTYVAL 327 +#define RULE 328 +#define RULEMEASURE 329 +#define GLUE 330 +#define GLUEWD 331 +#define GLUETYPE 332 +#define GLUEKIND 333 +#define GLUERULE 334 +#define GLUECHAR 335 +#define GLUESHRINKSTRETCH 336 +#define GLUEORDER 337 +#define OFMLEVEL 338 +#define FONTDIR 339 +#define ACCENT 340 + + + + +/* Copy the first part of user declarations. */ +#line 1 "./pl.y" + +/* pl.y: Grammar for reading property list files + +This file is part of Omega, +which is based on the web2c distribution of TeX, + +Copyright (c) 1994--2001 John Plaice and Yannis Haralambous + +Omega is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +Omega is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Omega; if not, write to the Free Software Foundation, Inc., +59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#include "cpascal.h" +#include "parser.h" +#include "manifests.h" +#include "list_routines.h" +#include "error_routines.h" +#include "out_routines.h" +#include "char_routines.h" +#include "header_routines.h" +#include "param_routines.h" +#include "dimen_routines.h" +#include "ligkern_routines.h" +#include "print_routines.h" +#include "font_routines.h" +#include "extra_routines.h" + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 214 of yacc.c. */ +#line 298 "y.tab.c" + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# else +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 221 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 86 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 59 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 154 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 272 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 340 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short yyprhs[] = +{ + 0, 0, 3, 5, 6, 11, 14, 17, 20, 22, + 24, 27, 29, 33, 34, 38, 39, 43, 46, 47, + 52, 54, 56, 57, 62, 65, 67, 68, 74, 75, + 80, 81, 86, 87, 92, 93, 98, 99, 104, 105, + 110, 111, 116, 119, 123, 125, 126, 131, 134, 137, + 141, 145, 147, 150, 152, 155, 159, 163, 167, 172, + 173, 178, 181, 184, 185, 189, 191, 192, 196, 198, + 202, 206, 210, 214, 218, 222, 223, 228, 231, 233, + 234, 239, 241, 243, 246, 249, 252, 254, 255, 260, + 263, 266, 270, 273, 275, 277, 279, 281, 282, 287, + 288, 293, 295, 296, 301, 304, 306, 307, 312, 313, + 318, 320, 321, 326, 329, 331, 332, 337, 338, 343, + 345, 346, 351, 354, 356, 357, 362, 363, 368, 370, + 371, 376, 379, 381, 382, 387, 388, 393, 395, 396, + 401, 404, 406, 407, 412, 413, 418, 420, 421, 426, + 429, 432, 435, 439, 443 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short yyrhs[] = +{ + 87, 0, -1, 88, -1, -1, 88, 3, 89, 4, + -1, 8, 5, -1, 9, 6, -1, 10, 6, -1, + 11, -1, 12, -1, 13, 5, -1, 14, -1, 15, + 5, 5, -1, -1, 16, 90, 101, -1, -1, 17, + 91, 103, -1, 18, 5, -1, -1, 19, 5, 92, + 105, -1, 7, -1, 31, -1, -1, 32, 5, 93, + 111, -1, 83, 5, -1, 84, -1, -1, 47, 5, + 5, 94, 105, -1, -1, 48, 5, 95, 115, -1, + -1, 50, 5, 96, 120, -1, -1, 49, 5, 97, + 125, -1, -1, 51, 5, 98, 130, -1, -1, 52, + 5, 99, 135, -1, -1, 53, 5, 100, 140, -1, + -1, 101, 3, 102, 4, -1, 20, 6, -1, 21, + 5, 6, -1, 7, -1, -1, 103, 3, 104, 4, + -1, 26, 5, -1, 26, 18, -1, 27, 5, 5, + -1, 28, 5, 6, -1, 29, -1, 30, 5, -1, + 7, -1, 54, 5, -1, 55, 5, 6, -1, 56, + 5, 5, -1, 57, 5, 5, -1, 58, 5, 5, + 5, -1, -1, 105, 3, 106, 4, -1, 22, 6, + -1, 23, 5, -1, -1, 24, 107, 109, -1, 7, + -1, -1, 38, 108, 113, -1, 85, -1, 59, 5, + 5, -1, 61, 5, 5, -1, 60, 5, 5, -1, + 62, 5, 5, -1, 63, 5, 5, -1, 64, 5, + 5, -1, -1, 109, 3, 110, 4, -1, 25, 5, + -1, 7, -1, -1, 111, 3, 112, 4, -1, 33, + -1, 34, -1, 35, 5, -1, 36, 6, -1, 37, + 6, -1, 7, -1, -1, 113, 3, 114, 4, -1, + 39, 5, -1, 40, 5, -1, 41, 6, 6, -1, + 42, 6, -1, 43, -1, 44, -1, 45, -1, 46, + -1, -1, 115, 3, 116, 4, -1, -1, 65, 5, + 117, 118, -1, 7, -1, -1, 118, 3, 119, 4, + -1, 66, 5, -1, 7, -1, -1, 120, 3, 121, + 4, -1, -1, 67, 5, 122, 123, -1, 7, -1, + -1, 123, 3, 124, 4, -1, 68, 6, -1, 7, + -1, -1, 125, 3, 126, 4, -1, -1, 69, 5, + 127, 128, -1, 7, -1, -1, 128, 3, 129, 4, + -1, 70, 6, -1, 7, -1, -1, 130, 3, 131, + 4, -1, -1, 71, 5, 132, 133, -1, 7, -1, + -1, 133, 3, 134, 4, -1, 72, 5, -1, 7, + -1, -1, 135, 3, 136, 4, -1, -1, 73, 5, + 137, 138, -1, 7, -1, -1, 138, 3, 139, 4, + -1, 74, 6, -1, 7, -1, -1, 140, 3, 141, + 4, -1, -1, 75, 5, 142, 143, -1, 7, -1, + -1, 143, 3, 144, 4, -1, 77, 78, -1, 76, + 6, -1, 80, 5, -1, 79, 5, 5, -1, 81, + 6, 82, -1, 7, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short yyrline[] = +{ + 0, 155, 155, 158, 160, 168, 170, 172, 174, 176, + 178, 180, 182, 185, 184, 188, 187, 190, 193, 192, + 195, 199, 202, 201, 207, 209, 212, 211, 216, 215, + 219, 218, 222, 221, 225, 224, 228, 227, 231, 230, + 235, 237, 242, 244, 246, 249, 251, 256, 258, 260, + 262, 264, 266, 268, 272, 274, 276, 278, 280, 284, + 286, 291, 293, 296, 295, 298, 303, 302, 309, 311, + 313, 315, 317, 319, 321, 326, 328, 333, 335, 341, + 343, 348, 350, 352, 354, 356, 358, 361, 363, 368, + 370, 372, 374, 376, 378, 380, 382, 388, 390, 396, + 395, 398, 401, 403, 408, 410, 413, 415, 421, 420, + 423, 426, 428, 433, 435, 438, 440, 446, 445, 448, + 451, 453, 458, 460, 463, 465, 471, 470, 473, 476, + 478, 483, 485, 488, 490, 496, 495, 498, 501, 503, + 508, 510, 513, 515, 521, 520, 523, 526, 528, 533, + 535, 537, 539, 541, 543 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "LEFT", "RIGHT", "NUMBER", "FIX", + "COMMENT", "CHECKSUM", "DESIGNSIZE", "DESIGNUNITS", "CODINGSCHEME", + "FAMILY", "FACE", "SEVENBITSAFEFLAG", "HEADER", "FONTDIMEN", "LIGTABLE", + "BOUNDARYCHAR", "CHARACTER", "NAMEDPARAMETER", "PARAMETER", + "CHARMEASURE", "NEXTLARGER", "VARCHAR", "EXTEN", "LABEL", "LIG", "KRN", + "STOP", "SKIP", "VTITLE", "MAPFONT", "FONTNAME", "FONTAREA", + "FONTCHECKSUM", "FONTAT", "FONTDSIZE", "MAP", "SELECTFONT", "SETCHAR", + "SETRULE", "MOVE", "PUSH", "POP", "SPECIAL", "SPECIALHEX", "CHARREPEAT", + "FONTIVALUE", "FONTFVALUE", "FONTMVALUE", "FONTPENALTY", "FONTRULE", + "FONTGLUE", "CLABEL", "CKRN", "CGLUE", "CPENALTY", "CPENGLUE", + "CHARIVALUE", "CHARFVALUE", "CHARMVALUE", "CHARPENALTY", "CHARRULE", + "CHARGLUE", "IVALUE", "IVALUEVAL", "MVALUE", "MVALUEVAL", "FVALUE", + "FVALUEVAL", "PENALTY", "PENALTYVAL", "RULE", "RULEMEASURE", "GLUE", + "GLUEWD", "GLUETYPE", "GLUEKIND", "GLUERULE", "GLUECHAR", + "GLUESHRINKSTRETCH", "GLUEORDER", "OFMLEVEL", "FONTDIR", "ACCENT", + "$accept", "File", "Entries", "OneEntry", "@1", "@2", "@3", "@4", "@5", + "@6", "@7", "@8", "@9", "@10", "@11", "FontParameters", + "OneFontParameter", "LigKernEntries", "OneLigKernEntry", + "CharacterEntries", "OneCharacterEntry", "@12", "@13", + "VarCharParameters", "OneVarCharParameter", "MapFontEntries", + "OneMapFontEntry", "MapEntries", "OneMapEntry", "FontIvalueEntries", + "OneFontIvalueEntry", "@14", "IvalueDefinition", "OneIvalueDefinition", + "FontMvalueEntries", "OneFontMvalueEntry", "@15", "MvalueDefinition", + "OneMvalueDefinition", "FontFvalueEntries", "OneFontFvalueEntry", "@16", + "FvalueDefinition", "OneFvalueDefinition", "FontPenaltyEntries", + "OneFontPenaltyEntry", "@17", "PenaltyDefinition", + "OnePenaltyDefinition", "FontRuleEntries", "OneFontRuleEntry", "@18", + "RuleDefinition", "OneRuleDefinition", "FontGlueEntries", + "OneFontGlueEntry", "@19", "GlueDefinition", "OneGlueDefinition", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 86, 87, 88, 88, 89, 89, 89, 89, 89, + 89, 89, 89, 90, 89, 91, 89, 89, 92, 89, + 89, 89, 93, 89, 89, 89, 94, 89, 95, 89, + 96, 89, 97, 89, 98, 89, 99, 89, 100, 89, + 101, 101, 102, 102, 102, 103, 103, 104, 104, 104, + 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, + 105, 106, 106, 107, 106, 106, 108, 106, 106, 106, + 106, 106, 106, 106, 106, 109, 109, 110, 110, 111, + 111, 112, 112, 112, 112, 112, 112, 113, 113, 114, + 114, 114, 114, 114, 114, 114, 114, 115, 115, 117, + 116, 116, 118, 118, 119, 119, 120, 120, 122, 121, + 121, 123, 123, 124, 124, 125, 125, 127, 126, 126, + 128, 128, 129, 129, 130, 130, 132, 131, 131, 133, + 133, 134, 134, 135, 135, 137, 136, 136, 138, 138, + 139, 139, 140, 140, 142, 141, 141, 143, 143, 144, + 144, 144, 144, 144, 144 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 1, 0, 4, 2, 2, 2, 1, 1, + 2, 1, 3, 0, 3, 0, 3, 2, 0, 4, + 1, 1, 0, 4, 2, 1, 0, 5, 0, 4, + 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, + 0, 4, 2, 3, 1, 0, 4, 2, 2, 3, + 3, 1, 2, 1, 2, 3, 3, 3, 4, 0, + 4, 2, 2, 0, 3, 1, 0, 3, 1, 3, + 3, 3, 3, 3, 3, 0, 4, 2, 1, 0, + 4, 1, 1, 2, 2, 2, 1, 0, 4, 2, + 2, 3, 2, 1, 1, 1, 1, 0, 4, 0, + 4, 1, 0, 4, 2, 1, 0, 4, 0, 4, + 1, 0, 4, 2, 1, 0, 4, 0, 4, 1, + 0, 4, 2, 1, 0, 4, 0, 4, 1, 0, + 4, 2, 1, 0, 4, 0, 4, 1, 0, 4, + 2, 1, 0, 4, 0, 4, 1, 0, 4, 2, + 2, 2, 3, 3, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned char yydefact[] = +{ + 3, 0, 2, 1, 0, 20, 0, 0, 0, 8, + 9, 0, 11, 0, 13, 15, 0, 0, 21, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, + 5, 6, 7, 10, 0, 40, 45, 17, 18, 22, + 0, 28, 32, 30, 34, 36, 38, 24, 4, 12, + 14, 16, 59, 79, 26, 97, 115, 106, 124, 133, + 142, 0, 0, 19, 23, 59, 29, 33, 31, 35, + 37, 39, 44, 0, 0, 0, 53, 0, 0, 0, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 0, 0, 0, 42, 0, 41, + 47, 48, 0, 0, 52, 54, 0, 0, 0, 0, + 46, 65, 0, 0, 63, 66, 0, 0, 0, 0, + 0, 0, 68, 0, 86, 81, 82, 0, 0, 0, + 0, 101, 0, 0, 119, 0, 0, 110, 0, 0, + 128, 0, 0, 137, 0, 0, 146, 0, 0, 43, + 49, 50, 55, 56, 57, 0, 61, 62, 75, 87, + 0, 0, 0, 0, 0, 0, 60, 83, 84, 85, + 80, 99, 98, 117, 116, 108, 107, 126, 125, 135, + 134, 144, 143, 58, 64, 67, 69, 71, 70, 72, + 73, 74, 102, 120, 111, 129, 138, 147, 0, 0, + 100, 118, 109, 127, 136, 145, 78, 0, 0, 0, + 0, 0, 0, 93, 94, 95, 96, 0, 0, 0, + 0, 0, 0, 0, 77, 76, 89, 90, 0, 92, + 88, 105, 0, 0, 123, 0, 0, 114, 0, 0, + 132, 0, 0, 141, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 91, 104, 103, 122, 121, 113, 112, + 131, 130, 140, 139, 150, 149, 0, 151, 0, 148, + 152, 153 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const short yydefgoto[] = +{ + -1, 1, 2, 29, 35, 36, 52, 53, 65, 55, + 57, 56, 58, 59, 60, 50, 75, 51, 87, 63, + 123, 158, 159, 184, 208, 64, 130, 185, 217, 66, + 133, 192, 200, 233, 68, 139, 194, 202, 239, 67, + 136, 193, 201, 236, 69, 142, 195, 203, 242, 70, + 145, 196, 204, 245, 71, 148, 197, 205, 252 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -8 +static const short yypact[] = +{ + -8, 8, 9, -8, 11, -8, 4, 5, 29, -8, + -8, 34, -8, 35, -8, -8, 36, 39, -8, 40, + 41, 44, 46, 76, 77, 79, 81, 82, -8, 10, + -8, -8, -8, -8, 83, -8, -8, -8, -8, -8, + 84, -8, -8, -8, -8, -8, -8, -8, -8, -8, + 33, 80, -8, -8, -8, -8, -8, -8, -8, -8, + -8, 27, 72, 87, 88, -8, 89, 101, 102, 108, + 109, 118, -8, 116, 119, 121, -8, 32, 126, 127, + -8, 128, 129, 130, 131, 132, 133, 135, -7, 73, + 87, 0, -2, -1, 6, 3, -3, -8, 117, -8, + -8, -8, 136, 134, -8, -8, 137, 139, 140, 141, + -8, -8, 142, 144, -8, -8, 145, 146, 147, 148, + 149, 150, -8, 138, -8, -8, -8, 151, 152, 153, + 143, -8, 155, 157, -8, 158, 160, -8, 161, 163, + -8, 164, 166, -8, 167, 169, -8, 170, 172, -8, + -8, -8, -8, -8, -8, 173, -8, -8, -8, -8, + 174, 175, 176, 177, 178, 179, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, 154, 159, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, 78, 74, + 162, 165, 168, 171, 182, 183, -8, 184, 186, 187, + 188, 181, 185, -8, -8, -8, -8, 190, 31, 26, + 25, -4, -5, -6, -8, -8, -8, -8, 189, -8, + -8, -8, 191, 193, -8, 192, 195, -8, 194, 197, + -8, 198, 200, -8, 196, 201, -8, 202, 99, 204, + 205, 206, 203, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, 208, -8, 106, -8, + -8, -8 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const short yypgoto[] = +{ + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, 156, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -8, -8, -8 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const unsigned short yytable[] = +{ + 111, 246, 243, 240, 146, 134, 137, 131, 3, 30, + 143, 31, 4, 140, 48, 112, 113, 114, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 115, 237, 234, 72, 32, 61, 100, 231, 33, + 34, 37, 18, 19, 38, 39, 40, 73, 74, 41, + 101, 42, 116, 117, 118, 119, 120, 121, 20, 21, + 22, 23, 24, 25, 26, 132, 138, 135, 241, 244, + 247, 248, 147, 249, 250, 251, 144, 141, 122, 76, + 124, 43, 44, 62, 45, 206, 46, 47, 49, 54, + 88, 89, 91, 238, 27, 28, 235, 232, 77, 78, + 79, 80, 81, 207, 92, 93, 125, 126, 127, 128, + 129, 94, 95, 209, 210, 211, 212, 213, 214, 215, + 216, 96, 97, 149, 98, 99, 82, 83, 84, 85, + 86, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 151, 150, 166, 152, 153, 154, 155, 170, 156, 157, + 160, 161, 162, 163, 164, 165, 167, 198, 168, 169, + 171, 172, 199, 173, 174, 218, 175, 176, 219, 177, + 178, 220, 179, 180, 221, 181, 182, 265, 183, 186, + 187, 188, 189, 190, 191, 222, 223, 228, 271, 224, + 225, 229, 226, 227, 230, 253, 254, 255, 256, 257, + 258, 259, 262, 260, 261, 263, 0, 269, 264, 266, + 267, 0, 268, 270, 0, 0, 0, 0, 0, 0, + 0, 90 +}; + +static const yysigned_char yycheck[] = +{ + 7, 7, 7, 7, 7, 7, 7, 7, 0, 5, + 7, 6, 3, 7, 4, 22, 23, 24, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 38, 7, 7, 7, 6, 3, 5, 7, 5, + 5, 5, 31, 32, 5, 5, 5, 20, 21, 5, + 18, 5, 59, 60, 61, 62, 63, 64, 47, 48, + 49, 50, 51, 52, 53, 65, 67, 69, 72, 74, + 76, 77, 75, 79, 80, 81, 73, 71, 85, 7, + 7, 5, 5, 3, 5, 7, 5, 5, 5, 5, + 3, 3, 3, 68, 83, 84, 70, 66, 26, 27, + 28, 29, 30, 25, 3, 3, 33, 34, 35, 36, + 37, 3, 3, 39, 40, 41, 42, 43, 44, 45, + 46, 3, 6, 6, 5, 4, 54, 55, 56, 57, + 58, 5, 5, 5, 5, 5, 5, 5, 5, 4, + 6, 5, 4, 6, 5, 5, 5, 4, 6, 5, + 5, 5, 5, 5, 5, 5, 5, 3, 6, 6, + 5, 4, 3, 5, 4, 3, 5, 4, 3, 5, + 4, 3, 5, 4, 3, 5, 4, 78, 5, 5, + 5, 5, 5, 5, 5, 3, 3, 6, 82, 5, + 4, 6, 5, 5, 4, 6, 5, 4, 6, 4, + 6, 4, 6, 5, 4, 4, -1, 4, 6, 5, + 5, -1, 6, 5, -1, -1, -1, -1, -1, -1, + -1, 65 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 87, 88, 0, 3, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 31, 32, + 47, 48, 49, 50, 51, 52, 53, 83, 84, 89, + 5, 6, 6, 5, 5, 90, 91, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 4, 5, + 101, 103, 92, 93, 5, 95, 97, 96, 98, 99, + 100, 3, 3, 105, 111, 94, 115, 125, 120, 130, + 135, 140, 7, 20, 21, 102, 7, 26, 27, 28, + 29, 30, 54, 55, 56, 57, 58, 104, 3, 3, + 105, 3, 3, 3, 3, 3, 3, 6, 5, 4, + 5, 18, 5, 5, 5, 5, 5, 5, 5, 5, + 4, 7, 22, 23, 24, 38, 59, 60, 61, 62, + 63, 64, 85, 106, 7, 33, 34, 35, 36, 37, + 112, 7, 65, 116, 7, 69, 126, 7, 67, 121, + 7, 71, 131, 7, 73, 136, 7, 75, 141, 6, + 5, 6, 6, 5, 5, 5, 6, 5, 107, 108, + 5, 5, 5, 5, 5, 5, 4, 5, 6, 6, + 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, + 4, 5, 4, 5, 109, 113, 5, 5, 5, 5, + 5, 5, 117, 127, 122, 132, 137, 142, 3, 3, + 118, 128, 123, 133, 138, 143, 7, 25, 110, 39, + 40, 41, 42, 43, 44, 45, 46, 114, 3, 3, + 3, 3, 3, 3, 5, 4, 5, 5, 6, 6, + 4, 7, 66, 119, 7, 70, 129, 7, 68, 124, + 7, 72, 134, 7, 74, 139, 7, 76, 77, 79, + 80, 81, 144, 6, 5, 4, 6, 4, 6, 4, + 5, 4, 6, 4, 6, 78, 5, 5, 6, 4, + 5, 82 +}; + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror ("syntax error: cannot back up");\ + YYERROR; \ + } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +/* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.first_line = Rhs[1].first_line; \ + Current.first_column = Rhs[1].first_column; \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; +#endif + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YYDSYMPRINT(Args) \ +do { \ + if (yydebug) \ + yysymprint Args; \ +} while (0) + +# define YYDSYMPRINTF(Title, Token, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Token, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (cinluded). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short *bottom, short *top) +#else +static void +yy_stack_print (bottom, top) + short *bottom; + short *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; +#endif +{ + int yyi; + unsigned int yylineno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylineno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YYDSYMPRINT(Args) +# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#if YYMAXDEPTH == 0 +# undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + register const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# endif +# endif + +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + register char *yyd = yydest; + register const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +#endif /* !YYERROR_VERBOSE */ + + + +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + { + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); +# ifdef YYPRINT + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + } + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yytype, yyvaluep) + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# else +int yyparse (); +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + register int yystate; + register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; + register short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + register YYSTYPE *yyvsp; + + + +#define YYPOPSTACK (yyvsp--, yyssp--) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyoverflowlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + short *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; + + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 5: +#line 169 "./pl.y" + { set_check_sum(yyvsp[0].yint); } + break; + + case 6: +#line 171 "./pl.y" + { set_design_size(yyvsp[0].yfix); } + break; + + case 7: +#line 173 "./pl.y" + { set_design_units(yyvsp[0].yfix); } + break; + + case 8: +#line 175 "./pl.y" + { set_coding_scheme(yyvsp[0].ystring); } + break; + + case 9: +#line 177 "./pl.y" + { set_family(yyvsp[0].ystring); } + break; + + case 10: +#line 179 "./pl.y" + { set_face(yyvsp[0].yint); } + break; + + case 11: +#line 181 "./pl.y" + { set_seven_bit_safe_flag(yyvsp[0].yint); } + break; + + case 12: +#line 183 "./pl.y" + { set_header_word(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 13: +#line 185 "./pl.y" + { init_parameters(); } + break; + + case 15: +#line 188 "./pl.y" + { init_ligkern(); } + break; + + case 17: +#line 191 "./pl.y" + { set_boundary_character(yyvsp[0].yint); } + break; + + case 18: +#line 193 "./pl.y" + { init_character(yyvsp[0].yint, NULL); } + break; + + case 21: +#line 200 "./pl.y" + { set_vtitle(yyvsp[0].ystring); } + break; + + case 22: +#line 202 "./pl.y" + { init_map_font(yyvsp[0].yint); } + break; + + case 24: +#line 208 "./pl.y" + { set_ofm_level(yyvsp[0].yint); } + break; + + case 25: +#line 210 "./pl.y" + { set_font_dir(yyvsp[0].yint); } + break; + + case 26: +#line 212 "./pl.y" + { init_character(yyvsp[-1].yint,NULL); } + break; + + case 27: +#line 214 "./pl.y" + { copy_characters(yyvsp[-3].yint,yyvsp[-2].yint); } + break; + + case 28: +#line 216 "./pl.y" + {init_font_ivalue(yyvsp[0].yint);} + break; + + case 30: +#line 219 "./pl.y" + { init_font_mvalue(yyvsp[0].yint);} + break; + + case 32: +#line 222 "./pl.y" + { init_font_fvalue(yyvsp[0].yint);} + break; + + case 34: +#line 225 "./pl.y" + { init_font_penalty(yyvsp[0].yint);} + break; + + case 36: +#line 228 "./pl.y" + { init_font_rule(yyvsp[0].yint);} + break; + + case 38: +#line 231 "./pl.y" + { init_font_glue(yyvsp[0].yint);} + break; + + case 42: +#line 243 "./pl.y" + { set_param_word(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 43: +#line 245 "./pl.y" + { set_param_word(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 47: +#line 257 "./pl.y" + { set_label_command(yyvsp[0].yint); } + break; + + case 48: +#line 259 "./pl.y" + { set_label_command(CHAR_BOUNDARY); } + break; + + case 49: +#line 261 "./pl.y" + { set_ligature_command(yyvsp[-2].yint, yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 50: +#line 263 "./pl.y" + { set_kerning_command(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 51: +#line 265 "./pl.y" + { set_stop_command(); } + break; + + case 52: +#line 267 "./pl.y" + { set_skip_command(yyvsp[0].yint); } + break; + + case 54: +#line 273 "./pl.y" + { set_c_label_command(yyvsp[0].yint); } + break; + + case 55: +#line 275 "./pl.y" + { set_c_kerning_command(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 56: +#line 277 "./pl.y" + { set_c_glue_command(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 57: +#line 279 "./pl.y" + { set_c_penalty_command(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 58: +#line 281 "./pl.y" + { set_c_penglue_command(yyvsp[-2].yint, yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 61: +#line 292 "./pl.y" + { set_character_measure(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 62: +#line 294 "./pl.y" + { set_next_larger(yyvsp[0].yint); } + break; + + case 63: +#line 296 "./pl.y" + { init_var_character(); } + break; + + case 66: +#line 303 "./pl.y" + { init_map(); } + break; + + case 67: +#line 305 "./pl.y" + { end_map(); } + break; + + case 68: +#line 310 "./pl.y" + { set_accent(yyvsp[0].yint); } + break; + + case 69: +#line 312 "./pl.y" + { set_character_ivalue(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 70: +#line 314 "./pl.y" + { set_character_mvalue(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 71: +#line 316 "./pl.y" + { set_character_fvalue(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 72: +#line 318 "./pl.y" + { set_character_penalty(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 73: +#line 320 "./pl.y" + { set_character_rule(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 74: +#line 322 "./pl.y" + { set_character_glue(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 77: +#line 334 "./pl.y" + { set_extensible_piece(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 81: +#line 349 "./pl.y" + { set_font_name(yyvsp[0].ystring); } + break; + + case 82: +#line 351 "./pl.y" + { set_font_area(yyvsp[0].ystring); } + break; + + case 83: +#line 353 "./pl.y" + { set_font_check_sum(yyvsp[0].yint); } + break; + + case 84: +#line 355 "./pl.y" + { set_font_at(yyvsp[0].yfix); } + break; + + case 85: +#line 357 "./pl.y" + { set_font_design_size(yyvsp[0].yfix); } + break; + + case 89: +#line 369 "./pl.y" + { set_select_font(yyvsp[0].yint); } + break; + + case 90: +#line 371 "./pl.y" + { set_set_char(yyvsp[0].yint); } + break; + + case 91: +#line 373 "./pl.y" + { set_set_rule(yyvsp[-1].yfix, yyvsp[0].yfix); } + break; + + case 92: +#line 375 "./pl.y" + { set_move(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 93: +#line 377 "./pl.y" + { set_push(); } + break; + + case 94: +#line 379 "./pl.y" + { set_pop(); } + break; + + case 95: +#line 381 "./pl.y" + { set_special(yyvsp[0].ystring); } + break; + + case 96: +#line 383 "./pl.y" + { set_special_hex(yyvsp[0].ystring); } + break; + + case 99: +#line 396 "./pl.y" + { init_font_ivalue_entry(yyvsp[0].yint); } + break; + + case 104: +#line 409 "./pl.y" + { set_font_ivalue_definition(yyvsp[0].yint); } + break; + + case 108: +#line 421 "./pl.y" + { init_font_mvalue_entry(yyvsp[0].yint); } + break; + + case 113: +#line 434 "./pl.y" + { set_font_mvalue_definition(yyvsp[0].yfix); } + break; + + case 117: +#line 446 "./pl.y" + { init_font_fvalue_entry(yyvsp[0].yint); } + break; + + case 122: +#line 459 "./pl.y" + { set_font_fvalue_definition(yyvsp[0].yfix); } + break; + + case 126: +#line 471 "./pl.y" + { init_font_penalty_entry(yyvsp[0].yint); } + break; + + case 131: +#line 484 "./pl.y" + { set_font_penalty_definition(yyvsp[0].yint); } + break; + + case 135: +#line 496 "./pl.y" + { init_font_rule_entry(yyvsp[0].yint); } + break; + + case 140: +#line 509 "./pl.y" + { set_font_rule_measure(yyvsp[-1].yint, yyvsp[0].yfix); } + break; + + case 144: +#line 521 "./pl.y" + { init_font_glue_entry(yyvsp[0].yint); } + break; + + case 149: +#line 534 "./pl.y" + { set_font_glue_type(yyvsp[0].yint); } + break; + + case 150: +#line 536 "./pl.y" + { set_font_glue_width(yyvsp[0].yfix); } + break; + + case 151: +#line 538 "./pl.y" + { set_font_glue_character(yyvsp[0].yint); } + break; + + case 152: +#line 540 "./pl.y" + { set_font_glue_rule(yyvsp[-1].yint, yyvsp[0].yint); } + break; + + case 153: +#line 542 "./pl.y" + { set_font_glue_shrink_stretch(yyvsp[-2].yint, yyvsp[-1].yfix, yyvsp[0].yint); } + break; + + + } + +/* Line 999 of yacc.c. */ +#line 1837 "y.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + char *yymsg; + int yyx, yycount; + + yycount = 0; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + yysize += yystrlen (yytname[yyx]) + 15, yycount++; + yysize += yystrlen ("syntax error, unexpected ") + 1; + yysize += yystrlen (yytname[yytype]); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); + + if (yycount < 5) + { + yycount = 0; + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); + yyx++) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + const char *yyq = ! yycount ? ", expecting " : " or "; + yyp = yystpcpy (yyp, yyq); + yyp = yystpcpy (yyp, yytname[yyx]); + yycount++; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("syntax error; also virtual memory exhausted"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + /* Return failure if at end of input. */ + if (yychar == YYEOF) + { + /* Pop the error token. */ + YYPOPSTACK; + /* Pop the rest of the stack. */ + while (yyss < yyssp) + { + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + YYPOPSTACK; + } + YYABORT; + } + + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); + yychar = YYEMPTY; + + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[yystate], yyvsp); + yyvsp--; + yystate = *--yyssp; + + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + YYDPRINTF ((stderr, "Shifting error token, ")); + + *++yyvsp = yylval; + + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + return yyresult; +} + + + diff --git a/Build/source/texk/web2c/omegafonts/y_tab.h-dist b/Build/source/texk/web2c/omegafonts/y_tab.h-dist new file mode 100644 index 00000000000..6c108f3e665 --- /dev/null +++ b/Build/source/texk/web2c/omegafonts/y_tab.h-dist @@ -0,0 +1,214 @@ +/* A Bison parser, made by GNU Bison 1.875a. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + LEFT = 258, + RIGHT = 259, + NUMBER = 260, + FIX = 261, + COMMENT = 262, + CHECKSUM = 263, + DESIGNSIZE = 264, + DESIGNUNITS = 265, + CODINGSCHEME = 266, + FAMILY = 267, + FACE = 268, + SEVENBITSAFEFLAG = 269, + HEADER = 270, + FONTDIMEN = 271, + LIGTABLE = 272, + BOUNDARYCHAR = 273, + CHARACTER = 274, + NAMEDPARAMETER = 275, + PARAMETER = 276, + CHARMEASURE = 277, + NEXTLARGER = 278, + VARCHAR = 279, + EXTEN = 280, + LABEL = 281, + LIG = 282, + KRN = 283, + STOP = 284, + SKIP = 285, + VTITLE = 286, + MAPFONT = 287, + FONTNAME = 288, + FONTAREA = 289, + FONTCHECKSUM = 290, + FONTAT = 291, + FONTDSIZE = 292, + MAP = 293, + SELECTFONT = 294, + SETCHAR = 295, + SETRULE = 296, + MOVE = 297, + PUSH = 298, + POP = 299, + SPECIAL = 300, + SPECIALHEX = 301, + CHARREPEAT = 302, + FONTIVALUE = 303, + FONTFVALUE = 304, + FONTMVALUE = 305, + FONTPENALTY = 306, + FONTRULE = 307, + FONTGLUE = 308, + CLABEL = 309, + CKRN = 310, + CGLUE = 311, + CPENALTY = 312, + CPENGLUE = 313, + CHARIVALUE = 314, + CHARFVALUE = 315, + CHARMVALUE = 316, + CHARPENALTY = 317, + CHARRULE = 318, + CHARGLUE = 319, + IVALUE = 320, + IVALUEVAL = 321, + MVALUE = 322, + MVALUEVAL = 323, + FVALUE = 324, + FVALUEVAL = 325, + PENALTY = 326, + PENALTYVAL = 327, + RULE = 328, + RULEMEASURE = 329, + GLUE = 330, + GLUEWD = 331, + GLUETYPE = 332, + GLUEKIND = 333, + GLUERULE = 334, + GLUECHAR = 335, + GLUESHRINKSTRETCH = 336, + GLUEORDER = 337, + OFMLEVEL = 338, + FONTDIR = 339, + ACCENT = 340 + }; +#endif +#define LEFT 258 +#define RIGHT 259 +#define NUMBER 260 +#define FIX 261 +#define COMMENT 262 +#define CHECKSUM 263 +#define DESIGNSIZE 264 +#define DESIGNUNITS 265 +#define CODINGSCHEME 266 +#define FAMILY 267 +#define FACE 268 +#define SEVENBITSAFEFLAG 269 +#define HEADER 270 +#define FONTDIMEN 271 +#define LIGTABLE 272 +#define BOUNDARYCHAR 273 +#define CHARACTER 274 +#define NAMEDPARAMETER 275 +#define PARAMETER 276 +#define CHARMEASURE 277 +#define NEXTLARGER 278 +#define VARCHAR 279 +#define EXTEN 280 +#define LABEL 281 +#define LIG 282 +#define KRN 283 +#define STOP 284 +#define SKIP 285 +#define VTITLE 286 +#define MAPFONT 287 +#define FONTNAME 288 +#define FONTAREA 289 +#define FONTCHECKSUM 290 +#define FONTAT 291 +#define FONTDSIZE 292 +#define MAP 293 +#define SELECTFONT 294 +#define SETCHAR 295 +#define SETRULE 296 +#define MOVE 297 +#define PUSH 298 +#define POP 299 +#define SPECIAL 300 +#define SPECIALHEX 301 +#define CHARREPEAT 302 +#define FONTIVALUE 303 +#define FONTFVALUE 304 +#define FONTMVALUE 305 +#define FONTPENALTY 306 +#define FONTRULE 307 +#define FONTGLUE 308 +#define CLABEL 309 +#define CKRN 310 +#define CGLUE 311 +#define CPENALTY 312 +#define CPENGLUE 313 +#define CHARIVALUE 314 +#define CHARFVALUE 315 +#define CHARMVALUE 316 +#define CHARPENALTY 317 +#define CHARRULE 318 +#define CHARGLUE 319 +#define IVALUE 320 +#define IVALUEVAL 321 +#define MVALUE 322 +#define MVALUEVAL 323 +#define FVALUE 324 +#define FVALUEVAL 325 +#define PENALTY 326 +#define PENALTYVAL 327 +#define RULE 328 +#define RULEMEASURE 329 +#define GLUE 330 +#define GLUEWD 331 +#define GLUETYPE 332 +#define GLUEKIND 333 +#define GLUERULE 334 +#define GLUECHAR 335 +#define GLUESHRINKSTRETCH 336 +#define GLUEORDER 337 +#define OFMLEVEL 338 +#define FONTDIR 339 +#define ACCENT 340 + + + + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +extern YYSTYPE yylval; + + + |