31#define stringMatch(s1,s2) (strcmp (s1,s2) == 0)
32#define isspacetab(c) ((c) == SPACE || (c) == TAB)
101 { {
false,
false,
false,
false} }
119extern void cppInit (
const bool state,
const bool hasAtLiteralStrings,
120 const bool hasCxxRawLiteralStrings,
121 int defineMacroKindIndex)
203 for (i = 0 ; i < maxLength - 1 ; ++i)
208 if (c == EOF || ! isalpha (c))
289 const bool ignoreAllBranches =
isIgnore ();
290 bool ignoreBranch =
false;
307 ifdef->
ignoring = (bool) (ignoreAllBranches || (
364 parameterized = (nc ==
'(');
372 if (nc ==
'\n' && lastC !=
'\\')
408 }
while (c ==
SPACE);
439 else if (strncmp (directive,
"if", (
size_t) 2) == 0)
495 else if (next ==
'/')
497 else if (next ==
'+')
596 return (c !=
' ' && c !=
'\f' && c !=
'\n' && c !=
'\r' && c !=
'\t' && c !=
'\v' &&
597 c !=
'(' && c !=
')' && c !=
'\\');
612 unsigned int delimLen = 0;
613 bool collectDelim =
true;
620 delimLen < (
sizeof delim /
sizeof *delim))
621 delim[delimLen++] = c;
623 collectDelim =
false;
629 while ((c =
getcAndCollect ()) != EOF && i < delimLen && delim[i] == c)
674 bool directive =
false;
706 if (directive && ! ignore)
773 case '(': c =
'[';
break;
774 case ')': c =
']';
break;
775 case '<': c =
'{';
break;
776 case '>': c =
'}';
break;
778 case '!': c =
'|';
break;
780 case '-': c =
'~';
break;
781 case '=': c =
'#';
goto process;
799 case ':': c =
'[';
break;
800 case '%': c =
'{';
break;
819 case '>': c =
'}';
break;
820 case ':': c =
'#';
goto process;
863 (!
cppIsident (prev2) && (prev ==
'L' || prev ==
'u' || prev ==
'U')) ||
864 (!
cppIsident (prev3) && (prev2 ==
'u' && prev ==
'8')))
883 }
while (directive || ignore);
907 while (buf[i] !=
'\0')
917 else if (buf[i+1] ==
'/')
927 if ((
pos > 0) && (buf[
pos-1] !=
' '))
958 if ((
pos > 0) && (buf[
pos-1] !=
' '))
966 if ((
pos > 0) && (buf[
pos-1] !=
' '))
990 for (level = 1, end = start + 1; level > 0; ++end)
994 else if (
'(' == *end)
996 else if (
')' == *end)
1029 bool *
const pIgnoreParens,
1030 const char **
const replacement)
1032 bool result =
false;
1036 const size_t nameLen = strlen (
name);
1038 unsigned int len = 0;
1044 if (pIgnoreParens !=
NULL)
1045 *pIgnoreParens =
false;
1047 for (i = 0 ; i < len ; ++i)
1054 if (tokenLen >= 2 &&
vStringChar (token, tokenLen - 1) ==
'*' &&
1062 if (nameLen == tokenLen)
1067 else if (tokenLen == nameLen + 1 &&
1071 if (pIgnoreParens !=
NULL)
1072 *pIgnoreParens =
true;
1077 if (replacement !=
NULL)
#define DebugStatement(x)
void debugCppIgnore(const bool ignore)
void debugCppNest(const bool begin, const unsigned int level)
void debugPrintf(const enum eDebugLevels level, const char *const format,...)
void debugPutc(const int level, const int c)
int makeTagEntry(const tagEntryInfo *const tag)
void initTagEntry(tagEntryInfo *const e, const char *const name, int kindIndex)
static bool isFileScope(const tagType type)
static void directivePragma(int c)
static void chooseBranch(void)
static int getcAndCollect(void)
bool cppIsIgnoreToken(const char *const name, bool *const pIgnoreParens, const char **const replacement)
static bool collectingSignature
static void ungetcAndCollect(int c)
bool cppIsBraceFormat(void)
void cppUngetc(const int c)
static vString * signature
int cppSkipOverCComment(void)
static bool setIgnore(const bool ignore)
static bool directiveIf(const int c)
unsigned int cppGetDirectiveNestLevel(void)
static int skipToEndOfChar(void)
static void stripCodeBuffer(char *buf)
static conditionalInfo * currentConditional(void)
static int isCxxRawLiteralDelimiterChar(int c)
static int skipToEndOfCxxRawLiteralString(void)
static bool pushConditional(const bool firstBranchChosen)
static void readIdentifier(int c, vString *const name)
void cppEndStatement(void)
void cppStopCollectingSignature(void)
void cppInit(const bool state, const bool hasAtLiteralStrings, const bool hasCxxRawLiteralStrings, int defineMacroKindIndex)
static int makeDefineTag(const char *const name, bool parameterized, bool undef)
static void directiveUndef(const int c)
static Comment isComment(void)
void cppClearSignature(void)
static bool isIgnoreBranch(void)
static bool handleDirective(const int c, int *macroCorkIndex)
static bool popConditional(void)
struct sConditionalInfo conditionalInfo
#define stringMatch(s1, s2)
static int skipOverDComment(void)
static int skipToEndOfString(bool ignoreBackslash)
char * cppGetSignature(void)
void cppBeginStatement(void)
struct sCppState cppState
static bool directiveHash(const int c)
static bool isIgnore(void)
static int directiveDefine(const int c, bool undef)
static bool readDirective(int c, char *const name, unsigned int maxLength)
static int skipOverCplusComment(void)
void cppStartCollectingSignature(void)
bool isLanguageKindEnabled(const langType language, int kindIndex)
bool isInputHeaderFile(void)
int getNthPrevCFromInputFile(unsigned int nth, int def)
unsigned long getInputLineNumber(void)
int getcFromInputFile(void)
langType getInputLanguage(void)
void ungetcToInputFile(int c)
char * eStrdup(const char *str)
void eFree(void *const ptr)
conditionalInfo ifdef[MaxCppNestingLevel]
struct sCppState::sDirective directive
bool hasCxxRawLiteralStrings
struct sTagEntryInfo::@3 extensionFields
unsigned int lineNumberEntry
unsigned int truncateLineAfterTag
void vStringCopyS(vString *const string, const char *const s)
vString * vStringNewOrClear(vString *const string)
vString * vStringNew(void)
void vStringDelete(vString *const string)
void vStringChop(vString *const string)
#define vStringChar(vs, i)
#define vStringClear(string)
#define vStringLength(vs)
static void vStringPut(vString *const string, const int c)
bool isXtagEnabled(xtagType type)