DEADSOFTWARE

Patched for Linux
[mp3cc.git] / MPC.3.5.LINUX / structures / block.h
1 /********************************************************************
3 block.h - structures and functions used to hold program
4 block descriptions
6 Niksa Orlic, 2004-04-23
8 ********************************************************************/
10 #include <stdio.h>
12 /*
13 The structure to hold description for
14 one block;
15 */
16 struct block_struct
17 {
18 struct block_struct *parent_block;
20 name_table *names;
22 string *block_name;
24 int next_variable_index;
25 int next_parameter_index;
27 bytecode *code;
29 struct block_struct **children;
30 int children_count;
31 };
33 typedef struct block_struct block;
35 /* canvas types */
36 #define NORMAL 0
37 #define FULL_MIDP20 1
38 #define FULL_NOKIA 2
41 block* block_create(block*, string*);
42 void block_destroy(block*);
44 int block_check_name(block*, char*);
46 void add_real_constant(block*, float, char*);
47 void add_integer_constant(block*, long int, char*);
48 void add_char_constant(block*, char, char*);
49 void add_boolean_constant(block*, char, char*);
50 void add_string_constant(block*, string*, char*);
52 void add_variables(block*, string_list*, type*);
54 void add_type(block*, string*, type*);
56 void add_procedure(block*, string*, type_list*, int, int);
57 void add_function(block*, string*, type_list*,type*, int, int);
59 void load_extern_library(string*);
60 void read_library_file(FILE*, struct unit_struct*);
61 void read_symbol_file(FILE*, struct unit_struct*);
63 void add_parameters(block*, string_list*, type*, int);
65 void check_forward_declaration(identifier*, type_list*,
66 int, type*);
67 void check_unmatched_forward_declarations(block*, name_table*);
69 void transform_break_stmts(bytecode*, int, int, int);
71 type *type_from_name(block*, char*);
72 type *get_constant_type(block*, char*);
73 type *get_variable_type(block*, char*);
74 identifier *get_constant_identifier(block*, char*);
75 identifier *get_identifier(block*, char*);
77 void initialize_variable(block*, identifier*, char*, int, char*);
79 void create_class_file(block *root_block, FILE *fp);
80 void write_method(block *current_block, FILE *fp);
81 void write_block_fields(name_table *, FILE*);
83 void write_paint_method(FILE *fp);
84 void write_constructor(FILE *fp);
85 void write_run_method(FILE *fp);
86 void write_keypressed_method(FILE *fp);
87 void write_keyreleased_method(FILE *fp);
89 void write_locals_stackmap(FILE *fp, identifier *block_identifier, int* stack_map_size);
90 void write_stackmap(FILE *fp, type_list *it, int *stack_map_size);