/[groff]/groff/src/preproc/tbl/main.cpp
ViewVC logotype

Diff of /groff/src/preproc/tbl/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by wlemb, Sun Aug 8 16:51:45 2004 UTC revision 1.6 by wl, Mon Sep 13 08:13:48 2004 UTC
# Line 26  Foundation, 59 Temple Place - Suite 330, Line 26  Foundation, 59 Temple Place - Suite 330,
26    
27  extern "C" const char *Version_string;  extern "C" const char *Version_string;
28    
29  static int compatible_flag = 0;  int compatible_flag = 0;
30    
31  class table_input {  class table_input {
32    FILE *fp;    FILE *fp;
33    enum { START, MIDDLE, REREAD_T, REREAD_TE, REREAD_E, END, ERROR } state;    enum { START, MIDDLE,
34             REREAD_T, REREAD_TE, REREAD_E,
35             LEADER_1, LEADER_2, LEADER_3, LEADER_4,
36             END, ERROR } state;
37    string unget_stack;    string unget_stack;
38  public:  public:
39    table_input(FILE *);    table_input(FILE *);
# Line 117  int table_input::get() Line 120  int table_input::get()
120        }        }
121        break;        break;
122      case MIDDLE:      case MIDDLE:
123        // handle line continuation        // handle line continuation and uninterpreted leader character
124        if ((c = getc(fp)) == '\\') {        if ((c = getc(fp)) == '\\') {
125          c = getc(fp);          c = getc(fp);
126          if (c == '\n')          if (c == '\n')
127            c = getc(fp);         // perhaps state ought to be START now            c = getc(fp);         // perhaps state ought to be START now
128            else if (c == 'a' && compatible_flag) {
129              state = LEADER_1;
130              return '\\';
131            }
132          else {          else {
133            if (c != EOF)            if (c != EOF)
134              ungetc(c, fp);              ungetc(c, fp);
# Line 152  int table_input::get() Line 159  int table_input::get()
159      case REREAD_E:      case REREAD_E:
160        state = MIDDLE;        state = MIDDLE;
161        return 'E';        return 'E';
162        case LEADER_1:
163          state = LEADER_2;
164          return '*';
165        case LEADER_2:
166          state = LEADER_3;
167          return '(';
168        case LEADER_3:
169          state = LEADER_4;
170          return PREFIX_CHAR;
171        case LEADER_4:
172          state = MIDDLE;
173          return LEADER_CHAR;
174      case END:      case END:
175      case ERROR:      case ERROR:
176        return EOF;        return EOF;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26