49 |
* and PREPROCESSOR_LINE as %start values, even if they are not used. |
* and PREPROCESSOR_LINE as %start values, even if they are not used. |
50 |
* It assumed that CPP_COMMENT and SHELL_COMMENT is one line comment. |
* It assumed that CPP_COMMENT and SHELL_COMMENT is one line comment. |
51 |
*/ |
*/ |
52 |
static int lineno; |
static int lexcommon_lineno; |
53 |
static int begin_line; |
static int begin_line; |
54 |
/* |
/* |
55 |
* If you want newline to terminate string, set this variable to 1. |
* If you want newline to terminate string, set this variable to 1. |
56 |
*/ |
*/ |
57 |
static int newline_terminate_string = 0; |
static int newline_terminate_string = 0; |
58 |
|
|
59 |
#define LINENO lineno |
#define LINENO lexcommon_lineno |
60 |
|
|
61 |
#define DEFAULT_BEGIN_OF_FILE_ACTION { \ |
#define DEFAULT_BEGIN_OF_FILE_ACTION { \ |
62 |
LEXIN = ip; \ |
LEXIN = ip; \ |
63 |
LEXRESTART(LEXIN); \ |
LEXRESTART(LEXIN); \ |
64 |
lineno = 1; \ |
LINENO = 1; \ |
65 |
begin_line = 1; \ |
begin_line = 1; \ |
66 |
} |
} |
67 |
|
|
68 |
#define DEFAULT_YY_USER_ACTION { \ |
#define DEFAULT_YY_USER_ACTION { \ |
69 |
if (begin_line) { \ |
if (begin_line) { \ |
70 |
put_begin_of_line(lineno); \ |
put_begin_of_line(LINENO); \ |
71 |
switch (YY_START) { \ |
switch (YY_START) { \ |
72 |
case C_COMMENT: \ |
case C_COMMENT: \ |
73 |
case CPP_COMMENT: \ |
case CPP_COMMENT: \ |
96 |
} \ |
} \ |
97 |
if (YY_START == PREPROCESSOR_LINE) \ |
if (YY_START == PREPROCESSOR_LINE) \ |
98 |
yy_pop_state(); \ |
yy_pop_state(); \ |
99 |
put_end_of_line(lineno); \ |
put_end_of_line(LINENO); \ |
100 |
/* for the next line */ \ |
/* for the next line */ \ |
101 |
lineno++; \ |
LINENO++; \ |
102 |
begin_line = 1; \ |
begin_line = 1; \ |
103 |
} |
} |
104 |
|
|
111 |
echos(comment_end); \ |
echos(comment_end); \ |
112 |
break; \ |
break; \ |
113 |
} \ |
} \ |
114 |
put_end_of_line(lineno); \ |
put_end_of_line(LINENO); \ |
115 |
/* for the next line */ \ |
/* for the next line */ \ |
116 |
lineno++; \ |
LINENO++; \ |
117 |
begin_line = 1; \ |
begin_line = 1; \ |
118 |
} |
} |
119 |
|
|