Store known but uncompiled nodes in the symbol table

- Don't bother keeping track of uncompiled nodes in a special table. Use
  the regular symbol table instead. This should in the future make
  compiling nodes referenced deeper than (and before) their definitions
  fairly straightforward.
- Also, break up the compiler's Message() function into Warn() and Error()
  and get rid of zcc_errors.h. I can't really see having a set of error
  numbers being useful.
This commit is contained in:
Randy Heit 2016-03-12 21:22:29 -06:00
commit aaae9f2e05
8 changed files with 209 additions and 128 deletions

View file

@ -174,24 +174,26 @@ struct ZCC_Identifier : ZCC_TreeNode
ENamedName Id;
};
struct ZCC_Class : ZCC_TreeNode
struct ZCC_NamedNode : ZCC_TreeNode
{
ENamedName NodeName;
};
struct ZCC_Class : ZCC_NamedNode
{
ENamedName ClassName;
ZCC_Identifier *ParentName;
ZCC_Identifier *Replaces;
VM_UWORD Flags;
ZCC_TreeNode *Body;
};
struct ZCC_Struct : ZCC_TreeNode
struct ZCC_Struct : ZCC_NamedNode
{
ENamedName StructName;
ZCC_TreeNode *Body;
};
struct ZCC_Enum : ZCC_TreeNode
struct ZCC_Enum : ZCC_NamedNode
{
ENamedName EnumName;
EZCCBuiltinType EnumType;
struct ZCC_ConstantDef *Elements;
};
@ -432,9 +434,8 @@ struct ZCC_FuncParamDecl : ZCC_TreeNode
int Flags;
};
struct ZCC_ConstantDef : ZCC_TreeNode
struct ZCC_ConstantDef : ZCC_NamedNode
{
ENamedName Name;
ZCC_Expression *Value;
PSymbolConst *Symbol;
};