geany
1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
![]() ![]() |
#include "general.h"
#include "parse.h"
#include "read.h"
#include "vstring.h"
#include "keyword.h"
#include "entry.h"
#include "routines.h"
#include "debug.h"
Go to the source code of this file.
Classes | |
struct | tokenInfo |
Macros | |
#define | SCOPE_SEPARATOR "::" |
Typedefs | |
typedef int | keywordId |
typedef enum eTokenType | tokenType |
Functions | |
static const char * | accessToString (const accessType access) |
static const char * | implToString (const implType impl) |
static void | initPhpEntry (tagEntryInfo *const e, const tokenInfo *const token, const phpKind kind, const accessType access) |
static void | makeSimplePhpTag (const tokenInfo *const token, const phpKind kind, const accessType access) |
static void | makeNamespacePhpTag (const tokenInfo *const token, const vString *const name) |
static void | makeClassOrIfaceTag (const phpKind kind, const tokenInfo *const token, vString *const inheritance, const implType impl) |
static void | makeFunctionTag (const tokenInfo *const token, const vString *const arglist, const accessType access, const implType impl) |
static tokenInfo * | newToken (void) |
static void | deleteToken (tokenInfo *const token) |
static void | copyToken (tokenInfo *const dest, const tokenInfo *const src, bool scope) |
static void | addToScope (tokenInfo *const token, const vString *const extra) |
static bool | isIdentChar (const int c) |
static void | parseString (vString *const string, const int delimiter) |
static void | parseHeredoc (vString *const string) |
static void | parseIdentifier (vString *const string, const int firstChar) |
static keywordId | analyzeToken (vString *const name, langType language) |
static bool | isSpace (int c) |
static int | skipWhitespaces (int c) |
static bool | isOpenScriptLanguagePhp (int c) |
static int | findPhpStart (void) |
static int | skipSingleComment (void) |
static void | readToken (tokenInfo *const token) |
static void | enterScope (tokenInfo *const parentToken, const vString *const extraScope, const int parentKind) |
static bool | parseClassOrIface (tokenInfo *const token, const phpKind kind) |
static bool | parseTrait (tokenInfo *const token) |
static bool | parseFunction (tokenInfo *const token, const tokenInfo *name) |
static bool | parseConstant (tokenInfo *const token) |
static bool | parseDefine (tokenInfo *const token) |
static bool | parseVariable (tokenInfo *const token) |
static bool | parseNamespace (tokenInfo *const token) |
static void | findTags (void) |
static void | findPhpTags (void) |
static void | findZephirTags (void) |
static void | initializePhpParser (const langType language) |
static void | initializeZephirParser (const langType language) |
parserDefinition * | PhpParser (void) |
parserDefinition * | ZephirParser (void) |
Variables | |
static kindDefinition | PhpKinds [COUNT_KIND] |
static const keywordTable | PhpKeywordTable [] |
static langType | Lang_php |
static langType | Lang_zephir |
static bool | InPhp = false |
struct { | |
accessType access | |
implType impl | |
} | CurrentStatement |
static vString * | CurrentNamespace |
#define SCOPE_SEPARATOR "::" |
Definition at line 24 of file geany_php.c.
typedef int keywordId |
Definition at line 88 of file geany_php.c.
typedef enum eTokenType tokenType |
anonymous enum |
Definition at line 27 of file geany_php.c.
enum accessType |
Enumerator | |
---|---|
ACCESS_UNDEFINED | |
ACCESS_PRIVATE | |
ACCESS_PROTECTED | |
ACCESS_PUBLIC | |
COUNT_ACCESS |
Definition at line 90 of file geany_php.c.
enum eTokenType |
Definition at line 192 of file geany_php.c.
enum implType |
Enumerator | |
---|---|
IMPL_UNDEFINED | |
IMPL_ABSTRACT | |
COUNT_IMPL |
Definition at line 98 of file geany_php.c.
enum phpKind |
Enumerator | |
---|---|
K_CLASS | |
K_DEFINE | |
K_FUNCTION | |
K_INTERFACE | |
K_LOCAL_VARIABLE | |
K_NAMESPACE | |
K_TRAIT | |
K_VARIABLE | |
COUNT_KIND |
Definition at line 104 of file geany_php.c.
|
static |
Definition at line 240 of file geany_php.c.
References access, Assert, and COUNT_ACCESS.
Referenced by initPhpEntry().
Definition at line 472 of file geany_php.c.
References tokenInfo::scope, SCOPE_SEPARATOR, vStringCatS(), vStringLength, and vStringValue.
Referenced by enterScope().
Definition at line 631 of file geany_php.c.
References lookupKeyword(), name, vStringCopyToLower(), vStringDelete(), vStringNew(), and vStringValue.
Referenced by readToken().
Definition at line 392 of file geany_php.c.
References tokenInfo::filePosition, tokenInfo::keyword, tokenInfo::lineNumber, tokenInfo::parentKind, scope, tokenInfo::scope, tokenInfo::string, tokenInfo::type, and vStringCopy().
Referenced by enterScope(), parseClassOrIface(), parseConstant(), parseFunction(), parseNamespace(), parseTrait(), and parseVariable().
|
static |
Definition at line 385 of file geany_php.c.
References eFree(), tokenInfo::scope, tokenInfo::string, and vStringDelete().
Referenced by enterScope(), findTags(), parseClassOrIface(), parseConstant(), parseFunction(), parseNamespace(), parseTrait(), and parseVariable().
|
static |
Definition at line 1346 of file geany_php.c.
References ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, addToScope(), copyToken(), CurrentStatement, deleteToken(), enterScope(), IMPL_ABSTRACT, K_CLASS, K_INTERFACE, tokenInfo::keyword, KEYWORD_abstract, KEYWORD_class, KEYWORD_const, KEYWORD_define, KEYWORD_function, KEYWORD_interface, KEYWORD_namespace, KEYWORD_private, KEYWORD_protected, KEYWORD_public, KEYWORD_trait, KEYWORD_var, newToken(), NULL, tokenInfo::parentKind, parseClassOrIface(), parseConstant(), parseDefine(), parseFunction(), parseNamespace(), parseTrait(), parseVariable(), readToken(), TOKEN_CLOSE_CURLY, TOKEN_EOF, TOKEN_KEYWORD, TOKEN_OPEN_CURLY, TOKEN_VARIABLE, and tokenInfo::type.
Referenced by enterScope(), findTags(), parseClassOrIface(), parseFunction(), parseNamespace(), and parseTrait().
|
static |
Definition at line 699 of file geany_php.c.
References getcFromInputFile(), isOpenScriptLanguagePhp(), and ungetcToInputFile().
Referenced by readToken().
|
static |
Definition at line 1430 of file geany_php.c.
References findTags(), and InPhp.
Referenced by PhpParser().
|
static |
Definition at line 1412 of file geany_php.c.
References ACCESS_UNDEFINED, CurrentNamespace, CurrentStatement, deleteToken(), enterScope(), IMPL_UNDEFINED, newToken(), NULL, TOKEN_EOF, tokenInfo::type, vStringDelete(), and vStringNew().
Referenced by findPhpTags(), and findZephirTags().
|
static |
Definition at line 1436 of file geany_php.c.
References findTags(), and InPhp.
Referenced by ZephirParser().
|
static |
Definition at line 254 of file geany_php.c.
References Assert, COUNT_IMPL, and impl.
Referenced by makeClassOrIfaceTag(), and makeFunctionTag().
|
static |
|
static |
|
static |
Definition at line 266 of file geany_php.c.
References sTagEntryInfo::access, access, ACCESS_UNDEFINED, accessToString(), Assert, CurrentNamespace, sTagEntryInfo::extensionFields, sTagEntryInfo::filePosition, tokenInfo::filePosition, initTagEntry(), K_NAMESPACE, sTagEntryInfo::lineNumber, tokenInfo::lineNumber, NULL, tokenInfo::parentKind, tokenInfo::scope, SCOPE_SEPARATOR, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeName, tokenInfo::string, vStringCat(), vStringCatS(), vStringClear, vStringCopy(), vStringLength, vStringNew(), and vStringValue.
Referenced by makeClassOrIfaceTag(), makeFunctionTag(), and makeSimplePhpTag().
|
static |
Definition at line 479 of file geany_php.c.
Referenced by parseHeredoc(), parseIdentifier(), and readToken().
|
static |
Definition at line 658 of file geany_php.c.
References getcFromInputFile(), isSpace(), and skipWhitespaces().
Referenced by findPhpStart().
|
static |
Definition at line 641 of file geany_php.c.
Referenced by isOpenScriptLanguagePhp(), and skipWhitespaces().
|
static |
Definition at line 333 of file geany_php.c.
References ACCESS_UNDEFINED, sTagEntryInfo::extensionFields, impl, IMPL_UNDEFINED, sTagEntryInfo::implementation, implToString(), sTagEntryInfo::inheritance, initPhpEntry(), makeTagEntry(), PhpKinds, vStringLength, and vStringValue.
Referenced by parseClassOrIface().
|
static |
Definition at line 351 of file geany_php.c.
References access, sTagEntryInfo::extensionFields, impl, IMPL_UNDEFINED, sTagEntryInfo::implementation, implToString(), initPhpEntry(), K_FUNCTION, makeTagEntry(), PhpKinds, sTagEntryInfo::signature, and vStringValue.
Referenced by parseFunction().
Definition at line 318 of file geany_php.c.
References sTagEntryInfo::filePosition, tokenInfo::filePosition, initTagEntry(), K_NAMESPACE, sTagEntryInfo::lineNumber, tokenInfo::lineNumber, makeTagEntry(), name, PhpKinds, and vStringValue.
Referenced by parseNamespace().
|
static |
Definition at line 306 of file geany_php.c.
References access, initPhpEntry(), makeTagEntry(), and PhpKinds.
Referenced by parseConstant(), parseDefine(), parseTrait(), and parseVariable().
|
static |
Definition at line 370 of file geany_php.c.
References tokenInfo::filePosition, getInputFilePosition(), getInputLineNumber(), tokenInfo::keyword, KEYWORD_NONE, tokenInfo::lineNumber, tokenInfo::parentKind, tokenInfo::scope, tokenInfo::string, TOKEN_UNDEFINED, tokenInfo::type, vStringNew(), and xMalloc.
Referenced by enterScope(), findTags(), parseClassOrIface(), parseConstant(), parseFunction(), parseNamespace(), parseTrait(), and parseVariable().
Definition at line 975 of file geany_php.c.
References copyToken(), CurrentStatement, deleteToken(), enterScope(), impl, K_CLASS, makeClassOrIfaceTag(), name, newToken(), NULL, readToken(), tokenInfo::string, TOKEN_EOF, TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, tokenInfo::type, vStringCat(), vStringDelete(), vStringLength, vStringNew(), and vStringPut().
Referenced by enterScope().
|
static |
Definition at line 1195 of file geany_php.c.
References ACCESS_UNDEFINED, copyToken(), deleteToken(), K_DEFINE, makeSimplePhpTag(), name, newToken(), readToken(), TOKEN_EQUAL_SIGN, TOKEN_IDENTIFIER, and tokenInfo::type.
Referenced by enterScope().
|
static |
Definition at line 1218 of file geany_php.c.
References ACCESS_UNDEFINED, K_DEFINE, makeSimplePhpTag(), readToken(), TOKEN_CLOSE_PAREN, TOKEN_EOF, TOKEN_IDENTIFIER, TOKEN_OPEN_PAREN, TOKEN_STRING, and tokenInfo::type.
Referenced by enterScope().
Definition at line 1056 of file geany_php.c.
References access, copyToken(), CurrentStatement, deleteToken(), enterScope(), getInputLanguage(), impl, K_FUNCTION, tokenInfo::keyword, KEYWORD_use, Lang_zephir, makeFunctionTag(), name, newToken(), NULL, readToken(), tokenInfo::string, TOKEN_AMPERSAND, TOKEN_CLOSE_CURLY, TOKEN_CLOSE_PAREN, TOKEN_CLOSE_SQUARE, TOKEN_COLON, TOKEN_COMMA, TOKEN_EOF, TOKEN_EQUAL_SIGN, TOKEN_IDENTIFIER, TOKEN_KEYWORD, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, TOKEN_OPERATOR, TOKEN_PERIOD, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_VARIABLE, tokenInfo::type, vStringCat(), vStringCatS(), vStringDelete(), vStringLast, vStringNew(), and vStringPut().
Referenced by enterScope(), and parseVariable().
|
static |
Definition at line 520 of file geany_php.c.
References ARRAY_SIZE, error(), getcFromInputFile(), isIdentChar(), ungetcToInputFile(), vStringNCatS(), and vStringPut().
Referenced by readToken().
|
static |
Definition at line 620 of file geany_php.c.
References getcFromInputFile(), isIdentChar(), ungetcToInputFile(), and vStringPut().
Referenced by readToken().
|
static |
Definition at line 1314 of file geany_php.c.
References copyToken(), CurrentNamespace, deleteToken(), enterScope(), makeNamespacePhpTag(), newToken(), NULL, readToken(), tokenInfo::string, TOKEN_EOF, TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, TOKEN_SEMICOLON, tokenInfo::type, vStringCat(), vStringClear, vStringLength, and vStringPut().
Referenced by enterScope().
|
static |
Definition at line 484 of file geany_php.c.
References getcFromInputFile(), and vStringPut().
Referenced by readToken().
|
static |
Definition at line 1021 of file geany_php.c.
References ACCESS_UNDEFINED, copyToken(), deleteToken(), enterScope(), K_TRAIT, makeSimplePhpTag(), name, newToken(), readToken(), TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, and tokenInfo::type.
Referenced by enterScope().
|
static |
Definition at line 1257 of file geany_php.c.
References access, copyToken(), CurrentStatement, deleteToken(), sKindDefinition::enabled, K_CLASS, K_FUNCTION, K_INTERFACE, K_LOCAL_VARIABLE, K_VARIABLE, tokenInfo::keyword, KEYWORD_function, makeSimplePhpTag(), name, newToken(), tokenInfo::parentKind, parseFunction(), PhpKinds, readToken(), TOKEN_EQUAL_SIGN, TOKEN_KEYWORD, TOKEN_SEMICOLON, and tokenInfo::type.
Referenced by enterScope().
parserDefinition * PhpParser | ( | void | ) |
Definition at line 1452 of file geany_php.c.
References ARRAY_SIZE, sParserDefinition::extensions, findPhpTags(), sParserDefinition::initialize, initializePhpParser(), sParserDefinition::keywordCount, sParserDefinition::keywordTable, sParserDefinition::kindCount, sParserDefinition::kindTable, NULL, sParserDefinition::parser, parserNew(), PhpKeywordTable, and PhpKinds.
|
static |
Definition at line 759 of file geany_php.c.
References ACCESS_UNDEFINED, analyzeToken(), CurrentStatement, tokenInfo::filePosition, findPhpStart(), getcFromInputFile(), getInputFilePosition(), getInputLanguage(), getInputLineNumber(), IMPL_UNDEFINED, InPhp, isIdentChar(), tokenInfo::keyword, KEYWORD_NONE, tokenInfo::lineNumber, parseHeredoc(), parseIdentifier(), parseString(), skipSingleComment(), skipToCharacterInInputFile(), skipWhitespaces(), tokenInfo::string, TOKEN_AMPERSAND, TOKEN_CLOSE_CURLY, TOKEN_CLOSE_PAREN, TOKEN_CLOSE_SQUARE, TOKEN_COLON, TOKEN_COMMA, TOKEN_EOF, TOKEN_EQUAL_SIGN, TOKEN_IDENTIFIER, TOKEN_KEYWORD, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, TOKEN_OPERATOR, TOKEN_PERIOD, TOKEN_SEMICOLON, TOKEN_STRING, TOKEN_UNDEFINED, TOKEN_VARIABLE, tokenInfo::type, ungetcToInputFile(), and vStringClear.
Referenced by enterScope(), parseClassOrIface(), parseConstant(), parseDefine(), parseFunction(), parseNamespace(), parseTrait(), and parseVariable().
|
static |
Definition at line 732 of file geany_php.c.
References getcFromInputFile(), InPhp, and ungetcToInputFile().
Referenced by readToken().
|
static |
Definition at line 647 of file geany_php.c.
References getcFromInputFile(), and isSpace().
Referenced by isOpenScriptLanguagePhp(), and readToken().
parserDefinition * ZephirParser | ( | void | ) |
Definition at line 1466 of file geany_php.c.
References ARRAY_SIZE, sParserDefinition::extensions, findZephirTags(), sParserDefinition::initialize, initializeZephirParser(), sParserDefinition::keywordCount, sParserDefinition::keywordTable, sParserDefinition::kindCount, sParserDefinition::kindTable, NULL, sParserDefinition::parser, parserNew(), PhpKeywordTable, and PhpKinds.
accessType access |
Definition at line 232 of file geany_php.c.
Referenced by accessToString(), addAccessFields(), findValidAccessType(), initPhpEntry(), initPowerShellEntry(), makeFunctionTag(), makeSimplePhpTag(), makeSimplePowerShellTag(), parseFunction(), parsePowerShellScope(), parseVariable(), tm_source_file_get_tag_access(), and utils_is_file_writable().
|
static |
Definition at line 237 of file geany_php.c.
Referenced by findTags(), initPhpEntry(), and parseNamespace().
struct { ... } CurrentStatement |
Referenced by enterScope(), findTags(), parseClassOrIface(), parseFunction(), parseVariable(), and readToken().
implType impl |
Definition at line 233 of file geany_php.c.
Referenced by implToString(), makeClassOrIfaceTag(), makeFunctionTag(), mem_try_resize(), parseClassOrIface(), parseFunction(), and tm_source_file_get_tag_impl().
|
static |
Definition at line 228 of file geany_php.c.
Referenced by findPhpTags(), findZephirTags(), readToken(), and skipSingleComment().
|
static |
Definition at line 225 of file geany_php.c.
Referenced by initializePhpParser().
|
static |
Definition at line 226 of file geany_php.c.
Referenced by initializeZephirParser(), and parseFunction().
|
static |
Definition at line 127 of file geany_php.c.
Referenced by PhpParser(), and ZephirParser().
|
static |
Definition at line 116 of file geany_php.c.
Referenced by makeClassOrIfaceTag(), makeFunctionTag(), makeNamespacePhpTag(), makeSimplePhpTag(), parseVariable(), PhpParser(), and ZephirParser().