|
KCC - Kayte C Compiler 1.10.0
A C compiler implementation with preprocessor, lexer, parser, and code generator
|
AST Node structure. More...
#include <types.h>
Data Fields | |
| ASTNodeType | type |
| DataType | data_type |
| int | line |
| int | column |
| union { | |
| struct { | |
| struct ASTNode ** declarations | |
| int declaration_count | |
| } program | |
| struct { | |
| DataType return_type | |
| char * name | |
| struct ASTNode ** parameters | |
| int parameter_count | |
| struct ASTNode * body | |
| } function_decl | |
| struct { | |
| DataType var_type | |
| char * name | |
| struct ASTNode * initializer | |
| } var_decl | |
| struct { | |
| DataType param_type | |
| char * name | |
| } parameter | |
| struct { | |
| struct ASTNode ** statements | |
| int statement_count | |
| } compound_stmt | |
| struct { | |
| struct ASTNode * expression | |
| } expression_stmt | |
| struct { | |
| struct ASTNode * expression | |
| } return_stmt | |
| struct { | |
| struct ASTNode * condition | |
| struct ASTNode * then_stmt | |
| struct ASTNode * else_stmt | |
| } if_stmt | |
| struct { | |
| struct ASTNode * condition | |
| struct ASTNode * body | |
| } while_stmt | |
| struct { | |
| struct ASTNode * init | |
| struct ASTNode * condition | |
| struct ASTNode * update | |
| struct ASTNode * body | |
| } for_stmt | |
| struct { | |
| TokenType operator | |
| struct ASTNode * left | |
| struct ASTNode * right | |
| } binary_expr | |
| struct { | |
| TokenType operator | |
| struct ASTNode * operand | |
| } unary_expr | |
| struct { | |
| char * function_name | |
| struct ASTNode ** arguments | |
| int argument_count | |
| } call_expr | |
| struct { | |
| char * name | |
| } identifier | |
| struct { | |
| int value | |
| } number | |
| struct { | |
| char * value | |
| } string | |
| struct { | |
| char * variable | |
| struct ASTNode * value | |
| } assignment | |
| struct { | |
| char * class_name | |
| char * superclass_name | |
| struct ASTNode ** protocols | |
| int protocol_count | |
| struct ASTNode ** methods | |
| int method_count | |
| struct ASTNode ** properties | |
| int property_count | |
| } objc_interface | |
| struct { | |
| char * class_name | |
| char * category_name | |
| struct ASTNode ** methods | |
| int method_count | |
| struct ASTNode ** ivars | |
| int ivar_count | |
| } objc_implementation | |
| struct { | |
| ObjCMethodType method_type | |
| DataType return_type | |
| char * selector | |
| ObjCMethodParam * params | |
| int param_count | |
| struct ASTNode * body | |
| } objc_method | |
| struct { | |
| struct ASTNode * receiver | |
| char * selector | |
| struct ASTNode ** arguments | |
| int argument_count | |
| } objc_message | |
| struct { | |
| DataType property_type | |
| char * property_name | |
| ObjCPropertyAttributes attributes | |
| char * getter_name | |
| char * setter_name | |
| } objc_property | |
| struct { | |
| char * protocol_name | |
| struct ASTNode ** methods | |
| int method_count | |
| struct ASTNode ** properties | |
| int property_count | |
| } objc_protocol | |
| struct { | |
| char * value | |
| } objc_string | |
| struct { | |
| char * selector_name | |
| } objc_selector | |
| struct { | |
| bool value | |
| } objc_boolean | |
| } | data |
AST Node structure.
Main AST node structure supporting both C and Objective-C constructs.
| ObjCPropertyAttributes ASTNode::attributes |
| ObjCMethodType ASTNode::method_type |
| ObjCMethodParam* ASTNode::params |
| ASTNodeType ASTNode::type |