When looking at the code of e.g. scanner.l in the doxygen internal documentation and looking at the prototype of the function `stateToString` this function is linked to the same function in the fortranscanner (although this should no happen as the function is `static`).
Due to the fact that the `stateToString` functionality is only enabled in the fortranscanner, but in the other lex scanners the prototype and the implementation is hidden inside a `#if` block but the (lex)code scanners still find it as it does not take the `#if` into account.
- enable the functionality of `stateToString` everywhere even when not used
- make the prototypes `[[maybe_unused]]` to satisfy the compilers (warnings)
- adjust `pre.l` so that the counting of the open / close brackets is correct when they are used in the rules (code taken from lexscanner.l)
- some minor fixes to keep the preprocessor happy (commands in regular comments, escape double quotes in `[...]` part of the rules
- Debug builds now have lex debugging compiled in by default
- For a release build option `enable_lex_debug` can enabled to compile
in debug support.
- Option `-d lex` will now turn on debugging output for all lexers.
- Option `-d lex:name` will turn on debugging for lexer `name` only.
This is based on the warning type: C4800: Implicit conversion from 'type' to bool. Possible information loss
A real bug was found in the writing out of the boolean replacement values in configgen.py. The boolean values got double quotes and the string would always result in true instead of the intended value
The various code parsers now have `insideCodeLine` boolean state variable that replaces
the `needsTermination` and keeps track if the parser in inside a line or not.
This information is now passe between lexcode.l and code.l to make sure the start
and end codelines stay balanced.
In writeLineNumber replaced includeCodeFragment by writeLineAnchor
and reversed the logic. This makes it clearer what the parameter does
in the context of writing a line of code.
In case we have included sources (e.g. due to `INLINE_SOURCES`) and also the `SOURCE_BROWSER` enabled it is possible that we get double labels.
Also the calculation of labels in RTF was not done consistently, sometimes the path was striper and on other moments it wasn;t (especially seen in case CREATE_SUBDIRS
The problem was found using RTF / Docbook on the doxygen internal documentation (not standard) but will happen too in other projects
- make filtering if detailed section is present more inline with
contents
- split of MemberVector as simpler version of MemberList
- introduce MemberListContainer type as a replacement for inFile and
inGroup booleans.
- improved const use a bit
In case we have a serious problem in a lexer it is sometimes hard to find what the initial file and lexer is as we only get a general message like:
```
input buffer overflow, can't enlarge buffer because scanner uses REJECT
```
by overruling the macro `YY_FATAAL_ERROR` we can provide a better message.
This commit changes the following in relation to string use
- The implicit convert from 'QCString' to 'const char *' is removed
- Strings parameters use 'const QCString &' as much as possible in favor
over 'const char *'
- 'if (s)' where s is a QCString has been replaced by 'if(!s.isEmpty())'
- data() now always returns a valid C-string and not a 0-pointer.
- when passing a string 's' to printf and related functions 'qPrint(s)' is
used instead of 's.data()'
- for empty string arguments 'QCString()' is used instead of '0'
- The copy() operation has been removed
- Where possible 'qstrcmp(a,b)==0' has been replaces by 'a==b' and
'qstrcmp(a,b)<0' has been replaced by 'a<b'
- Parameters of string type that were default initialized with '= 0' are
no initialized with '= QCString()'
- Correct handling of C comment start and end tokens as well as Cpp comment start in rules. These tokes can give "Reached end of file while still inside a (nested) comment..."
- Correct other warnings in respect to lex files
Remove warnings (Windows 64 bit compilation) like:
```
warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data
```
from the different lexers by making use of more consistent data types.
Besides "keep utf8 characters together..." as done for the C-type parser in code.l (commit d3d9dd8540) this also has to be done for the Fortran, SQL and VHDL code lexers. The code lexers for python and xml already didn't give errors as they already handled these cases for the example.
Create a consistent way to display the state mnemonics of the different scanners (analogous to the fortranscanner.l)
Use an automatic procedure to generate the routine with the translation of the states to a string.
* put the global variables in struct sqlcodeYY_state.
* globally define yyscanner and sqlcode_extra. these two should be per-thread.
* add a new yyscan_t function parameter when these functions are referenced:
- yyin, yyout, yyextra, yyleng, yytext, yylineno, yycolumn, and yy_flex_debug.
- the macros BEGIN, YY_START, YYSTATE, yymore, unput, and yyless
- the functions that deal with input buffers: yyrestart
- others: yy_switch_to_buffer, yy_create_buffer, yy_delete_buffer,
yy_flush_buffer, yypush_buffer_state, yypop_buffer_state,
yy_scan_buffer, yy_scan_string, and yy_scan_bytes
* add a new yyscan_t function parameter when globals are referenced,
to get the yyextra out of the yyscanner.
The tooltips (XHTML) should not be displayed per code fragment but for the entire (output) file as otherwise tooltips might be added multiple times resulting in double IDs.