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 "debug.h"
#include "entry.h"
#include "keyword.h"
#include "read.h"
#include "parse.h"
#include "routines.h"
#include "vstring.h"
#include "options.h"
#include "xtag.h"
Go to the source code of this file.
Classes | |
struct | sTokenInfo |
Macros | |
#define | MAX_SIGNATURE_LENGTH 512 |
#define | isType(token, t) (bool) ((token)->type == (t)) |
#define | isKeyword(token, k) (bool) ((token)->keyword == (k)) |
Typedefs | |
typedef int | keywordId |
typedef enum eTokenType | tokenType |
typedef struct sTokenInfo | tokenInfo |
Functions | |
static bool | isStartIdentChar (const int c) |
static bool | isIdentChar (const int c) |
static void | initialize (const langType language) |
static tokenInfo * | newToken (void) |
static tokenInfo * | copyToken (tokenInfo *other) |
static void | deleteToken (tokenInfo *const token) |
static void | parseString (vString *const string, const int delimiter) |
static void | parseIdentifier (vString *const string, const int firstChar) |
static void | readToken (tokenInfo *const token) |
static bool | skipToMatchedNoRead (tokenInfo *const token) |
static void | skipToMatched (tokenInfo *const token) |
static bool | skipType (tokenInfo *const token) |
static void | makeTag (tokenInfo *const token, const goKind kind, tokenInfo *const parent_token, const goKind parent_kind, const char *argList, const char *varType) |
static void | parsePackage (tokenInfo *const token) |
static void | parseFunctionOrMethod (tokenInfo *const token) |
static void | parseStructMembers (tokenInfo *const token, tokenInfo *const parent_token) |
static void | parseConstTypeVar (tokenInfo *const token, goKind kind) |
static void | parseGoFile (tokenInfo *const token) |
static void | findGoTags (void) |
parserDefinition * | GoParser (void) |
Variables | |
static int | Lang_go |
static vString * | scope |
static vString * | signature = NULL |
static kindDefinition | GoKinds [] |
static const keywordTable | GoKeywordTable [] |
#define isKeyword | ( | token, | |
k | |||
) | (bool) ((token)->keyword == (k)) |
Definition at line 24 of file geany_go.c.
#define isType | ( | token, | |
t | |||
) | (bool) ((token)->type == (t)) |
Definition at line 23 of file geany_go.c.
#define MAX_SIGNATURE_LENGTH 512 |
Definition at line 22 of file geany_go.c.
typedef int keywordId |
Definition at line 42 of file geany_go.c.
typedef struct sTokenInfo tokenInfo |
typedef enum eTokenType tokenType |
enum eKeywordId |
Definition at line 30 of file geany_go.c.
enum eTokenType |
Definition at line 44 of file geany_go.c.
enum goKind |
Enumerator | |
---|---|
GOTAG_UNDEFINED | |
GOTAG_PACKAGE | |
GOTAG_FUNCTION | |
GOTAG_CONST | |
GOTAG_TYPE | |
GOTAG_VAR | |
GOTAG_STRUCT | |
GOTAG_INTERFACE | |
GOTAG_MEMBER |
Definition at line 81 of file geany_go.c.
Definition at line 150 of file geany_go.c.
References tokenInfo::filePosition, tokenInfo::keyword, tokenInfo::lineNumber, tokenInfo::string, tokenInfo::type, vStringNewCopy(), and xMalloc.
Referenced by parseConstTypeVar(), parseFunctionOrMethod(), and parseStructMembers().
|
static |
Definition at line 161 of file geany_go.c.
References eFree(), NULL, tokenInfo::string, and vStringDelete().
Referenced by findGoTags(), parseConstTypeVar(), parseFunctionOrMethod(), and parseStructMembers().
|
static |
Definition at line 808 of file geany_go.c.
References deleteToken(), newToken(), NULL, parseGoFile(), scope, and vStringDelete().
Referenced by GoParser().
parserDefinition * GoParser | ( | void | ) |
Definition at line 819 of file geany_go.c.
References ARRAY_SIZE, sParserDefinition::extensions, findGoTags(), GoKeywordTable, GoKinds, sParserDefinition::initialize, initialize(), sParserDefinition::keywordCount, sParserDefinition::keywordTable, sParserDefinition::kindCount, sParserDefinition::kindTable, NULL, sParserDefinition::parser, and parserNew().
|
static |
|
static |
Definition at line 128 of file geany_go.c.
References isStartIdentChar().
Referenced by parseIdentifier().
|
static |
Definition at line 122 of file geany_go.c.
Referenced by isIdentChar(), and readToken().
|
static |
Definition at line 517 of file geany_go.c.
References sTagEntryInfo::extensionFields, sTagEntryInfo::filePosition, tokenInfo::filePosition, GoKinds, GOTAG_UNDEFINED, initTagEntry(), isXtagEnabled(), sTagEntryInfo::lineNumber, tokenInfo::lineNumber, makeTagEntry(), sTagEntryInfo::name, name, NULL, scope, sTagEntryInfo::scopeKindIndex, sTagEntryInfo::scopeName, sTagEntryInfo::signature, tokenInfo::string, sTagEntryInfo::typeRef, vStringCat(), vStringCatS(), vStringCopy(), vStringDelete(), vStringNew(), vStringValue, and XTAG_QUALIFIED_TAGS.
Referenced by parseConstTypeVar(), parseFunctionOrMethod(), parsePackage(), and parseStructMembers().
|
static |
Definition at line 139 of file geany_go.c.
References tokenInfo::filePosition, getInputFilePosition(), getInputLineNumber(), tokenInfo::keyword, KEYWORD_NONE, tokenInfo::lineNumber, tokenInfo::string, TOKEN_NONE, tokenInfo::type, vStringNew(), and xMalloc.
Referenced by findGoTags().
Definition at line 694 of file geany_go.c.
References copyToken(), deleteToken(), GOTAG_INTERFACE, GOTAG_STRUCT, GOTAG_TYPE, GOTAG_UNDEFINED, isKeyword, isType, KEYWORD_interface, KEYWORD_struct, makeTag(), NULL, parseStructMembers(), readToken(), skipToMatched(), skipType(), TOKEN_CLOSE_PAREN, TOKEN_COMMA, TOKEN_EOF, TOKEN_IDENTIFIER, TOKEN_OPEN_PAREN, and TOKEN_SEMICOLON.
Referenced by parseGoFile().
|
static |
Definition at line 569 of file geany_go.c.
References sVString::buffer, copyToken(), deleteToken(), GOTAG_FUNCTION, GOTAG_UNDEFINED, isType, makeTag(), NULL, readToken(), signature, skipToMatched(), skipToMatchedNoRead(), skipType(), TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, vStringChop(), vStringDelete(), vStringNew(), vStringStripLeading(), and vStringStripTrailing().
Referenced by parseGoFile().
|
static |
Definition at line 771 of file geany_go.c.
References GOTAG_CONST, GOTAG_TYPE, GOTAG_VAR, isType, tokenInfo::keyword, KEYWORD_const, KEYWORD_func, KEYWORD_package, KEYWORD_type, KEYWORD_var, parseConstTypeVar(), parseFunctionOrMethod(), parsePackage(), readToken(), skipToMatched(), TOKEN_EOF, TOKEN_KEYWORD, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, and tokenInfo::type.
Referenced by findGoTags().
|
static |
Definition at line 196 of file geany_go.c.
References getcFromInputFile(), isIdentChar(), ungetcToInputFile(), and vStringPut().
Referenced by readToken().
|
static |
Definition at line 555 of file geany_go.c.
References GOTAG_PACKAGE, GOTAG_UNDEFINED, isType, isXtagEnabled(), makeTag(), NULL, readToken(), scope, tokenInfo::string, TOKEN_IDENTIFIER, vStringCopy(), vStringNew(), and XTAG_QUALIFIED_TAGS.
Referenced by parseGoFile().
|
static |
Definition at line 174 of file geany_go.c.
References getcFromInputFile(), and vStringPut().
Referenced by readToken().
Definition at line 625 of file geany_go.c.
References copyToken(), deleteToken(), GOTAG_MEMBER, GOTAG_STRUCT, isType, makeTag(), NULL, readToken(), skipToMatched(), skipType(), TOKEN_CLOSE_CURLY, TOKEN_COMMA, TOKEN_EOF, TOKEN_IDENTIFIER, TOKEN_OPEN_CURLY, and TOKEN_SEMICOLON.
Referenced by parseConstTypeVar().
|
static |
Definition at line 207 of file geany_go.c.
References tokenInfo::filePosition, getcFromInputFile(), getInputFilePosition(), getInputLineNumber(), isKeyword, isStartIdentChar(), tokenInfo::keyword, KEYWORD_NONE, Lang_go, tokenInfo::lineNumber, lookupKeyword(), MAX_SIGNATURE_LENGTH, parseIdentifier(), parseString(), signature, skipToCharacterInInputFile(), tokenInfo::string, TOKEN_CLOSE_CURLY, TOKEN_CLOSE_PAREN, TOKEN_CLOSE_SQUARE, TOKEN_COMMA, TOKEN_DOT, TOKEN_EOF, TOKEN_IDENTIFIER, TOKEN_KEYWORD, TOKEN_LEFT_ARROW, TOKEN_NONE, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, TOKEN_OTHER, TOKEN_SEMICOLON, TOKEN_STAR, TOKEN_STRING, tokenInfo::type, ungetcToInputFile(), vStringCat(), vStringCatS(), vStringClear, vStringLength, vStringPut(), and vStringValue.
Referenced by parseConstTypeVar(), parseFunctionOrMethod(), parseGoFile(), parsePackage(), parseStructMembers(), skipToMatched(), skipToMatchedNoRead(), and skipType().
|
static |
Definition at line 430 of file geany_go.c.
References readToken(), and skipToMatchedNoRead().
Referenced by parseConstTypeVar(), parseFunctionOrMethod(), parseGoFile(), parseStructMembers(), and skipType().
|
static |
Definition at line 392 of file geany_go.c.
References isType, readToken(), TOKEN_CLOSE_CURLY, TOKEN_CLOSE_PAREN, TOKEN_CLOSE_SQUARE, TOKEN_EOF, TOKEN_OPEN_CURLY, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, and tokenInfo::type.
Referenced by parseFunctionOrMethod(), and skipToMatched().
|
static |
Definition at line 436 of file geany_go.c.
References isKeyword, isType, KEYWORD_chan, KEYWORD_func, KEYWORD_interface, KEYWORD_map, KEYWORD_struct, readToken(), skipToMatched(), skipType(), TOKEN_DOT, TOKEN_IDENTIFIER, TOKEN_LEFT_ARROW, TOKEN_OPEN_PAREN, TOKEN_OPEN_SQUARE, and TOKEN_STAR.
Referenced by parseConstTypeVar(), parseFunctionOrMethod(), parseStructMembers(), and skipType().
|
static |
Definition at line 104 of file geany_go.c.
Referenced by GoParser().
|
static |
Definition at line 93 of file geany_go.c.
Referenced by GoParser(), and makeTag().
|
static |
Definition at line 77 of file geany_go.c.
Referenced by initialize(), and readToken().
|
static |
Definition at line 78 of file geany_go.c.
Referenced by addContextSeparator(), addOtherFields(), addReferenceTag(), addTag(), addToScope(), copyToken(), corkSymtabPut(), doesContainAnyCharInFieldScope(), dumpSstack(), emitRubyTag(), fill_find_tags_array(), find_scope_members_tags(), findConfTags(), findGoTags(), findJuliaTags(), findRustTags(), get_symbol_name(), getFullQualifiedScopeNameFromCorkQueue(), getTagScopeInformation(), Scintilla::LineLayout::LineLastVisible(), makeExtraTagEntry(), makeFortranTag(), makeTag(), matchTagPattern(), parseBlock(), parseColonImportExpr(), parseConst(), parseExpr(), parseFn(), parseFunction(), parseImpl(), parseImport(), parseImportEntity(), parseMacro(), parseMacroRules(), parseMod(), parseModule(), parsePackage(), parseShortFunction(), parseStatic(), parseStruct(), parseStructOrEnum(), parseTrait(), parseType(), registerEntry(), renderFieldScope(), renderFieldScopeNoEscape(), resetScope(), Scintilla::LineLayout::SubLineRange(), and tm_workspace_find().
Definition at line 79 of file geany_go.c.
Referenced by makeClassTag(), makeClassTagCommon(), makeFunctionTag(), makeFunctionTagCommon(), makeJsTag(), makeJsTagCommon(), parseFunction(), parseFunctionOrMethod(), parseMethods(), parseStatement(), and readToken().