24#define SCOPE_SEPARATOR "::"
117 {
true,
'c',
"class",
"classes" },
118 {
true,
'd',
"define",
"constant definitions" },
119 {
true,
'f',
"function",
"functions" },
120 {
true,
'i',
"interface",
"interfaces" },
121 {
false,
'l',
"local",
"local variables" },
122 {
true,
'n',
"namespace",
"namespaces" },
123 {
true,
't',
"trait",
"traits" },
124 {
true,
'v',
"variable",
"variables" }
256 static const char *
const names[
COUNT_IMPL] = {
272 if (fullScope ==
NULL)
408static const char *tokenTypeName (
const tokenType type)
435static void printToken (
const tokenInfo *
const token)
437 fprintf (stderr,
"%p:\n\ttype:\t%s\n\tline:\t%lu\n\tscope:\t%s\n", (
void *) token,
438 tokenTypeName (token->type),
446 fprintf (stderr,
"\tcontent:\t%s\n",
vStringValue (token->string));
454 fprintf (stderr,
"\tkeyword:\t");
455 for (i = 0; i < n; i++)
464 fprintf (stderr,
"(unknown)\n");
481 return (isalnum (c) || c ==
'_' || c >= 0x80);
492 else if (c == EOF || c == delimiter)
531 while (c ==
' ' || c ==
'\t');
533 if (c ==
'\'' || c ==
'"')
538 for (len = 0; len <
ARRAY_SIZE (delimiter) - 1; len++)
542 delimiter[len] = (char) c;
555 if (c !=
'\r' && c !=
'\n')
562 if (c !=
'\r' && c !=
'\n')
571 for (len = 0; c != 0 && (c - delimiter[len]) == 0; len++)
574 if (delimiter[len] != 0)
580 if (c ==
'\r' || c ==
'\n')
588 if (d ==
'\r' || d ==
'\n')
643 return (c ==
'\t' || c ==
' ' || c ==
'\v' ||
644 c ==
'\n' || c ==
'\r' || c ==
'\f');
684 if (c ==
'"' || c ==
'\'')
689 if (tolower (c) !=
'p' ||
755 }
while (
InPhp && c != EOF && c !=
'\n' && c !=
'\r');
801 if (d ==
'=' || d ==
'>')
893 }
while (c != EOF && c !=
'\0');
966 const vString *
const extraScope,
967 const int parentKind);
977 bool readNext =
true;
1023 bool readNext =
true;
1058 bool readNext =
true;
1088 switch (token->
type)
1095 switch (token->
type)
1169 switch (token->
type)
1242 switch (token->
type)
1260 bool readNext =
true;
1347 const vString *
const extraScope,
1348 const int parentKind)
1351 int origParentKind = parentToken->
parentKind;
1365 bool readNext =
true;
1367 switch (token->
type)
1454 static const char *
const extensions [] = {
"php",
"php3",
"php4",
"php5",
"phtml",
NULL };
1468 static const char *
const extensions [] = {
"zep",
NULL };
int makeTagEntry(const tagEntryInfo *const tag)
void initTagEntry(tagEntryInfo *const e, const char *const name, int kindIndex)
void error(const errorSelection selection, const char *const format,...)
unsigned long int lineNumber
static void initializeZephirParser(const langType language)
static void findPhpTags(void)
static vString * CurrentNamespace
static void enterScope(tokenInfo *const parentToken, const vString *const extraScope, const int parentKind)
static bool parseDefine(tokenInfo *const token)
static int skipSingleComment(void)
static const char * accessToString(const accessType access)
static tokenInfo * newToken(void)
static void parseHeredoc(vString *const string)
parserDefinition * ZephirParser(void)
static void findZephirTags(void)
static bool parseNamespace(tokenInfo *const token)
static keywordId analyzeToken(vString *const name, langType language)
static void initializePhpParser(const langType language)
parserDefinition * PhpParser(void)
static int skipWhitespaces(int c)
static void deleteToken(tokenInfo *const token)
static void makeFunctionTag(const tokenInfo *const token, const vString *const arglist, const accessType access, const implType impl)
enum eTokenType tokenType
static bool isOpenScriptLanguagePhp(int c)
static void makeNamespacePhpTag(const tokenInfo *const token, const vString *const name)
static void addToScope(tokenInfo *const token, const vString *const extra)
static void copyToken(tokenInfo *const dest, const tokenInfo *const src, bool scope)
static void findTags(void)
static void parseString(vString *const string, const int delimiter)
static void makeSimplePhpTag(const tokenInfo *const token, const phpKind kind, const accessType access)
static int findPhpStart(void)
static bool parseTrait(tokenInfo *const token)
static void makeClassOrIfaceTag(const phpKind kind, const tokenInfo *const token, vString *const inheritance, const implType impl)
static void parseIdentifier(vString *const string, const int firstChar)
static bool parseVariable(tokenInfo *const token)
static const char * implToString(const implType impl)
static void initPhpEntry(tagEntryInfo *const e, const tokenInfo *const token, const phpKind kind, const accessType access)
static bool isIdentChar(const int c)
static kindDefinition PhpKinds[COUNT_KIND]
static bool parseFunction(tokenInfo *const token, const tokenInfo *name)
static struct @25 CurrentStatement
static bool parseConstant(tokenInfo *const token)
static bool parseClassOrIface(tokenInfo *const token, const phpKind kind)
static bool isSpace(int c)
static const keywordTable PhpKeywordTable[]
static langType Lang_zephir
static void readToken(tokenInfo *const token)
int lookupKeyword(const char *const string, langType language)
parserDefinition * parserNew(const char *name)
unsigned long getInputLineNumber(void)
int getcFromInputFile(void)
langType getInputLanguage(void)
MIOPos getInputFilePosition(void)
void ungetcToInputFile(int c)
int skipToCharacterInInputFile(int c)
void eFree(void *const ptr)
parserInitialize initialize
const char *const * extensions
const keywordTable * keywordTable
kindDefinition * kindTable
unsigned int keywordCount
struct sTagEntryInfo::@3 extensionFields
const char * implementation
struct sTokenInfo tokenInfo
void vStringNCatS(vString *const string, const char *const s, const size_t length)
vString * vStringNew(void)
void vStringDelete(vString *const string)
void vStringCatS(vString *const string, const char *const s)
void vStringCopyToLower(vString *const dest, const vString *const src)
void vStringCat(vString *const string, const vString *const s)
void vStringCopy(vString *const string, const vString *const s)
#define vStringClear(string)
#define vStringLength(vs)
static void vStringPut(vString *const string, const int c)