4 * (c)Copyright 1993-2014, Matthew Dillon, All Rights Reserved. See the
5 * COPYRIGHT file at the base of the distribution.
22 void LexDebugLine(token_t *tok);
27 Declaration *FindDeclId(SemGroup *db, string_t id, int *eno);
28 Declaration *FindDeclIdLevel(SemGroup *db, string_t id, int level, int *eno);
29 Declaration *FindDeclByIndex(SemGroup *sg, int index);
30 void DeclPrintError(Declaration *d, int type);
31 Declaration *FindDeclPath(LexRef *lexRef, SemGroup *osg, SemGroup *sg,
32 Type *nomatch, string_t *ary, int mask,
33 int *visibility, int level, int *eno);
34 void *FindDLLSymbol(SemGroup *osg, SemGroup *sg, string_t id);
39 void ExpPrintError(Exp *exp, int type);
44 Lex *LexOpen(const char *path, token_t *tok);
45 void LexClose(Lex **plex);
46 int LexRedactToken(token_t *tok, int bytes);
47 int LexPeekToken(token_t *tok);
48 int LexToken(token_t *tok);
49 int LexSkipToken(token_t *tok, int type);
50 int LexStripQuotes(token_t *tok, token_t *tmp);
51 int LexError(token_t *tok, int err);
52 void LexPrintError(token_t *tok);
53 void LexPrintRef(LexRef *lr, int type);
54 void LexInitRef(LexRef *lr, token_t *tok);
55 void LexDupRef(LexRef *s, LexRef *d);
56 void LexDoneRef(LexRef *lr);
57 const char *LexErrStr(token_t *tok);
62 void LibRuneInit(void);
67 int ParseOpen(Stmt *st, Parse **pp, void **dll);
68 void ParseDone(Parse *p);
69 void ParseClose(Parse **pp);
70 void AddImportPath(const char *path, int flags);
71 void PrefixImportPaths(const char *basePath);
76 int ParseModule(Parse *p, Stmt *st, int t);
77 int ParseStmt(Parse *p, int t, Stmt **pst);
78 int ParseDeclarationStmt(Parse *p, int t, int idRequired, Stmt **pst,
79 int dop, Scope *scope);
84 int ParseScopeQual(Parse *p, int t, Scope *scope);
85 int ParseStorageQual(Parse *p, int t, int *pmask);
86 int ParseDeclaration(Parse *p, int t, Declaration **pd, int idRequired,
87 int dop, Scope *scope);
88 int ParseDeclarationList(Parse *p, int t, int scopeFlags,
89 int idRequired, int dop);
90 int ParseType(Parse *p, int t, Type **ptype, int sqflags);
91 int ParseDeclType(Parse *p, int t, Type **ptype, SemGroup **psg,
92 int scopeFlags, int rqflags, string_t *id,
98 int ParseExp(Parse *p, int t, Exp **pexp);
99 int ParseParenthesizedExp(Parse *p, int t, Exp **pexp, int docomp);
100 int ParseNotExp(Parse *p, int t, Exp **pexp);
105 void ResolveProject(Parse *p, Stmt *st);
106 Type *resolveType(Type *type, int flags);
111 Stmt *BuildRootImportStmt(const char *path);
112 void StmtPrintError(Stmt *st, int type);
117 string_t StrTableEscapeQuotedString(const char *str, int len, int term);
118 string_t StrTableAlloc(const char *str, int len, int special);
119 string_t StrTableToken(token_t *tok);
120 string_t StrTableInt(int v);
121 string_t StrTableDup(string_t str);
122 int StrTableSpecial(string_t id);
123 int StrTableLen(string_t id);
124 int StrCmpToken(string_t id, token_t *tok);
125 void ReplaceStrTable(string_t *pstr, string_t id);
126 void RelStrTable(string_t *pstr);
127 const char *StripPathId(const char *path, int *len);
128 int SimpleIntToken(token_t *tok, int *rv);
129 int SimpleRunesizeToken(token_t *tok, runesize_t *rv);
134 int SymKeywordFind(const char *ptr, int len, int t);
139 char *TypeToStr(Type *type, char **pstr);
140 int SameType(Type *t1, Type *t2, int sqFlags2);
141 int SimilarType(Type *t1, Type *t2);
142 int SimilarSemGroup(SemGroup *s1, SemGroup *s2);
143 int MatchType(Type *super, Type *type);
144 void InternalRegisterType(const char *str, Type *type);
145 Type *InternalRegisteredTypeLookup(string_t id);
146 void initType(Type *type, List *list, int op);
147 void initQualType(Type *type, List *list, int op, int sqflags);
148 void initPtrType(Type *type, Type *ptrto, int sqflags);
150 extern st_run_t StmtFuncVector;
151 extern ex_run_t ExpFuncVector;
153 extern Type DynamicRValueType;
154 extern Type DynamicLValueType;
155 extern Type NumericType;
156 extern Type IntegralType;
157 extern Type SIntegerType;
158 extern Type UIntegerType;
159 extern Type VoidType;
160 extern Type BoolType;
161 extern Type Int8Type;
162 extern Type UInt8Type;
163 extern Type Int16Type;
164 extern Type UInt16Type;
165 extern Type Int32Type;
166 extern Type UInt32Type;
167 extern Type Int64Type;
168 extern Type UInt64Type;
169 extern Type Int128Type;
170 extern Type UInt128Type;
172 extern Type Float32Type;
173 extern Type Float64Type;
174 extern Type Float128Type;
176 extern Type CCharType;
177 extern Type StrType; /* NOTE: const char *, chars are unsigned */
178 extern Type CharPtrType;
179 extern Type CharPtrPtrType;
180 extern Type VoidPtrType;
181 extern Type VoidRefType;
182 extern Type CVoidPtrType;
183 extern Type LVoidPtrType;
184 extern Type PointerType; /* generic pointer placeholder */
186 extern Type IntPtrType;
187 extern Type UIntPtrType;
189 extern Type SizeType;