diff options
| author | Mengchi Zhang <[email protected]> | 2019-04-21 22:32:26 -0400 |
|---|---|---|
| committer | Mengchi Zhang <[email protected]> | 2019-04-21 22:32:26 -0400 |
| commit | b6631a07ca4aa0345f569b49116c649feadccc89 (patch) | |
| tree | 57d2a0ad52c6b9801d65338e30e53dfada879e7a /libcuda | |
| parent | e6e9181f4c0706cc9d4b5172ba9f932f6a1bd03e (diff) | |
Add yyerror definition
Signed-off-by: Mengchi Zhang <[email protected]>
Diffstat (limited to 'libcuda')
| -rw-r--r-- | libcuda/cuobjdump.l | 11 | ||||
| -rw-r--r-- | libcuda/cuobjdump.y | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/libcuda/cuobjdump.l b/libcuda/cuobjdump.l index 9a468ba..9359281 100644 --- a/libcuda/cuobjdump.l +++ b/libcuda/cuobjdump.l @@ -38,7 +38,7 @@ #define YYDEBUG 1 -void print_error(const char*, const char*, int); +void cuobjdump_error(yyscan_t yyscanner, const char* msg); %} %option stack @@ -153,11 +153,12 @@ newlines {newline}+ <<EOF>> BEGIN(INITIAL);return 0; /*No other rule matched. Throw an error*/ -. print_error("Invalid token", yytext, yylineno); +. cuobjdump_error(yyscanner, "Invalid token"); %% -void print_error(const char* message, const char* text, int lineno) +void cuobjdump_error(yyscan_t yyscanner, const char* msg) { - printf(" %s near \"%s\"",message, text); - printf(" on line %i\n",lineno); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + printf(" %s near \"%s\"",msg, yytext); + printf(" on line %i\n",yylineno); } diff --git a/libcuda/cuobjdump.y b/libcuda/cuobjdump.y index 927d17e..66cbace 100644 --- a/libcuda/cuobjdump.y +++ b/libcuda/cuobjdump.y @@ -53,7 +53,7 @@ char filename [1024]; } %{ int yylex(YYSTYPE * yylval_param, yyscan_t yyscanner); -int yyerror(yyscan_t yyscanner, const char* msg); +void yyerror(yyscan_t yyscanner, const char* msg); %} %token <string_value> H_SEPARATOR H_ARCH H_CODEVERSION H_PRODUCER H_HOST H_COMPILESIZE H_IDENTIFIER H_UNKNOWN H_COMPRESSED %token <string_value> CODEVERSION |
