Commit | Line | Data |
---|---|---|
d44e3c4f | 1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2016 Ericsson Telecom AB | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Balasko, Jeno | |
10 | * Baranyi, Botond | |
11 | * Cserveni, Akos | |
12 | * Delic, Adam | |
13 | * Forstner, Matyas | |
14 | * Kovacs, Ferenc | |
15 | * Kremer, Peter | |
16 | * Raduly, Csaba | |
17 | * Szabo, Janos Zoltan – initial implementation | |
18 | * Tatarka, Gabor | |
19 | * Zalanyi, Balazs Andor | |
20 | * | |
21 | ******************************************************************************/ | |
970ed795 EL |
22 | #ifndef COMPILER_H |
23 | #define COMPILER_H | |
24 | ||
25 | #include <stdio.h> | |
26 | ||
27 | #include "../../common/memory.h" | |
28 | #include "../datatypes.h" | |
29 | ||
30 | #ifdef __cplusplus | |
31 | extern "C" { | |
32 | #endif | |
33 | ||
34 | /* for generating output files */ | |
35 | ||
36 | typedef struct output_struct_t { | |
37 | struct { | |
38 | char *includes; | |
39 | char *class_decls; | |
40 | char *typedefs; | |
41 | char *class_defs; | |
42 | char *function_prototypes; | |
43 | char *global_vars; | |
44 | char *testport_includes; | |
45 | } header; | |
46 | struct { | |
47 | char *includes; | |
48 | char *static_function_prototypes; | |
49 | char *static_conversion_function_prototypes; | |
50 | char *string_literals; | |
51 | char *class_defs; | |
52 | char *global_vars; | |
53 | char *methods; | |
54 | char *function_bodies; | |
55 | char *static_function_bodies; | |
56 | char *static_conversion_function_bodies; | |
57 | } source; | |
58 | struct { | |
59 | char *pre_init; /**< Code for pre_init_module() */ | |
60 | char *post_init; /**< Code for post_init_module() */ | |
61 | char *set_param; /**< Code for set_module_param() */ | |
3abe9331 | 62 | char *get_param; /**< Code for get_module_param() */ |
970ed795 EL |
63 | char *log_param; /**< Code for log_module_param() */ |
64 | char *init_comp; /**< Code for init_comp_type() */ | |
65 | char *start; /**< Code for start_ptc_function() */ | |
66 | char *control; /**< Code for module_control_part() */ | |
67 | } functions; | |
68 | } output_struct; | |
69 | ||
70 | typedef struct expression_struct_t { | |
71 | char *preamble; | |
72 | char *expr; | |
73 | char *postamble; | |
74 | } expression_struct; | |
75 | ||
76 | /* for global and local constant definitions */ | |
77 | ||
78 | typedef struct const_def_t { | |
79 | char *decl; | |
80 | char *def; | |
81 | /* char *cdef; */ | |
82 | char *init; | |
83 | } const_def; | |
84 | ||
85 | /* Commonly used functions and variables */ | |
86 | ||
87 | extern const char *infile; | |
88 | ||
89 | extern void write_output(output_struct *output, const char *module_name, | |
90 | const char *module_dispname, const char *filename_suffix, boolean is_ttcn, | |
91 | boolean has_circular_import, boolean is_module); | |
92 | extern void report_nof_updated_files(void); | |
93 | ||
94 | extern FILE *open_output_file(const char *file_name, boolean *is_temporary); | |
95 | extern void close_output_file(const char *file_name, FILE *fp, | |
96 | boolean is_temporary, size_t skip_lines); | |
97 | ||
98 | #ifdef __cplusplus | |
99 | } | |
100 | #endif | |
101 | ||
102 | extern int ttcn3_parse_file(const char* filename, boolean generate_code); | |
103 | ||
104 | #endif |