coan  6.0.1
A C/C++ Configuration Analyzer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
contradiction.h
Go to the documentation of this file.
1 #ifndef CONTRADICTION_H
2 #define CONTRADICTION_H
3 #pragma once
4 /***************************************************************************
5  * Copyright (C) 2004, 2006 Symbian Software Ltd. *
6  * All rights reserved. *
7  * Copyright (C) 2007-2013 Mike Kinghan, imk@burroingroingjoing.com *
8  * All rights reserved. *
9  * *
10  * Contributed originally by Mike Kinghan, imk@burroingroingjoing.com *
11  * *
12  * Redistribution and use in source and binary forms, with or without *
13  * modification, are permitted provided that the following conditions *
14  * are met: *
15  * *
16  * Redistributions of source code must retain the above copyright *
17  * notice, this list of conditions and the following disclaimer. *
18  * *
19  * Redistributions in binary form must reproduce the above copyright *
20  * notice, this list of conditions and the following disclaimer in the *
21  * documentation and/or other materials provided with the distribution. *
22  * *
23  * Neither the name of Symbian Software Ltd. nor the names of its *
24  * contributors may be used to endorse or promote products derived from *
25  * this software without specific prior written permission. *
26  * *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
28  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
29  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
30  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
31  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
32  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
33  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
34  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED *
35  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
36  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
37  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
38  * DAMAGE. *
39  * *
40  **************************************************************************/
41 
42 #include "options.h"
43 
61 {
63  enum class cause {
67  UNDEFING_D,
70  };
71 
72 
77  _policy_ = p;
78  }
79 
115  static void forget();
116 
127  static void flush();
128 
142  static void insert(cause why, std::string const & symname);
143 
158  static void save(cause why, std::string const & symname);
159 
168  static std::string const & last_conflicted_symbol_id() {
170  }
171 
172 private:
173 
185  static void insert_pending();
186 
189 
193  static unsigned _policy_code_;
194 
200  static std::string _subst_text_;
201 
208  static std::string _last_conflicted_symbol_;
210  static unsigned _errored_lines_;
213 };
214 
215 #endif /* EOF*/
static unsigned _unconditional_errored_lines_
The number of lines converted to unconditional error directives.
static void forget()
Forget about an apparent contradiction.
static void save(cause why, std::string const &symname)
Save diagnostic details of a potential contradiction.
cause
Reasons for reporting a contadiction.
Definition: contradiction.h:63
An in-souce #define differently redefines a -D option.
An in-souce #undef contradicts a -D option.
static unsigned _errored_lines_
The number of lines converted to error directives.
static void insert_pending()
Insert a stored error diagnostic into output.
Class contradiction handles contradictions between commandline options and directives.
Definition: contradiction.h:60
static contradiction_policy _policy_
The operative contradiction policy.
contradiction_policy
Symbolic constants denoting policies for handling contradictions.
Definition: options.h:62
static void insert(cause why, std::string const &symname)
Insert an error diagnostic into the output as a error directive or comment.
An in-souce #define contradicts a -U option.
static std::string const & last_conflicted_symbol_id()
Get the name of the latest #undef-ed symbol.
static void flush()
Discharge any pending contradiction.
static std::string _last_conflicted_symbol_
The name of the latest #undef-ed symbol.
static void set_contradiction_policy(contradiction_policy p)
Set the operative contradiction policy.
Definition: contradiction.h:76
static unsigned _policy_code_
The reason-code of diagnostics associated with the operative contradiction policy.
static std::string _subst_text_
Text for substitution in output.