Show fileline in bison debug.

This commit is contained in:
Wilson Snyder 2012-12-02 18:03:34 -05:00
parent de8b040e31
commit 2238fa46ed
2 changed files with 3 additions and 2 deletions

View File

@ -1149,7 +1149,8 @@ int V3ParseImp::lexToBison() {
int tok = lexToken(); int tok = lexToken();
//yylval.scp = NULL; // Symbol table not yet needed - no packages //yylval.scp = NULL; // Symbol table not yet needed - no packages
if (debugFlex()>=6 || debugBison()>=6) { if (debugFlex()>=6 || debugBison()>=6) {
cout<<" lexToBison TOKEN="<<tok<<" "<<tokenName(tok); cout<<" {"<<yylval.fl->filenameLetters()<<yylval.fl->lineno()
<<"} lexToBison TOKEN="<<tok<<" "<<tokenName(tok);
if (tok == yaID__ETC || tok == yaID__LEX || tok == yaID__aTYPE) { if (tok == yaID__ETC || tok == yaID__LEX || tok == yaID__aTYPE) {
cout<<" strp='"<<*(yylval.strp)<<"'"; cout<<" strp='"<<*(yylval.strp)<<"'";
} }

View File

@ -3185,7 +3185,7 @@ idDotted<nodep>:
idDottedMore<nodep>: idDottedMore<nodep>:
idArrayed { $$ = $1; } idArrayed { $$ = $1; }
| idDotted '.' idArrayed { $$ = new AstDot($2,$1,$3); } | idDottedMore '.' idArrayed { $$ = new AstDot($2,$1,$3); }
; ;
// Single component of dotted path, maybe [#]. // Single component of dotted path, maybe [#].