56 |
*/ |
*/ |
57 |
static int newline_terminate_string = 0; |
static int newline_terminate_string = 0; |
58 |
|
|
59 |
|
/* |
60 |
|
* Convert tabs to spaces. |
61 |
|
*/ |
62 |
|
static int dest_column; |
63 |
|
static int left_spaces; |
64 |
|
|
65 |
|
#define YY_INPUT(buf, result, max_size) do { \ |
66 |
|
int n = 0; \ |
67 |
|
while (n < max_size) { \ |
68 |
|
int c; \ |
69 |
|
if (left_spaces > 0) { \ |
70 |
|
left_spaces--; \ |
71 |
|
c = ' '; \ |
72 |
|
} else { \ |
73 |
|
c = getc(LEXIN); \ |
74 |
|
if (c == EOF) { \ |
75 |
|
if (ferror(LEXIN)) \ |
76 |
|
die("read error."); \ |
77 |
|
break; \ |
78 |
|
} \ |
79 |
|
if (c == '\t') { \ |
80 |
|
left_spaces = tabs - dest_column % tabs;\ |
81 |
|
continue; \ |
82 |
|
} \ |
83 |
|
} \ |
84 |
|
buf[n++] = c; \ |
85 |
|
dest_column++; \ |
86 |
|
if (c == '\n') \ |
87 |
|
dest_column = 0; \ |
88 |
|
} \ |
89 |
|
result = n; \ |
90 |
|
} while (0) |
91 |
|
|
92 |
#define LINENO lexcommon_lineno |
#define LINENO lexcommon_lineno |
93 |
|
|
94 |
#define DEFAULT_BEGIN_OF_FILE_ACTION { \ |
#define DEFAULT_BEGIN_OF_FILE_ACTION { \ |
96 |
LEXRESTART(LEXIN); \ |
LEXRESTART(LEXIN); \ |
97 |
LINENO = 1; \ |
LINENO = 1; \ |
98 |
begin_line = 1; \ |
begin_line = 1; \ |
99 |
|
dest_column = 0; \ |
100 |
|
left_spaces = 0; \ |
101 |
} |
} |
102 |
|
|
103 |
#define DEFAULT_YY_USER_ACTION { \ |
#define DEFAULT_YY_USER_ACTION { \ |