/* .Y / 70 83 / / / / 105 / / / / / / ;A4_QUER.Y */ /* .YT 3 2 0 0 3 3 1 / / / */ /* .H!a!0:io#092/disk#092/mediaAccess#092/grammar#092/cpp#092/Error.c!0.!c */ /*************************************************************************** io disk mediaAccess grammar Error.c +++++++++++++++++++++++++++++++++++ purpose : error handler for the grammar ("<...>/MediaInfo.y") of a "mediaAccess"-media- info-structure (/-text) begin : Wed Apr 12 16:14:39 CEST 2017 changes : copyright : (C) 2017 by Thomas Bruecker email : public@thomas-r-bruecker.ch version : -0.0.0 ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either Version 2 of the License, or * * (at your option) any later Version. * * * * This program is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301 USA. * * * ***************************************************************************/ #include #include "MediaInfo.h" #include "MediaInfo.tab.h" void carets(int n); void spaces(int n); void carets(int n) { int i; for(i = 0; i < n; i++) { fprintf(stderr, "^"); } } void spaces(int n) { int i; for(i = 0; i < n; i++) { fprintf(stderr, " "); } } void yyerror (char const* s) /* Called by yyparse on error */ { fprintf(stderr, "yyerror: %s\n", s); fprintf(stderr, "yyerror: %d,%d,%d,%d\n", yylloc.first_line, yylloc.first_column, yylloc.last_line, yylloc.last_column); fprintf(stderr, "yyerror: line# %5d: %s\n", yylloc.first_line, pLine); fprintf(stderr, "yyerror: "); spaces(yylloc.first_column); carets(yylloc.last_column - yylloc.first_column); fprintf(stderr, "\n"); }