73 {
true,
'o',
"object",
"objects" },
74 {
true,
'a',
"array",
"arrays" },
75 {
true,
'n',
"number",
"numbers" },
76 {
true,
's',
"string",
"strings" },
77 {
true,
'b',
"boolean",
"booleans" },
78 {
true,
'z',
"null",
"nulls" }
137 return (isalnum (c) || c ==
'+' || c ==
'-' || c ==
'.');
141 bool includeStringRepr)
150 while (c ==
'\t' || c ==
' ' || c ==
'\r' || c ==
'\n');
167 bool escaped =
false;
177 else if (c >= 0x00 && c <= 0x1F)
179 else if (c ==
'"' || c == EOF)
181 if (includeStringRepr)
211#define readToken(t) (readTokenFull ((t), false))
230#define skipToOneOf2(token, type1, type2) \
231 (skipToOneOf3 (token, type1, type2, TOKEN_EOF ))
233#define skipTo(token, type) \
234 (skipToOneOf3 (token, type, TOKEN_EOF, TOKEN_EOF))
242 token->
type != type1 &&
243 token->
type != type2 &&
244 token->
type != type3)
319 unsigned int nth = 0;
330 snprintf (buf,
sizeof buf,
"%u", nth++);
379 static const char *
const extensions [] = {
"json",
NULL };
int makeTagEntry(const tagEntryInfo *const tag)
void initTagEntry(tagEntryInfo *const e, const char *const name, int kindIndex)
#define skipToOneOf2(token, type1, type2)
static tokenInfo * newToken(void)
static void parseValue(tokenInfo *const token)
static void skipToOneOf3(tokenInfo *const token, const tokenType type1, const tokenType type2, const tokenType type3)
static void copyToken(tokenInfo *const dest, tokenInfo *const src)
static jsonKind tokenToKind(const tokenType type)
static langType Lang_json
#define skipTo(token, type)
static kindDefinition JsonKinds[]
static void pushScope(tokenInfo *const token, const tokenInfo *const parent, const jsonKind parentKind)
parserDefinition * JsonParser(void)
static void deleteToken(tokenInfo *const token)
static void readTokenFull(tokenInfo *const token, bool includeStringRepr)
static void findJsonTags(void)
static void initialize(const langType language)
static void makeJsonTag(tokenInfo *const token, const jsonKind kind)
static bool isIdentChar(int c)
static void popScope(tokenInfo *const token, const tokenInfo *const parent)
void addKeyword(const char *const string, langType language, int value)
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)
void eFree(void *const ptr)
parserInitialize initialize
const char *const * extensions
kindDefinition * kindTable
struct sTagEntryInfo::@3 extensionFields
struct sTokenInfo tokenInfo
void vStringCopyS(vString *const string, const char *const s)
vString * vStringNew(void)
void vStringDelete(vString *const string)
void vStringTruncate(vString *const string, const size_t length)
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)