CppParser
|
#include <parser.l.h>
Definition at line 84 of file parser.l.h.
CodeEnablementInfoStack LexerData::codeEnablementInfoStack |
Definition at line 139 of file parser.l.h.
bool LexerData::codeSegmentDependsOnMacroDefinition = false |
Definition at line 143 of file parser.l.h.
CodeEnablementInfo LexerData::currentCodeEnablementInfo |
Definition at line 140 of file parser.l.h.
BracketDepthStack LexerData::mBracketDepthStack = {0} |
We need to keep track of where we are inside the nest of brackets for knowing when we can tokenize comments. Since we only want to preserve free standing comments and some side comments (in future improvements) we need to always ignore comments that are inside square brackets, i.e. []. We also need to ignore comments that are inside round brackets, i.e. (), except when we are inside lambda which is being passed to a function as parameter: func([]() {
This comment should be preserved even when we are eventually inside a round bracket } // And this comment should be ignored ); // This one too
Definition at line 130 of file parser.l.h.
DefineLooksLike LexerData::mDefLooksLike = DefineLooksLike::kNoDef |
Definition at line 137 of file parser.l.h.
bool LexerData::mEnumBodyWillBeEncountered = false |
Definition at line 95 of file parser.l.h.
const char* LexerData::mExpectedBracePosition = nullptr |
Definition at line 102 of file parser.l.h.
const char* LexerData::mExpectedColonPosition = nullptr |
Definition at line 103 of file parser.l.h.
const char* LexerData::mExpectedRShiftOperator = nullptr |
Definition at line 107 of file parser.l.h.
bool LexerData::mFunctionBodyWillBeEncountered = false |
Definition at line 100 of file parser.l.h.
const char* LexerData::mInputBuffer = nullptr |
Definition at line 89 of file parser.l.h.
size_t LexerData::mInputBufferSize = 0 |
Definition at line 90 of file parser.l.h.
int LexerData::mLexLog = 0 |
Definition at line 86 of file parser.l.h.
int LexerData::mLineNo = 1 |
Definition at line 87 of file parser.l.h.
bool LexerData::mMemInitListWillBeEncountered = false |
Definition at line 101 of file parser.l.h.
int LexerData::mNestedCurlyBracketDepth = 0 |
It is currently used for parsing function body as a blob.
Definition at line 135 of file parser.l.h.
const char* LexerData::mNotAMemInitColon = nullptr |
Definition at line 99 of file parser.l.h.
const char* LexerData::mOldYytext = nullptr |
Definition at line 92 of file parser.l.h.
const char* LexerData::mPossibleFuncImplStartBracePosition = nullptr |
Definition at line 104 of file parser.l.h.
bool LexerData::mTokenizeComment = true |
Comments can appear anywhere in a C/C++ program and unfortunately not all coments can be preserved.
mTokenizeComment is a flag used to decide if we can tokenize comments.
For details of what kind of comments are preserved and what kind are lost, see file test/e2e/test_input/comment_test.h
Definition at line 117 of file parser.l.h.
bool LexerData::parseDisabledCodeAsBlob = false |
Definition at line 142 of file parser.l.h.