21 |
yylloc->first_line = yylineno; \ |
yylloc->first_line = yylineno; \ |
22 |
yylloc->last_line = yylineno; \ |
yylloc->last_line = yylineno; \ |
23 |
yylloc->first_column = yycolumn; \ |
yylloc->first_column = yycolumn; \ |
24 |
|
yylloc->first_byte = yyextra->nbytes; \ |
25 |
|
yylloc->length_bytes = (int) yyleng; \ |
26 |
yycolumn += yyleng; \ |
yycolumn += yyleng; \ |
27 |
|
yyextra->nbytes += (int) yyleng; \ |
28 |
yylloc->last_column = yycolumn - 1; \ |
yylloc->last_column = yycolumn - 1; \ |
29 |
/*printf("lex: line '%s'\n", yytext);*/ \ |
/*printf("lex: line '%s'\n", yytext);*/ \ |
30 |
} |
} |
41 |
} |
} |
42 |
|
|
43 |
static void scanner_error(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* err) { |
static void scanner_error(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* err) { |
44 |
context->addErr(locp->first_line, locp->last_line, locp->first_column, locp->last_column, err); |
context->addErr(locp->first_line, locp->last_line, locp->first_column, |
45 |
|
locp->last_column, locp->first_byte, locp->length_bytes, |
46 |
|
err); |
47 |
} |
} |
48 |
|
|
49 |
static void scanner_warning(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* txt) { |
static void scanner_warning(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* txt) { |
50 |
context->addWrn(locp->first_line, locp->last_line, locp->first_column, locp->last_column, txt); |
context->addWrn(locp->first_line, locp->last_line, locp->first_column, |
51 |
|
locp->last_column, locp->first_byte, locp->length_bytes, |
52 |
|
txt); |
53 |
} |
} |
54 |
|
|
55 |
#define SCANNER_ERR(txt) scanner_error(yylloc, yyextra, txt) |
#define SCANNER_ERR(txt) scanner_error(yylloc, yyextra, txt) |
340 |
<PREPROC_BODY_EAT>.* { /* eat up code block filtered out by preprocessor */ |
<PREPROC_BODY_EAT>.* { /* eat up code block filtered out by preprocessor */ |
341 |
//printf("PREPROCESSOR EAT3 : {%s}\n", yytext); |
//printf("PREPROCESSOR EAT3 : {%s}\n", yytext); |
342 |
yyextra->addPreprocessorComment(yylloc->first_line, yylloc->last_line, |
yyextra->addPreprocessorComment(yylloc->first_line, yylloc->last_line, |
343 |
yylloc->first_column+1, yylloc->last_column+1); |
yylloc->first_column+1, yylloc->last_column+1, |
344 |
|
yylloc->first_byte, yylloc->length_bytes); |
345 |
} |
} |
346 |
|
|
347 |
|
|