Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
50a0860a
Commit
50a0860a
authored
Nov 17, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #55 from albert-github/feature/debug_lex
Debug output for lexical analyzer
parents
e4b819d6
3c0a246b
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
79 additions
and
2 deletions
+79
-2
code.l
src/code.l
+6
-0
commentcnv.l
src/commentcnv.l
+2
-0
commentscan.l
src/commentscan.l
+2
-0
constexp.l
src/constexp.l
+3
-0
debug.cpp
src/debug.cpp
+1
-0
debug.h
src/debug.h
+2
-1
declinfo.l
src/declinfo.l
+2
-0
defargs.l
src/defargs.l
+3
-0
doctokenizer.l
src/doctokenizer.l
+2
-0
fortrancode.l
src/fortrancode.l
+2
-0
fortranscanner.l
src/fortranscanner.l
+5
-0
message.cpp
src/message.cpp
+28
-0
message.h
src/message.h
+1
-0
pre.l
src/pre.l
+2
-0
pycode.l
src/pycode.l
+2
-0
pyscanner.l
src/pyscanner.l
+2
-0
scanner.l
src/scanner.l
+5
-0
tclscanner.l
src/tclscanner.l
+5
-1
vhdlcode.l
src/vhdlcode.l
+2
-0
vhdlscanner.l
src/vhdlscanner.l
+2
-0
No files found.
src/code.l
View file @
50a0860a
...
...
@@ -3546,7 +3546,11 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
{
//printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
// exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>");
if (s.isEmpty()) return;
printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
TooltipManager::instance()->clearTooltips();
if (g_codeClassSDict==0)
{
...
...
@@ -3637,6 +3641,8 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
delete g_sourceFileDef;
g_sourceFileDef=0;
}
printlex(yy_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
return;
}
...
...
src/commentcnv.l
View file @
50a0860a
...
...
@@ -952,6 +952,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
g_condStack.clear();
g_condStack.setAutoDelete(TRUE);
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
isFixedForm = FALSE;
if (g_lang==SrcLangExt_Fortran)
{
...
...
@@ -981,6 +982,7 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
g_outBuf->at(g_outBuf->curPos())='\0';
msg("-------------\n%s\n-------------\n",g_outBuf->data());
}
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
...
...
src/commentscan.l
View file @
50a0860a
...
...
@@ -2818,6 +2818,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
g_spaceBeforeCmd.resize(0);
g_spaceBeforeIf.resize(0);
printlex(yy_flex_debug, TRUE, __FILE__, fileName ? fileName.data(): NULL);
if (!current->inbodyDocs.isEmpty() && isInbody) // separate in body fragments
{
current->inbodyDocs+="\n\n";
...
...
@@ -2894,6 +2895,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
//printf("position=%d parseMore=%d newEntryNeeded=%d\n",
// position,parseMore,newEntryNeeded);
printlex(yy_flex_debug, FALSE, __FILE__, fileName ? fileName.data(): NULL);
return parseMore;
}
...
...
src/constexp.l
View file @
50a0860a
...
...
@@ -21,6 +21,7 @@
#include "constexp.h"
#include "cppvalue.h"
#include "ce_parse.h" // generated header file
#include "message.h"
#define YY_NEVER_INTERACTIVE 1
#define YY_NO_INPUT 1
...
...
@@ -105,6 +106,7 @@ CONSTSUFFIX ([uU][lL]?[lL]?)|([lL][lL]?[uU]?)
bool parseconstexp(const char *fileName,int lineNr,const QCString &s)
{
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
//printf("Expression: `%s'\n",s.data());
g_constExpFileName = fileName;
g_constExpLineNr = lineNr;
...
...
@@ -113,6 +115,7 @@ bool parseconstexp(const char *fileName,int lineNr,const QCString &s)
constexpYYrestart( constexpYYin );
constexpYYparse();
//printf("Result: %ld\n",(long)g_resultValue);
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
return (long)g_resultValue!=0;
}
...
...
src/debug.cpp
View file @
50a0860a
...
...
@@ -46,6 +46,7 @@ static LabelMap s_labels[] =
{
"extcmd"
,
Debug
::
ExtCmd
},
{
"markdown"
,
Debug
::
Markdown
},
{
"filteroutput"
,
Debug
::
FilterOutput
},
{
"lex"
,
Debug
::
Lex
},
{
0
,
(
Debug
::
DebugMask
)
0
}
};
...
...
src/debug.h
View file @
50a0860a
...
...
@@ -36,7 +36,8 @@ class Debug
Time
=
0x00000200
,
ExtCmd
=
0x00000400
,
Markdown
=
0x00000800
,
FilterOutput
=
0x00001000
FilterOutput
=
0x00001000
,
Lex
=
0x00002000
};
static
void
print
(
DebugMask
mask
,
int
prio
,
const
char
*
fmt
,...);
static
int
setFlag
(
const
char
*
label
);
...
...
src/declinfo.l
View file @
50a0860a
...
...
@@ -231,6 +231,7 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
void parseFuncDecl(const QCString &decl,bool objC,QCString &cl,QCString &t,
QCString &n,QCString &a,QCString &ftl,QCString &exc)
{
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
inputString = decl;
//printf("Input=`%s'\n",inputString);
if (inputString==0) return;
...
...
@@ -307,6 +308,7 @@ void parseFuncDecl(const QCString &decl,bool objC,QCString &cl,QCString &t,
//printf("type=`%s' class=`%s' name=`%s' args=`%s'\n",
// t.data(),cl.data(),n.data(),a.data());
printlex(yy_flex_debug, FALSE, __FILE__, NULL);
return;
...
...
src/defargs.l
View file @
50a0860a
...
...
@@ -55,6 +55,7 @@
#include "entry.h"
#include "util.h"
#include "arguments.h"
#include "message.h"
#define YY_NEVER_INTERACTIVE 1
#define YY_NO_INPUT 1
...
...
@@ -527,6 +528,7 @@ void stringToArgumentList(const char *argsString,ArgumentList* al,QCString *extr
{
if (al==0) return;
if (argsString==0) return;
printlex(yy_flex_debug, TRUE, __FILE__, NULL);
g_copyArgValue=0;
g_curArgDocs.resize(0);
...
...
@@ -549,6 +551,7 @@ void stringToArgumentList(const char *argsString,ArgumentList* al,QCString *extr
defargsYYlex();
if (extraTypeChars) *extraTypeChars=g_extraTypeChars;
//printf("stringToArgumentList(%s) result=%s\n",argsString,argListToString(al).data());
printlex(yy_flex_debug, FALSE, __FILE__, NULL);
}
#if !defined(YY_FLEX_SUBMINOR_VERSION)
...
...
src/doctokenizer.l
View file @
50a0860a
...
...
@@ -1189,6 +1189,7 @@ void doctokenizerYYFindSections(const char *input,Definition *d,
MemberGroup *mg,const char *fileName)
{
if (input==0) return;
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
g_inputString = input;
//printf("parsing --->`%s'<---\n",input);
g_inputPos = 0;
...
...
@@ -1198,6 +1199,7 @@ void doctokenizerYYFindSections(const char *input,Definition *d,
BEGIN(St_Sections);
doctokenizerYYlineno = 1;
doctokenizerYYlex();
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
void doctokenizerYYinit(const char *input,const char *fileName)
...
...
src/fortrancode.l
View file @
50a0860a
...
...
@@ -1115,6 +1115,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
(void)className;
if (s.isEmpty()) return;
printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
TooltipManager::instance()->clearTooltips();
g_code = &od;
g_inputString = s;
...
...
@@ -1174,6 +1175,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
delete g_sourceFileDef;
g_sourceFileDef=0;
}
printlex(yy_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
return;
}
...
...
src/fortranscanner.l
View file @
50a0860a
...
...
@@ -2339,7 +2339,12 @@ void FortranLanguageScanner::parseInput(const char *fileName,
QStrList & /*filesInSameTranslationUnit*/)
{
g_thisParser = this;
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
::parseMain(fileName,fileBuf,root);
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
void FortranLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
...
...
src/message.cpp
View file @
50a0860a
...
...
@@ -211,3 +211,31 @@ void err(const char *fmt, ...)
vfprintf
(
warnFile
,
(
QCString
(
error_str
)
+
fmt
).
data
(),
args
);
va_end
(
args
);
}
void
printlex
(
int
dbg
,
bool
enter
,
const
char
*
lexName
,
const
char
*
fileName
)
{
char
*
enter_txt
=
"entering"
;
char
*
enter_txt_uc
=
"Entering"
;
if
(
!
enter
)
{
enter_txt
=
"finished"
;
enter_txt_uc
=
"Finished"
;
}
if
(
dbg
)
{
if
(
fileName
)
fprintf
(
stderr
,
"--%s lexical analyzer: %s (for: %s)
\n
"
,
enter_txt
,
lexName
,
fileName
);
else
fprintf
(
stderr
,
"--%s lexical analyzer: %s
\n
"
,
enter_txt
,
lexName
);
}
else
{
if
(
fileName
)
Debug
::
print
(
Debug
::
Lex
,
0
,
"%s lexical analyzer: %s (for: %s)
\n
"
,
enter_txt_uc
,
lexName
,
fileName
);
else
Debug
::
print
(
Debug
::
Lex
,
0
,
"%s lexical analyzer: %s
\n
"
,
enter_txt_uc
,
lexName
);
}
}
src/message.h
View file @
50a0860a
...
...
@@ -29,4 +29,5 @@ extern void warn_uncond(const char *fmt, ...);
extern
void
err
(
const
char
*
fmt
,
...);
void
initWarningFormat
();
extern
void
printlex
(
int
dbg
,
bool
enter
,
const
char
*
lexName
,
const
char
*
fileName
);
#endif
src/pre.l
View file @
50a0860a
...
...
@@ -2969,6 +2969,7 @@ void cleanUpPreprocessor()
void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
{
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
uint orgOffset=output.curPos();
//printf("##########################\n%s\n####################\n",
// input.data());
...
...
@@ -3177,6 +3178,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
}
}
DefineManager::instance().endContext();
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
void preFreeScanner()
...
...
src/pycode.l
View file @
50a0860a
...
...
@@ -1434,6 +1434,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
//--------------------------------------
if (s.isEmpty()) return;
printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
TooltipManager::instance()->clearTooltips();
g_code = &od;
g_inputString = s;
...
...
@@ -1494,6 +1495,7 @@ void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
delete g_sourceFileDef;
g_sourceFileDef=0;
}
printlex(yy_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
return;
}
...
...
src/pyscanner.l
View file @
50a0860a
...
...
@@ -1686,7 +1686,9 @@ void PythonLanguageScanner::parseInput(const char *fileName,
QStrList & /*filesInSameTranslationUnit*/)
{
g_thisParser = this;
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
::parseMain(fileName,fileBuf,root);
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
// May print the AST for debugging purposes
// printAST(global_root);
...
...
src/scanner.l
View file @
50a0860a
...
...
@@ -6893,8 +6893,13 @@ void CLanguageScanner::parseInput(const char *fileName,
QStrList & filesInSameTranslationUnit)
{
g_thisParser = this;
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
::parseMain(fileName,fileBuf,root,
sameTranslationUnit,filesInSameTranslationUnit);
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
void CLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
...
...
src/tclscanner.l
View file @
50a0860a
...
...
@@ -127,7 +127,7 @@ int TclFindElement(
goto done;
}
if (*p == '{')
if (*p == '{')
/* } to keep vi happy */
{
openBraces = 1;
p++;
...
...
@@ -2541,6 +2541,7 @@ tcl_inf("%s\n",fileName);
tcl.input_string = input;
if (tcl.input_string.length()<1) return;
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
msg("Parsing %s...\n",fileName);
groupEnterFile(fileName,yylineno);
...
...
@@ -2554,6 +2555,7 @@ tcl_inf("%s\n",fileName);
groupLeaveFile(tcl.file_name,yylineno);
root->program.resize(0);
myFile.close();
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
//! Parse file and codify.
...
...
@@ -2583,6 +2585,7 @@ void TclLanguageScanner::parseCode(CodeOutputInterface & codeOutIntf,
(void)collectXRefs;
if (input.length()<1) return;
printlex(yy_flex_debug, TRUE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
tcl.input_string = input;
QCString myNs="";
...
...
@@ -2655,6 +2658,7 @@ tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inli
tcl.cl.clear();
tcl.fn.clear();
tcl.entry.clear();
printlex(yy_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
}
bool TclLanguageScanner::needsPreprocessing(const QCString &extension)
...
...
src/vhdlcode.l
View file @
50a0860a
...
...
@@ -1517,6 +1517,7 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString
{
//printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
if (s.isEmpty()) return;
printlex(yy_flex_debug, TRUE, __FILE__, fd ? fd->fileName().data(): NULL);
TooltipManager::instance()->clearTooltips();
if (memberDef)
{
...
...
@@ -1599,6 +1600,7 @@ void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString
g_sourceFileDef=0;
}
g_startCode=FALSE;
printlex(yy_flex_debug, FALSE, __FILE__, fd ? fd->fileName().data(): NULL);
}
void codeFreeVhdlScanner()
...
...
src/vhdlscanner.l
View file @
50a0860a
...
...
@@ -763,6 +763,7 @@ void VHDLLanguageScanner::parseInput(const char *fileName,
VhdlDocGen::parseUCF(fileBuf,root,yyFileName,TRUE);
return;
}
printlex(yy_flex_debug, TRUE, __FILE__, fileName);
::parserInit();
yycont=getVhdlCont();
...
...
@@ -791,6 +792,7 @@ void VHDLLanguageScanner::parseInput(const char *fileName,
free(lineIndex);
inputFile.close();
mapLibPackage(root);
printlex(yy_flex_debug, FALSE, __FILE__, fileName);
}
void VHDLLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment