summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-02-12 17:02:11 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-02-12 17:02:11 (GMT)
commit77c63397e832a7ad5c618b1aed7fc5de25ff6e89 (patch)
treee885da91ffeb6ab98455c4fd31598f5fd467d047 /src/code.l
parent4d8e0f3abdf682e323db79aec176854f2a8aa699 (diff)
downloadDoxygen-77c63397e832a7ad5c618b1aed7fc5de25ff6e89.zip
Doxygen-77c63397e832a7ad5c618b1aed7fc5de25ff6e89.tar.gz
Doxygen-77c63397e832a7ad5c618b1aed7fc5de25ff6e89.tar.bz2
Adding support for lex files
Adding support for lex. The lex files consist of a mixture of lex specific structures, that are handled in the the lexcode.l and lexscanner.l, abd C code that is handled by the C parsers (hence the rules used are partly copied from scanner.l). Special attention has been paid to memberdef.cpp as the initial values should not be handled by the lex parsers but by the C parsers.
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/code.l b/src/code.l
index 233a4f0..083660b 100644
--- a/src/code.l
+++ b/src/code.l
@@ -98,6 +98,11 @@ struct codeYY_state
QCString parmType;
QCString parmName;
+ bool beginCodeLine = true; //!< signals whether or not we should with the first line
+ //!< write a start line code or not. Essential
+ //!< when this code parser is called from another
+ //!< code parser.
+
const char * inputString = 0; //!< the code fragment as text
yy_size_t inputPosition = 0; //!< read offset during parsing
int inputLines = 0; //!< number of line in the code fragment
@@ -3788,6 +3793,12 @@ void CCodeParser::resetCodeParserState()
yyextra->anchorCount = 0;
}
+void CCodeParser::setStartCodeLine(const bool inp)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+ yyextra->beginCodeLine = inp;
+}
+
void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const QCString &s,
SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
int startLine,int endLine,bool inlineFragment,
@@ -3862,7 +3873,8 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
}
yyextra->includeCodeFragment = inlineFragment;
//printf("** exBlock=%d exName=%s include=%d\n",exBlock,exName,inlineFragment);
- startCodeLine(yyscanner);
+
+ if (yyextra->beginCodeLine) startCodeLine(yyscanner);
yyextra->type.resize(0);
yyextra->name.resize(0);
yyextra->args.resize(0);