summaryrefslogtreecommitdiff
path: root/minic/symbol.h
blob: ed31013794b20517c990ffdcf71a2d7480d33d74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

typedef struct Symbol {
	char *name;
	struct Symbol *upper;
} Symbol;

typedef struct Table {
	struct Table *previous;
} Table;

typedef struct Scope {
	int level;
} Scope;

void scope_enter( Scope *scope );
void scope_exit( Scope *scope );

Symbol scope_install_symbol( Scope *scope, const char *name );

Symbol scope_lookup_symbol( Scope *scope, const char *name );

Symbol scope_install_label( Scope *scope, const char *name );
Symbol scope_lookup_label( Scope *scope, const char *name );

Symbol scope_install_label( Scope *scope, const char *name );
Symbol scope_lookup_label( Scope *scope, const char *name );

Symbol scope_install_constant( Scope *scope, const char *name );
Symbol scope_lookup_constant( Scope *scope, const char *name );

Symbol scope_install_temporary( Scope *scope, const char *name );
Symbol scope_lookip_temporary( Scope *scope, const char *name );