projects
/
cparser
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rename method to function
[cparser]
/
ast_t.h
diff --git
a/ast_t.h
b/ast_t.h
index
5cddf05
..
3a090c4
100644
(file)
--- a/
ast_t.h
+++ b/
ast_t.h
@@
-1,6
+1,8
@@
#ifndef AST_T_H
#define AST_T_H
#ifndef AST_T_H
#define AST_T_H
+#include <libfirm/firm_types.h>
+
#include "ast.h"
#include "symbol.h"
#include "token_t.h"
#include "ast.h"
#include "symbol.h"
#include "token_t.h"
@@
-32,9
+34,6
@@
typedef enum {
struct context_t {
declaration_t *declarations;
struct context_t {
declaration_t *declarations;
- compound_type_t *structs;
- compound_type_t *unions;
- enum_type_t *enums;
};
struct expression_t {
};
struct expression_t {
@@
-74,7
+73,7
@@
struct call_argument_t {
struct call_expression_t {
expression_t expression;
struct call_expression_t {
expression_t expression;
- expression_t *
method
;
+ expression_t *
function
;
call_argument_t *arguments;
};
call_argument_t *arguments;
};
@@
-160,16
+159,16
@@
struct sizeof_expression_t {
expression_t *size_expression;
};
expression_t *size_expression;
};
-struct
member_
designator_t {
- symbol_t
*symbol;
- expression_t
*array_access;
-
member_
designator_t *next;
+struct designator_t {
+ symbol_t *symbol;
+ expression_t *array_access;
+ designator_t *next;
};
struct offsetof_expression_t {
};
struct offsetof_expression_t {
- expression_t
expression;
- type_t
*type;
-
member_designator_t *member_designators
;
+ expression_t expression;
+ type_t *type;
+
designator_t *designator
;
};
struct va_arg_expression_t {
};
struct va_arg_expression_t {
@@
-200,16
+199,48
@@
typedef enum {
STORAGE_CLASS_ENUM_ENTRY
} storage_class_t;
STORAGE_CLASS_ENUM_ENTRY
} storage_class_t;
+typedef enum {
+ NAMESPACE_NORMAL,
+ NAMESPACE_STRUCT,
+ NAMESPACE_UNION,
+ NAMESPACE_ENUM
+} namespace_t;
+
+typedef enum {
+ INITIALIZER_VALUE,
+ INITIALIZER_LIST,
+} initializer_type_t;
+
+struct initializer_t {
+ initializer_type_t type;
+ designator_t *designator;
+ union {
+ initializer_t *list;
+ expression_t *value;
+ } v;
+ initializer_t *next;
+};
+
struct declaration_t {
struct declaration_t {
- storage_class_t storage_class;
+ unsigned short namespace;
+ unsigned short storage_class;
type_t *type;
symbol_t *symbol;
type_t *type;
symbol_t *symbol;
- statement_t *statement;
- expression_t *initializer;
source_position_t source_position;
source_position_t source_position;
+ union {
+ bool is_defined;
+ statement_t *statement;
+ initializer_t *initializer;
+ } init;
context_t context;
context_t context;
+ context_t *parent_context;
+ /** next declaration in a context */
+ declaration_t *context_next;
+ /** next declaration with same symbol */
declaration_t *next;
declaration_t *next;
+
+ ir_entity *entity;
};
typedef enum {
};
typedef enum {