Annote AST nodes with source information
This commit is contained in:
parent
5e0e74a47d
commit
2823ea5de3
3 changed files with 196 additions and 164 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue