From 0b95282e887e6cc6eb48d93d5aa51252588c3260 Mon Sep 17 00:00:00 2001 From: Ahmed ElTantawy Date: Fri, 13 May 2016 08:06:17 -0700 Subject: getting the parsing compatible with previous version - tested on 4.2, 5.5 and 7.5 --- libcuda/cuobjdump.l | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'libcuda/cuobjdump.l') diff --git a/libcuda/cuobjdump.l b/libcuda/cuobjdump.l index c86a861..f63ee73 100644 --- a/libcuda/cuobjdump.l +++ b/libcuda/cuobjdump.l @@ -55,8 +55,9 @@ void cuobjdump_error(const char*); %s elfheader %s ptxheader %s endheader -%s identifier -%s identifierF +%x identifier +%x conidentifier +%s endidentifier alpha [a-zA-Z] numeric [0-9] @@ -101,10 +102,16 @@ newlines {newline}+ /*SASS code tokens*/ {notnewline}*{newline} yylval.string_value = strdup(yytext); return SASSLINE; -"identifier = " BEGIN(identifierF); return H_IDENTIFIER; -"\n" yy_pop_state(); +{newline}"compressed"{newline} BEGIN(conidentifier); return H_COMPRESSED; +{newline}"identifier = " BEGIN(endidentifier); return H_IDENTIFIER; +{newline}{newline} yy_pop_state(); -{notnewline}+ yylval.string_value = strdup(yytext); yy_pop_state(); return FILENAME; + +"identifier = " BEGIN(endidentifier); return H_IDENTIFIER; +{newline} yy_pop_state(); + + +{notnewline}+ yylval.string_value = strdup(yytext); yy_pop_state(); return FILENAME; @@ -128,8 +135,7 @@ newlines {newline}+ \[{numeric},{numeric}\] return CODEVERSION; "producer = " return H_PRODUCER; "host = " return H_HOST; -"compile_size = " return H_COMPILESIZE; -"compressed"{newline} yy_pop_state(); return H_COMPRESSED; +"compile_size = " BEGIN(endheader); return H_COMPILESIZE; -- cgit v1.3