22#define MAX_SIGNATURE_LENGTH 512
23#define isType(token,t) (bool) ((token)->type == (t))
24#define isKeyword(token,k) (bool) ((token)->keyword == (k))
94 {
true,
'p',
"package",
"packages"},
95 {
true,
'f',
"func",
"functions"},
96 {
true,
'c',
"const",
"constants"},
97 {
true,
't',
"type",
"types"},
98 {
true,
'v',
"var",
"variables"},
99 {
true,
's',
"struct",
"structs"},
100 {
true,
'i',
"interface",
"interfaces"},
101 {
true,
'm',
"member",
"struct members"}
125 (isalpha (c) || c ==
'_' || c > 128);
182 else if (c ==
'\\' && delimiter !=
'`')
185 if (c !=
'\'' && c !=
'\"')
189 else if (c == delimiter)
211 bool firstWhitespace =
true;
233 whitespace = c ==
'\t' || c ==
' ' || c ==
'\r' || c ==
'\n';
236 firstWhitespace =
false;
254 bool hasNewline =
false;
277 }
while (d != EOF && d !=
'*');
284 }
while (c != EOF && c !=
'\0');
389 lastTokenType = token->
type;
421 if (
isType (token, open_token))
423 else if (
isType (token, close_token))
519 const char *argList,
const char *varType)
659 memberCandidate =
NULL;
673 if (
skipType (token) && memberCandidate)
704 bool usesParens =
false;
821 static const char *
const extensions[] = {
"go",
NULL };
int makeTagEntry(const tagEntryInfo *const tag)
void initTagEntry(tagEntryInfo *const e, const char *const name, int kindIndex)
static void parsePackage(tokenInfo *const token)
struct sTokenInfo tokenInfo
#define MAX_SIGNATURE_LENGTH
static tokenInfo * newToken(void)
static void parseConstTypeVar(tokenInfo *const token, goKind kind)
static bool isStartIdentChar(const int c)
static vString * signature
static void parseStructMembers(tokenInfo *const token, tokenInfo *const parent_token)
static bool skipType(tokenInfo *const token)
static void deleteToken(tokenInfo *const token)
enum eTokenType tokenType
static bool skipToMatchedNoRead(tokenInfo *const token)
static kindDefinition GoKinds[]
static void initialize(const langType language)
static void parseString(vString *const string, const int delimiter)
static const keywordTable GoKeywordTable[]
static void findGoTags(void)
static void parseIdentifier(vString *const string, const int firstChar)
#define isKeyword(token, k)
static tokenInfo * copyToken(tokenInfo *other)
static bool isIdentChar(const int c)
parserDefinition * GoParser(void)
static void parseFunctionOrMethod(tokenInfo *const token)
static void skipToMatched(tokenInfo *const token)
static void parseGoFile(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 readToken(tokenInfo *const token)
int lookupKeyword(const char *const string, langType language)
parserDefinition * parserNew(const char *name)
unsigned long getInputLineNumber(void)
int getcFromInputFile(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
void vStringStripTrailing(vString *const string)
vString * vStringNew(void)
vString * vStringNewCopy(const vString *const string)
void vStringDelete(vString *const string)
void vStringStripLeading(vString *const string)
void vStringCatS(vString *const string, const char *const s)
void vStringChop(vString *const string)
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)
bool isXtagEnabled(xtagType type)