CppParser
Loading...
Searching...
No Matches
LexerData Struct Reference

#include <parser.l.h>

Collaboration diagram for LexerData:
Collaboration graph

Public Attributes

int mLexLog = 0
 
int mLineNo = 1
 
const char * mInputBuffer = nullptr
 
size_t mInputBufferSize = 0
 
const char * mOldYytext = nullptr
 
bool mEnumBodyWillBeEncountered = false
 
const char * mNotAMemInitColon = nullptr
 
bool mFunctionBodyWillBeEncountered = false
 
bool mMemInitListWillBeEncountered = false
 
const char * mExpectedBracePosition = nullptr
 
const char * mExpectedColonPosition = nullptr
 
const char * mPossibleFuncImplStartBracePosition = nullptr
 
const char * mExpectedRShiftOperator = nullptr
 
bool mTokenizeComment = true
 Comments can appear anywhere in a C/C++ program and unfortunately not all coments can be preserved. More...
 
BracketDepthStack mBracketDepthStack = {0}
 
int mNestedCurlyBracketDepth = 0
 It is currently used for parsing function body as a blob. More...
 
DefineLooksLike mDefLooksLike = DefineLooksLike::kNoDef
 
CodeEnablementInfoStack codeEnablementInfoStack
 
CodeEnablementInfo currentCodeEnablementInfo
 
bool parseDisabledCodeAsBlob = false
 
bool codeSegmentDependsOnMacroDefinition = false
 

Detailed Description

Definition at line 84 of file parser.l.h.

Member Data Documentation

◆ codeEnablementInfoStack

CodeEnablementInfoStack LexerData::codeEnablementInfoStack

Definition at line 139 of file parser.l.h.

◆ codeSegmentDependsOnMacroDefinition

bool LexerData::codeSegmentDependsOnMacroDefinition = false

Definition at line 143 of file parser.l.h.

◆ currentCodeEnablementInfo

CodeEnablementInfo LexerData::currentCodeEnablementInfo

Definition at line 140 of file parser.l.h.

◆ mBracketDepthStack

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.

◆ mDefLooksLike

DefineLooksLike LexerData::mDefLooksLike = DefineLooksLike::kNoDef

Definition at line 137 of file parser.l.h.

◆ mEnumBodyWillBeEncountered

bool LexerData::mEnumBodyWillBeEncountered = false

Definition at line 95 of file parser.l.h.

◆ mExpectedBracePosition

const char* LexerData::mExpectedBracePosition = nullptr

Definition at line 102 of file parser.l.h.

◆ mExpectedColonPosition

const char* LexerData::mExpectedColonPosition = nullptr

Definition at line 103 of file parser.l.h.

◆ mExpectedRShiftOperator

const char* LexerData::mExpectedRShiftOperator = nullptr

Definition at line 107 of file parser.l.h.

◆ mFunctionBodyWillBeEncountered

bool LexerData::mFunctionBodyWillBeEncountered = false

Definition at line 100 of file parser.l.h.

◆ mInputBuffer

const char* LexerData::mInputBuffer = nullptr

Definition at line 89 of file parser.l.h.

◆ mInputBufferSize

size_t LexerData::mInputBufferSize = 0

Definition at line 90 of file parser.l.h.

◆ mLexLog

int LexerData::mLexLog = 0

Definition at line 86 of file parser.l.h.

◆ mLineNo

int LexerData::mLineNo = 1

Definition at line 87 of file parser.l.h.

◆ mMemInitListWillBeEncountered

bool LexerData::mMemInitListWillBeEncountered = false

Definition at line 101 of file parser.l.h.

◆ mNestedCurlyBracketDepth

int LexerData::mNestedCurlyBracketDepth = 0

It is currently used for parsing function body as a blob.

Definition at line 135 of file parser.l.h.

◆ mNotAMemInitColon

const char* LexerData::mNotAMemInitColon = nullptr

Definition at line 99 of file parser.l.h.

◆ mOldYytext

const char* LexerData::mOldYytext = nullptr

Definition at line 92 of file parser.l.h.

◆ mPossibleFuncImplStartBracePosition

const char* LexerData::mPossibleFuncImplStartBracePosition = nullptr

Definition at line 104 of file parser.l.h.

◆ mTokenizeComment

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.

◆ parseDisabledCodeAsBlob

bool LexerData::parseDisabledCodeAsBlob = false

Definition at line 142 of file parser.l.h.


The documentation for this struct was generated from the following file: