summaryrefslogtreecommitdiffstats
path: root/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java
diff options
context:
space:
mode:
authorElliott Baron <ebaron@fedoraproject.org>2009-10-12 20:37:13 -0400
committerElliott Baron <ebaron@fedoraproject.org>2009-10-12 20:37:13 -0400
commit306422deda74c5a120771f42e70422f77efcd640 (patch)
tree6ad062db01d908c314d8824b3afeb8567c4c68da /org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java
parent18360ea0c9cd1fce259ba7cf6824b48736334c4f (diff)
downloadcodan-306422deda74c5a120771f42e70422f77efcd640.tar.gz
codan-306422deda74c5a120771f42e70422f77efcd640.tar.xz
codan-306422deda74c5a120771f42e70422f77efcd640.zip
Transition for branching complete; execution state made of CNF clauses of variable assignments & branch conditions; errors reported.
* org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionState.java: Use Clause class. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java: New file. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/PropertyState.java: Take optional name arg. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/SymbolicState.java: New copy method. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/VariableAssignmentVisitor.java: New file. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/checkers/CloseOpenedFilesChecker.java: See commit message. * org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/checkers/FunctionNameParser.java: Use IASTNode.
Diffstat (limited to 'org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java')
-rw-r--r--org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java b/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java
new file mode 100644
index 0000000..adb4e62
--- /dev/null
+++ b/org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Elliott Baron
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Elliott Baron - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.codan.extension;
+
+import org.eclipse.cdt.core.dom.ast.IASTNode;
+
+public class ExecutionStateClause {
+
+ private IASTNode node;
+ private boolean truthValue;
+
+ public ExecutionStateClause(IASTNode node) {
+ this(node, true);
+ }
+
+ public ExecutionStateClause(IASTNode node, boolean truthValue) {
+ this.node = node;
+ this.truthValue = truthValue;
+ }
+
+ public IASTNode getNode() {
+ return node;
+ }
+
+ public boolean isTrue() {
+ return truthValue;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ if (!truthValue) {
+ buf.append("NOT ");
+ }
+ buf.append(node.getRawSignature());
+ return buf.toString();
+ }
+
+}