Annote AST nodes with source information

This commit is contained in:
Randy Heit 2013-08-28 22:59:03 -05:00
commit 2823ea5de3
3 changed files with 196 additions and 164 deletions

View file

@ -11,11 +11,15 @@ struct ZCCParseState
struct ZCC_TreeNode *TopNode;
};
union ZCCToken
struct ZCCToken
{
int Int;
double Float;
FString *String;
union
{
int Int;
double Float;
FString *String;
};
int SourceLoc;
ENamedName Name() { return ENamedName(Int); }
};
@ -195,6 +199,11 @@ struct ZCC_TreeNode
ZCC_TreeNode *SiblingNext;
ZCC_TreeNode *SiblingPrev;
// can't use FScriptPosition, because the string wouldn't have a chance to
// destruct if we did that.
FString *SourceName;
int SourceLoc;
// Node type is one of the node types above, which corresponds with
// one of the structures below.
EZCCTreeNodeType NodeType;