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 <ctype.h>
#include "debug.h"
#include "entry.h"
#include "keyword.h"
#include "parse.h"
#include "read.h"
#include "routines.h"
#include "vstring.h"
#include "strlist.h"
Go to the source code of this file.
Classes | |
struct | sTokenInfo |
Macros | |
#define | isType(token, t) (bool) ((token)->type == (t)) |
#define | isKeyword(token, k) (bool) ((token)->keyword == (k)) |
#define | isEOF(token) (isType ((token), TOKEN_EOF)) |
#define | isIdentChar(c) |
#define | IS_STMT_SEPARATOR(t) |
#define | IS_BINARY_OPERATOR(t) |
Typedefs | |
typedef int | keywordId |
typedef enum eTokenType | tokenType |
typedef struct sTokenInfo | tokenInfo |
Functions | |
static void | parseFunction (tokenInfo *const token) |
static bool | parseBlock (tokenInfo *const token, const vString *const parentScope) |
static bool | parseLine (tokenInfo *const token) |
static bool | parseActionScript (tokenInfo *const token, bool readNext) |
static bool | parseMXML (tokenInfo *const token) |
static tokenInfo * | newToken (void) |
static void | deleteToken (tokenInfo *const token) |
static void | copyToken (tokenInfo *const dest, tokenInfo *const src, bool const include_non_read_info) |
static vString * | buildQualifiedName (const tokenInfo *const token) |
static void | makeConstTag (tokenInfo *const token, const flexKind kind) |
static void | makeFlexTag (tokenInfo *const token, flexKind kind) |
static void | makeClassTag (tokenInfo *const token) |
static void | makeMXTag (tokenInfo *const token) |
static void | makeFunctionTag (tokenInfo *const token) |
static void | parseString (vString *const string, const int delimiter) |
static void | parseIdentifier (vString *const string, const int firstChar) |
static void | readTokenFull (tokenInfo *const token, bool include_newlines) |
static void | readToken (tokenInfo *const token) |
static void | skipArgumentList (tokenInfo *const token, bool include_newlines) |
static void | skipArrayList (tokenInfo *const token, bool include_newlines) |
static void | addContext (tokenInfo *const parent, const tokenInfo *const child) |
static void | addToScope (tokenInfo *const token, const vString *const extra) |
static bool | findCmdTerm (tokenInfo *const token, bool include_newlines, bool include_commas) |
static void | parseSwitch (tokenInfo *const token) |
static bool | parseLoop (tokenInfo *const token) |
static bool | parseIf (tokenInfo *const token) |
static bool | parseImport (tokenInfo *const token) |
static void | parseMethods (tokenInfo *const token, const tokenInfo *const class) |
static bool | parseVar (tokenInfo *const token, bool is_public) |
static void | parsePackage (tokenInfo *const token) |
static bool | parseClass (tokenInfo *const token) |
static void | parseInterface (tokenInfo *const token) |
static bool | parseStatement (tokenInfo *const token) |
static bool | parseCDATA (tokenInfo *const token) |
static bool | parseNamespace (tokenInfo *const token) |
static void | parseFlexFile (tokenInfo *const token) |
static void | initialize (const langType language) |
static void | findFlexTags (void) |
parserDefinition * | FlexParser (void) |
Variables | |
static stringList * | ClassNames |
static stringList * | FunctionNames |
static tokenType | LastTokenType |
static tokenInfo * | NextToken |
static langType | Lang_flex |
static roleDefinition | FlexImportRoles [] |
static kindDefinition | FlexKinds [] |
static const keywordTable | FlexKeywordTable [] |
#define IS_BINARY_OPERATOR | ( | t | ) |
#define IS_STMT_SEPARATOR | ( | t | ) |
Definition at line 45 of file geany_flex.c.
#define isIdentChar | ( | c | ) |
Definition at line 46 of file geany_flex.c.
#define isKeyword | ( | token, | |
k | |||
) | (bool) ((token)->keyword == (k)) |
Definition at line 44 of file geany_flex.c.
#define isType | ( | token, | |
t | |||
) | (bool) ((token)->type == (t)) |
Definition at line 43 of file geany_flex.c.
typedef int keywordId |
Definition at line 107 of file geany_flex.c.
typedef struct sTokenInfo tokenInfo |
typedef enum eTokenType tokenType |
enum eKeywordId |
Definition at line 63 of file geany_flex.c.
enum eTokenType |
Definition at line 109 of file geany_flex.c.
enum flexImportRole |
Enumerator | |
---|---|
FLEX_IMPORT_ROLE_IMPORTED |
Definition at line 176 of file geany_flex.c.
enum flexKind |
Enumerator | |
---|---|
FLEXTAG_FUNCTION | |
FLEXTAG_CLASS | |
FLEXTAG_INTERFACE | |
FLEXTAG_PACKAGE | |
FLEXTAG_METHOD | |
FLEXTAG_PROPERTY | |
FLEXTAG_VARIABLE | |
FLEXTAG_LOCALVAR | |
FLEXTAG_CONST | |
FLEXTAG_IMPORT | |
FLEXTAG_MXTAG | |
FLEXTAG_COUNT |
Definition at line 161 of file geany_flex.c.
Definition at line 938 of file geany_flex.c.
References tokenInfo::string, vStringCat(), vStringLength, and vStringPut().
Referenced by parseStatement().
Definition at line 947 of file geany_flex.c.
References tokenInfo::scope, vStringCat(), vStringLength, and vStringPut().
Referenced by parseBlock(), parseMethods(), parseMXML(), and parseStatement().
Definition at line 303 of file geany_flex.c.
References tokenInfo::scope, tokenInfo::string, vStringCat(), vStringCopy(), vStringLength, vStringNew(), and vStringPut().
Referenced by makeClassTag(), makeConstTag(), and makeFunctionTag().
|
static |
Definition at line 283 of file geany_flex.c.
References tokenInfo::filePosition, tokenInfo::keyword, tokenInfo::lineNumber, tokenInfo::scope, tokenInfo::string, tokenInfo::type, and vStringCopy().
Referenced by parseClass(), parseFunction(), parseImport(), parseInterface(), parseMethods(), parseMXML(), parsePackage(), parseStatement(), parseVar(), and readTokenFull().
|
static |
Definition at line 276 of file geany_flex.c.
References eFree(), tokenInfo::scope, tokenInfo::string, and vStringDelete().
Referenced by findFlexTags(), parseClass(), parseFunction(), parseImport(), parseInterface(), parseMethods(), parseMXML(), parsePackage(), parseStatement(), parseVar(), and readTokenFull().
|
static |
Definition at line 960 of file geany_flex.c.
References isType, NULL, parseBlock(), readTokenFull(), skipArgumentList(), skipArrayList(), TOKEN_CLOSE_CURLY, TOKEN_COMMA, TOKEN_EOF, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, and TOKEN_SEMICOLON.
Referenced by parseFunction(), parseIf(), parseMethods(), parseStatement(), and parseVar().
|
static |
Definition at line 2602 of file geany_flex.c.
References ClassNames, deleteToken(), FunctionNames, newToken(), NextToken, NULL, parseFlexFile(), stringListDelete(), and stringListNew().
Referenced by FlexParser().
parserDefinition * FlexParser | ( | void | ) |
Definition at line 2620 of file geany_flex.c.
References ARRAY_SIZE, sParserDefinition::extensions, findFlexTags(), FlexKeywordTable, FlexKinds, sParserDefinition::initialize, initialize(), sParserDefinition::keywordCount, sParserDefinition::keywordTable, sParserDefinition::kindCount, sParserDefinition::kindTable, NULL, sParserDefinition::parser, and parserNew().
|
static |
Definition at line 2596 of file geany_flex.c.
References ARRAY_SIZE, Assert, FlexKinds, FLEXTAG_COUNT, and Lang_flex.
Referenced by FlexParser().
|
static |
Definition at line 389 of file geany_flex.c.
References buildQualifiedName(), ClassNames, FLEXTAG_CLASS, makeFlexTag(), stringListAdd(), stringListHas(), vStringDelete(), vStringNewCopy(), and vStringValue.
Referenced by parseClass(), and parseStatement().
Definition at line 317 of file geany_flex.c.
References buildQualifiedName(), sTagEntryInfo::extensionFields, sTagEntryInfo::filePosition, tokenInfo::filePosition, FlexKinds, FLEXTAG_CLASS, FLEXTAG_FUNCTION, FLEXTAG_MXTAG, initRefTagEntry(), isXtagEnabled(), sTagEntryInfo::lineNumber, tokenInfo::lineNumber, makeTagEntry(), markTagExtraBit(), sTagEntryInfo::name, name, ROLE_DEFINITION_INDEX, tokenInfo::scope, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeName, tokenInfo::string, vStringDelete(), vStringLength, vStringValue, and XTAG_QUALIFIED_TAGS.
Referenced by makeFlexTag().
Definition at line 369 of file geany_flex.c.
References DEBUG_PARSE, debugPrintf(), DebugStatement, FlexKinds, FLEXTAG_FUNCTION, FLEXTAG_METHOD, makeConstTag(), tokenInfo::scope, tokenInfo::string, and vStringValue.
Referenced by makeClassTag(), makeFunctionTag(), makeMXTag(), parseFunction(), parseImport(), parseInterface(), parseMethods(), parsePackage(), parseStatement(), and parseVar().
|
static |
Definition at line 412 of file geany_flex.c.
References buildQualifiedName(), FLEXTAG_FUNCTION, FunctionNames, makeFlexTag(), stringListAdd(), stringListHas(), vStringDelete(), vStringNewCopy(), and vStringValue.
Referenced by parseFunction(), and parseStatement().
|
static |
Definition at line 404 of file geany_flex.c.
References FLEXTAG_MXTAG, and makeFlexTag().
Referenced by parseMXML().
|
static |
Definition at line 259 of file geany_flex.c.
References tokenInfo::filePosition, getInputFilePosition(), getInputLineNumber(), tokenInfo::keyword, KEYWORD_NONE, tokenInfo::lineNumber, tokenInfo::scope, tokenInfo::string, TOKEN_UNDEFINED, tokenInfo::type, vStringNew(), and xMalloc.
Referenced by findFlexTags(), parseClass(), parseFunction(), parseImport(), parseInterface(), parseMethods(), parseMXML(), parsePackage(), parseStatement(), parseVar(), and readTokenFull().
|
static |
Definition at line 2479 of file geany_flex.c.
References isEOF, isKeyword, isType, KEYWORD_cdata, LastTokenType, parseLine(), parseMXML(), readToken(), TOKEN_CLOSE_MXML, TOKEN_CLOSE_SQUARE, TOKEN_EQUAL_SIGN, TOKEN_GREATER_THAN, TOKEN_LESS_THAN, TOKEN_OPEN_MXML, TOKEN_OPEN_SQUARE, and TOKEN_UNDEFINED.
Referenced by parseCDATA(), and parseFlexFile().
Definition at line 1316 of file geany_flex.c.
References addToScope(), DEBUG_PARSE, debugPrintf(), DebugStatement, isType, NULL, parseBlock(), parseLine(), readToken(), tokenInfo::scope, tokenInfo::string, TOKEN_CLOSE_CURLY, TOKEN_EOF, TOKEN_OPEN_CURLY, vStringCopy(), vStringDelete(), vStringNew(), and vStringValue.
Referenced by findCmdTerm(), parseBlock(), parseClass(), parseFunction(), parseIf(), parseInterface(), parseLoop(), parseMethods(), parsePackage(), parseStatement(), and parseSwitch().
|
static |
Definition at line 2228 of file geany_flex.c.
References isKeyword, isType, KEYWORD_cdata, parseActionScript(), readToken(), TOKEN_CLOSE_SQUARE, TOKEN_EXCLAMATION, TOKEN_LESS_THAN, and TOKEN_OPEN_SQUARE.
Referenced by parseMXML().
|
static |
Definition at line 1558 of file geany_flex.c.
References copyToken(), DEBUG_PARSE, debugPrintf(), DebugStatement, deleteToken(), isKeyword, isType, KEYWORD_class, KEYWORD_extends, KEYWORD_implements, makeClassTag(), name, newToken(), parseBlock(), readToken(), tokenInfo::scope, tokenInfo::string, TOKEN_COMMA, TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, and vStringValue.
Referenced by parseStatement().
|
static |
Definition at line 2550 of file geany_flex.c.
References isEOF, isKeyword, isType, KEYWORD_NONE, parseActionScript(), parseMXML(), readToken(), TOKEN_GREATER_THAN, TOKEN_LESS_THAN, TOKEN_OPEN_MXML, and TOKEN_QUESTION_MARK.
Referenced by findFlexTags().
|
static |
Definition at line 1206 of file geany_flex.c.
References copyToken(), DEBUG_PARSE, debugPrintf(), DebugStatement, deleteToken(), findCmdTerm(), FLEXTAG_FUNCTION, FLEXTAG_PROPERTY, isKeyword, isType, KEYWORD_function, KEYWORD_get, KEYWORD_set, makeFlexTag(), makeFunctionTag(), name, newToken(), parseBlock(), readToken(), tokenInfo::scope, skipArgumentList(), tokenInfo::string, TOKEN_COLON, TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, and vStringValue.
Referenced by parseLine(), and parseStatement().
|
static |
Definition at line 454 of file geany_flex.c.
References Assert, getcFromInputFile(), isIdentChar, ungetcToInputFile(), and vStringPut().
Referenced by readTokenFull().
|
static |
Definition at line 1103 of file geany_flex.c.
References findCmdTerm(), isKeyword, isType, KEYWORD_if, NULL, parseBlock(), readToken(), skipArgumentList(), TOKEN_OPEN_CURLY, and TOKEN_OPEN_PAREN.
Referenced by parseLine(), and parseStatement().
|
static |
Definition at line 1174 of file geany_flex.c.
References copyToken(), deleteToken(), FLEXTAG_IMPORT, isKeyword, isType, KEYWORD_import, makeFlexTag(), name, newToken(), readToken(), tokenInfo::string, TOKEN_IDENTIFIER, TOKEN_PERIOD, TOKEN_SEMICOLON, TOKEN_STAR, vStringCat(), and vStringPut().
Referenced by parseLine().
|
static |
Definition at line 1626 of file geany_flex.c.
References copyToken(), deleteToken(), FLEXTAG_INTERFACE, isKeyword, isType, KEYWORD_extends, KEYWORD_interface, makeFlexTag(), name, newToken(), parseBlock(), readToken(), TOKEN_COMMA, TOKEN_IDENTIFIER, and TOKEN_OPEN_CURLY.
Referenced by parseStatement().
|
static |
Definition at line 2163 of file geany_flex.c.
References isType, tokenInfo::keyword, KEYWORD_catch, KEYWORD_do, KEYWORD_else, KEYWORD_finally, KEYWORD_for, KEYWORD_function, KEYWORD_if, KEYWORD_import, KEYWORD_return, KEYWORD_switch, KEYWORD_try, KEYWORD_while, parseFunction(), parseIf(), parseImport(), parseLine(), parseLoop(), parseStatement(), parseSwitch(), readToken(), and TOKEN_KEYWORD.
Referenced by parseActionScript(), parseBlock(), parseLine(), and parseLoop().
|
static |
Definition at line 1022 of file geany_flex.c.
References isKeyword, isType, KEYWORD_do, KEYWORD_for, KEYWORD_while, NULL, parseBlock(), parseLine(), readToken(), skipArgumentList(), TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, and TOKEN_SEMICOLON.
Referenced by parseLine(), and parseStatement().
Definition at line 1398 of file geany_flex.c.
References addToScope(), copyToken(), deleteToken(), findCmdTerm(), FLEXTAG_METHOD, FLEXTAG_PROPERTY, isKeyword, isType, KEYWORD_function, KEYWORD_NONE, makeFlexTag(), name, newToken(), parseBlock(), readToken(), tokenInfo::scope, skipArgumentList(), tokenInfo::string, TOKEN_CLOSE_CURLY, TOKEN_COLON, TOKEN_COMMA, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_STRING, vStringCopy(), vStringDelete(), and vStringNew().
Referenced by parseStatement().
|
static |
Definition at line 2342 of file geany_flex.c.
References addToScope(), copyToken(), deleteToken(), isEOF, isKeyword, isType, KEYWORD_id, KEYWORD_name, KEYWORD_script, makeMXTag(), name, newToken(), parseCDATA(), parseMXML(), parseNamespace(), readToken(), tokenInfo::string, TOKEN_CLOSE_MXML, TOKEN_CLOSE_SGML, TOKEN_GREATER_THAN, TOKEN_LESS_THAN, TOKEN_OPEN_MXML, and vStringLength.
Referenced by parseActionScript(), parseFlexFile(), parseMXML(), and parseNamespace().
|
static |
Definition at line 2271 of file geany_flex.c.
References isEOF, isType, parseMXML(), parseNamespace(), readToken(), TOKEN_CLOSE_MXML, TOKEN_CLOSE_SGML, TOKEN_COLON, TOKEN_IDENTIFIER, TOKEN_LESS_THAN, and TOKEN_OPEN_MXML.
Referenced by parseMXML(), and parseNamespace().
|
static |
Definition at line 1521 of file geany_flex.c.
References copyToken(), deleteToken(), FLEXTAG_PACKAGE, isKeyword, isType, KEYWORD_package, makeFlexTag(), name, newToken(), NULL, parseBlock(), readToken(), tokenInfo::string, TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, TOKEN_PERIOD, vStringCat(), and vStringPut().
Referenced by parseStatement().
|
static |
Definition at line 1661 of file geany_flex.c.
References addContext(), addToScope(), ClassNames, copyToken(), DEBUG_PARSE, debugPrintf(), DebugStatement, deleteToken(), findCmdTerm(), FLEXTAG_METHOD, FLEXTAG_VARIABLE, FunctionNames, isKeyword, isType, tokenInfo::keyword, KEYWORD_capital_function, KEYWORD_capital_object, KEYWORD_catch, KEYWORD_class, KEYWORD_const, KEYWORD_do, KEYWORD_dynamic, KEYWORD_else, KEYWORD_final, KEYWORD_finally, KEYWORD_for, KEYWORD_function, KEYWORD_if, KEYWORD_interface, KEYWORD_internal, KEYWORD_native, KEYWORD_new, KEYWORD_object, KEYWORD_override, KEYWORD_package, KEYWORD_private, KEYWORD_protected, KEYWORD_prototype, KEYWORD_public, KEYWORD_static, KEYWORD_switch, KEYWORD_try, KEYWORD_var, KEYWORD_while, makeClassTag(), makeFlexTag(), makeFunctionTag(), name, newToken(), NULL, parseBlock(), parseClass(), parseFunction(), parseIf(), parseInterface(), parseLoop(), parseMethods(), parsePackage(), parseSwitch(), parseVar(), readToken(), readTokenFull(), tokenInfo::scope, skipArgumentList(), skipArrayList(), tokenInfo::string, stringListHas(), TOKEN_CLOSE_CURLY, TOKEN_COLON, TOKEN_COMMA, TOKEN_EOF, TOKEN_EQUAL_SIGN, TOKEN_IDENTIFIER, TOKEN_KEYWORD, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, TOKEN_PERIOD, TOKEN_SEMICOLON, vStringCat(), vStringClear, vStringCopy(), vStringDelete(), vStringLength, vStringNew(), vStringPut(), and vStringValue.
Referenced by parseLine().
|
static |
Definition at line 431 of file geany_flex.c.
References getcFromInputFile(), and vStringPut().
Referenced by readTokenFull().
|
static |
Definition at line 995 of file geany_flex.c.
References isType, NULL, parseBlock(), readToken(), skipArgumentList(), TOKEN_OPEN_CURLY, and TOKEN_OPEN_PAREN.
Referenced by parseLine(), and parseStatement().
|
static |
Definition at line 1472 of file geany_flex.c.
References copyToken(), deleteToken(), findCmdTerm(), FLEXTAG_CONST, FLEXTAG_LOCALVAR, FLEXTAG_VARIABLE, isKeyword, isType, KEYWORD_const, KEYWORD_var, makeFlexTag(), name, newToken(), readToken(), TOKEN_COLON, TOKEN_IDENTIFIER, and TOKEN_SEMICOLON.
Referenced by parseStatement().
|
static |
Definition at line 885 of file geany_flex.c.
References readTokenFull().
Referenced by parseActionScript(), parseBlock(), parseCDATA(), parseClass(), parseFlexFile(), parseFunction(), parseIf(), parseImport(), parseInterface(), parseLine(), parseLoop(), parseMethods(), parseMXML(), parseNamespace(), parsePackage(), parseStatement(), parseSwitch(), parseVar(), skipArgumentList(), and skipArrayList().
|
static |
Definition at line 466 of file geany_flex.c.
References Assert, copyToken(), deleteToken(), tokenInfo::filePosition, getcFromInputFile(), getInputFilePosition(), getInputLineNumber(), IS_BINARY_OPERATOR, IS_STMT_SEPARATOR, isIdentChar, isKeyword, tokenInfo::keyword, KEYWORD_NONE, Lang_flex, LastTokenType, tokenInfo::lineNumber, lookupCaseKeyword(), newToken(), NextToken, NULL, parseIdentifier(), parseString(), skipToCharacterInInputFile(), tokenInfo::string, TOKEN_BINARY_OPERATOR, TOKEN_CHARACTER, TOKEN_CLOSE_CURLY, TOKEN_CLOSE_MXML, TOKEN_CLOSE_PAREN, TOKEN_CLOSE_SGML, TOKEN_CLOSE_SQUARE, TOKEN_COLON, TOKEN_COMMA, TOKEN_EOF, TOKEN_EQUAL_SIGN, TOKEN_EXCLAMATION, TOKEN_FORWARD_SLASH, TOKEN_GREATER_THAN, TOKEN_IDENTIFIER, TOKEN_KEYWORD, TOKEN_LESS_THAN, TOKEN_OPEN_CURLY, TOKEN_OPEN_MXML, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, TOKEN_PERIOD, TOKEN_POSTFIX_OPERATOR, TOKEN_QUESTION_MARK, TOKEN_SEMICOLON, TOKEN_STAR, TOKEN_STRING, TOKEN_UNDEFINED, tokenInfo::type, ungetcToInputFile(), vStringClear, and vStringValue.
Referenced by findCmdTerm(), parseStatement(), readToken(), skipArgumentList(), and skipArrayList().
|
static |
Definition at line 894 of file geany_flex.c.
References isType, readToken(), readTokenFull(), TOKEN_CLOSE_PAREN, TOKEN_EOF, and TOKEN_OPEN_PAREN.
Referenced by findCmdTerm(), parseFunction(), parseIf(), parseLoop(), parseMethods(), parseStatement(), and parseSwitch().
|
static |
Definition at line 913 of file geany_flex.c.
References isType, readToken(), readTokenFull(), TOKEN_CLOSE_SQUARE, TOKEN_EOF, and TOKEN_OPEN_SQUARE.
Referenced by findCmdTerm(), and parseStatement().
|
static |
Definition at line 58 of file geany_flex.c.
Referenced by findFlexTags(), makeClassTag(), and parseStatement().
|
static |
Definition at line 180 of file geany_flex.c.
|
static |
Definition at line 202 of file geany_flex.c.
Referenced by FlexParser().
|
static |
Definition at line 184 of file geany_flex.c.
Referenced by FlexParser(), initialize(), makeConstTag(), and makeFlexTag().
|
static |
Definition at line 59 of file geany_flex.c.
Referenced by findFlexTags(), makeFunctionTag(), and parseStatement().
|
static |
Definition at line 159 of file geany_flex.c.
Referenced by initialize(), and readTokenFull().
|
static |
Definition at line 156 of file geany_flex.c.
Referenced by parseActionScript(), and readTokenFull().
|
static |
Definition at line 157 of file geany_flex.c.
Referenced by findFlexTags(), and readTokenFull().