23 |
#define scanner context->scanner |
#define scanner context->scanner |
24 |
#define PARSE_ERR(loc,txt) yyerror(&loc, context, txt) |
#define PARSE_ERR(loc,txt) yyerror(&loc, context, txt) |
25 |
#define PARSE_WRN(loc,txt) InstrScript_warning(&loc, context, txt) |
#define PARSE_WRN(loc,txt) InstrScript_warning(&loc, context, txt) |
26 |
#define PARSE_DROP(loc) context->addPreprocessorComment(loc.first_line, loc.last_line, loc.first_column+1, loc.last_column+1); |
#define PARSE_DROP(loc) \ |
27 |
|
context->addPreprocessorComment( \ |
28 |
|
loc.first_line, loc.last_line, loc.first_column+1, \ |
29 |
|
loc.last_column+1, loc.first_byte, loc.length_bytes \ |
30 |
|
); |
31 |
#define yytnamerr(res,str) InstrScript_tnamerr(res, str) |
#define yytnamerr(res,str) InstrScript_tnamerr(res, str) |
32 |
%} |
%} |
33 |
|
|
1306 |
|
|
1307 |
void InstrScript_error(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* err) { |
void InstrScript_error(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* err) { |
1308 |
//fprintf(stderr, "%d: %s\n", locp->first_line, err); |
//fprintf(stderr, "%d: %s\n", locp->first_line, err); |
1309 |
context->addErr(locp->first_line, locp->last_line, locp->first_column+1, locp->last_column+1, err); |
context->addErr(locp->first_line, locp->last_line, locp->first_column+1, |
1310 |
|
locp->last_column+1, locp->first_byte, locp->length_bytes, |
1311 |
|
err); |
1312 |
} |
} |
1313 |
|
|
1314 |
void InstrScript_warning(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* txt) { |
void InstrScript_warning(YYLTYPE* locp, LinuxSampler::ParserContext* context, const char* txt) { |
1315 |
//fprintf(stderr, "WRN %d: %s\n", locp->first_line, txt); |
//fprintf(stderr, "WRN %d: %s\n", locp->first_line, txt); |
1316 |
context->addWrn(locp->first_line, locp->last_line, locp->first_column+1, locp->last_column+1, txt); |
context->addWrn(locp->first_line, locp->last_line, locp->first_column+1, |
1317 |
|
locp->last_column+1, locp->first_byte, locp->length_bytes, |
1318 |
|
txt); |
1319 |
} |
} |
1320 |
|
|
1321 |
/// Custom implementation of yytnamerr() to ensure quotation is always stripped from token names before printing them to error messages. |
/// Custom implementation of yytnamerr() to ensure quotation is always stripped from token names before printing them to error messages. |