1 ///////////////////////////////////////////////////////////////////////////////
3 // This file implements the options selected during translation.
5 ///////////////////////////////////////////////////////////////////////////////
12 ///////////////////////////////////////////////////////////////////////////////
14 // Default setting of the prop options
16 ///////////////////////////////////////////////////////////////////////////////
17 PropOptions::PropOptions()
21 strict_checking
= false;
22 line_directives
= true;
24 nonlinear_patterns
= false;
26 generate_report
= false;
28 fast_string_match
= false;
29 adaptive_matching
= 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
;
39 optimization_level
= 0;
40 max_embedded_tags
= 4;
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
)
103 int this_len
= strlen(file_name
);
104 if (this_len
+ len
>= 79) { len
= 8; std::cout
<< "\\\n\t"; }
105 std::cout
<< file_name
<< ' ';