summaryrefslogtreecommitdiff
path: root/libcuda/cuobjdump.l
diff options
context:
space:
mode:
authorMengchi Zhang <[email protected]>2019-04-21 22:32:26 -0400
committerMengchi Zhang <[email protected]>2019-04-21 22:32:26 -0400
commitb6631a07ca4aa0345f569b49116c649feadccc89 (patch)
tree57d2a0ad52c6b9801d65338e30e53dfada879e7a /libcuda/cuobjdump.l
parente6e9181f4c0706cc9d4b5172ba9f932f6a1bd03e (diff)
Add yyerror definition
Signed-off-by: Mengchi Zhang <[email protected]>
Diffstat (limited to 'libcuda/cuobjdump.l')
-rw-r--r--libcuda/cuobjdump.l11
1 files changed, 6 insertions, 5 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);
}