From 306422deda74c5a120771f42e70422f77efcd640 Mon Sep 17 00:00:00 2001 From: Elliott Baron Date: Mon, 12 Oct 2009 20:37:13 -0400 Subject: 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. --- .../cdt/codan/extension/ExecutionStateClause.java | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java (limited to 'org.eclipse.cdt.codan.extension/src/org/eclipse/cdt/codan/extension/ExecutionStateClause.java') 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(); + } + +} -- cgit