math: cleanup _get_rl()
[smatch.git] / scope.h
blobea345e3a0eaec21aa738884511c1eae9249fa197
1 #ifndef SCOPE_H
2 #define SCOPE_H
3 /*
4 * Symbol scoping is pretty simple.
6 * Copyright (C) 2003 Transmeta Corp.
7 * 2003 Linus Torvalds
9 * Licensed under the Open Software License version 1.1
12 struct symbol;
13 struct position;
15 struct scope {
16 struct token *token; /* Scope start information */
17 struct symbol_list *symbols; /* List of symbols in this scope */
18 struct scope *next;
21 extern struct scope
22 *block_scope,
23 *function_scope,
24 *file_scope,
25 *global_scope;
27 static inline int toplevel(struct scope *scope)
29 return scope == file_scope || scope == global_scope;
32 extern void start_file_scope(void);
33 extern void end_file_scope(void);
34 extern void new_file_scope(void);
36 extern void start_symbol_scope(struct position pos);
37 extern void end_symbol_scope(void);
39 extern void start_function_scope(struct position pos);
40 extern void end_function_scope(void);
42 extern void bind_scope(struct symbol *, struct scope *);
44 extern int is_outer_scope(struct scope *);
45 #endif