diff options
| author | Ahmed ElTantawy <[email protected]> | 2016-05-13 08:06:17 -0700 |
|---|---|---|
| committer | Ahmed ElTantawy <[email protected]> | 2016-05-13 08:06:17 -0700 |
| commit | 0b95282e887e6cc6eb48d93d5aa51252588c3260 (patch) | |
| tree | cb19e2288b3dc9c28b3dfdf454ed12e64f0a5340 /libcuda/cuobjdump.l | |
| parent | 4bdf48ed2098e036da1503405c30b71f39be0e94 (diff) | |
getting the parsing compatible with previous version - tested on 4.2, 5.5 and 7.5
Diffstat (limited to 'libcuda/cuobjdump.l')
| -rw-r--r-- | libcuda/cuobjdump.l | 20 |
1 files changed, 13 insertions, 7 deletions
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*/ <sasscode>{notnewline}*{newline} yylval.string_value = strdup(yytext); return SASSLINE; -<identifier>"identifier = " BEGIN(identifierF); return H_IDENTIFIER; -<identifier>"\n" yy_pop_state(); +<identifier>{newline}"compressed"{newline} BEGIN(conidentifier); return H_COMPRESSED; +<identifier>{newline}"identifier = " BEGIN(endidentifier); return H_IDENTIFIER; +<identifier>{newline}{newline} yy_pop_state(); -<identifierF>{notnewline}+ yylval.string_value = strdup(yytext); yy_pop_state(); return FILENAME; + +<conidentifier>"identifier = " BEGIN(endidentifier); return H_IDENTIFIER; +<conidentifier>{newline} yy_pop_state(); + + +<endidentifier>{notnewline}+ yylval.string_value = strdup(yytext); yy_pop_state(); return FILENAME; @@ -128,8 +135,7 @@ newlines {newline}+ <ptxheader>\[{numeric},{numeric}\] return CODEVERSION; <ptxheader>"producer = " return H_PRODUCER; <ptxheader>"host = " return H_HOST; -<ptxheader>"compile_size = " return H_COMPILESIZE; -<ptxheader>"compressed"{newline} yy_pop_state(); return H_COMPRESSED; +<ptxheader>"compile_size = " BEGIN(endheader); return H_COMPILESIZE; |
