typename fix
[prop.git] / prop-src / options.cc
blobdf3466f545578e5b7ff732f51b6a500de8546dfd
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // This file implements the options selected during translation.
4 //
5 ///////////////////////////////////////////////////////////////////////////////
6 #include <string.h>
7 #include <iostream>
8 #include "basics.h"
9 #include "config.h"
10 #include "options.h"
12 ///////////////////////////////////////////////////////////////////////////////
14 // Default setting of the prop options
16 ///////////////////////////////////////////////////////////////////////////////
17 PropOptions::PropOptions()
19 debug = false;
20 emit_code = true;
21 strict_checking = false;
22 line_directives = true;
23 trace = false;
24 nonlinear_patterns = false;
25 merge_match = true;
26 generate_report = false;
27 burs = false;
28 fast_string_match = false;
29 adaptive_matching = false;
30 inline_casts = false;
31 save_space = false;
32 tagged_pointer = false;
33 GNU_style_message = false;
34 new_type_format = true;
35 gen_dependences = false;
36 new_list_format = false;
37 max_vector_len = MAX_VECTOR_LEN;
38 verbosity = 0;
39 optimization_level = 0;
40 max_embedded_tags = 4;
41 input_file_name = 0;
42 to_stdout = false;
43 file_count = 0;
44 automake = false;
45 option_count = 0;
46 visualization = false;
47 generate_html = false;
48 optimize_rewrite = false;
49 strcpy(search_paths,DEFAULT_SEARCH_PATH);
51 PropOptions::~PropOptions() {}
53 ///////////////////////////////////////////////////////////////////////////////
55 // Features used are described by the following structure. We generate
56 // code so that only the features actually used are emitted. We'll keep
57 // track of which features are actually used in this structure.
59 ///////////////////////////////////////////////////////////////////////////////
60 Bool Used::rewriting = false;
61 Bool Used::infer = false;
62 Bool Used::gc = false;
63 Bool Used::regexp = false;
64 Bool Used::string_match = false;
65 Bool Used::printer = false;
66 Bool Used::refcount = false;
67 Bool Used::persistence = false;
68 Bool Used::objc = false;
69 Bool Used::equality = false;
70 Bool Used::unification = false;
71 Bool Used::vector = false;
72 Bool Used::parser = false;
73 Bool Used::quark = false;
74 Bool Used::bigint = false;
75 Bool Used::graph_type = false;
76 static Bool tuple_used[MAX_TUPLE_ARITY];
77 Bool * Used::tuple = tuple_used;
79 IncludeDependency * IncludeDependency::dependences = 0;
81 ///////////////////////////////////////////////////////////////////////////////
83 // Add a file to the dependency list
85 ///////////////////////////////////////////////////////////////////////////////
86 void IncludeDependency::add_dependency (const char * file)
87 { dependences = new IncludeDependency (file, dependences);
90 ///////////////////////////////////////////////////////////////////////////////
92 // Print the dependences
94 ///////////////////////////////////////////////////////////////////////////////
95 void IncludeDependency::print_dependences ()
96 { std::cout << options.output_file_name << ":\t" << options.input_file_name << ' ';
97 int len = strlen(options.output_file_name) + 10 + strlen(options.input_file_name);
98 IncludeDependency * d;
99 for (d = dependences; d; d = d->next)
100 { const char * file_name = d->file_name;
101 if (file_name[0] == '.' && file_name[1] == PATH_SEPARATOR)
102 file_name += 2;
103 int this_len = strlen(file_name);
104 if (this_len + len >= 79) { len = 8; std::cout << "\\\n\t"; }
105 std::cout << file_name << ' ';
106 len += this_len + 1;
108 std::cout << '\n';