37 lines
633 B
C
37 lines
633 B
C
|
// Validates identifier usage in an AST.
|
||
|
#ifndef WRAITH_IDENTCHECK_H
|
||
|
#define WRAITH_IDENTCHECK_H
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#include "ast.h"
|
||
|
|
||
|
typedef enum NodeType {
|
||
|
LexicalScope,
|
||
|
Struct,
|
||
|
Function,
|
||
|
Variable
|
||
|
} NodeType;
|
||
|
|
||
|
typedef struct IdNode {
|
||
|
NodeType type;
|
||
|
char *name;
|
||
|
struct IdNode **children;
|
||
|
uint32_t childCount;
|
||
|
uint32_t childCapacity;
|
||
|
} IdNode;
|
||
|
|
||
|
typedef struct IdStatus {
|
||
|
enum StatusCode {
|
||
|
Valid,
|
||
|
} StatusCode;
|
||
|
} IdStatus;
|
||
|
|
||
|
|
||
|
IdNode* MakeIdTree(Node *astNode);
|
||
|
void PrintIdTree(IdNode *tree, uint32_t tabCount);
|
||
|
|
||
|
//IdStatus CheckIds(Node *root);
|
||
|
|
||
|
#endif /* WRAITH_IDENTCHECK_H */
|