.NAME Effective statement

.DESCRIPTION
There shall not be a statement containing only the following 
operators: 
>,<,>=, <=, ==, !=, &&, ||, true, false, 
not, <<, >>, &, |, +, -, /, *.

A cast expression cannot be a statement.

.SEVERITY Required

.COMMAND tcl

.CODE

::logiscope::include -once common utilities.tcl

proc compute {standardName tree} {
	
	# find the operators in the tree that are comparison operators
	::utilities::filterTree $tree [list [namespace current]::checkSimpleStmt]

}

proc checkSimpleStmt { tree } {

	if { [::utilities::isTreeOperator $tree stmts] } {
		::logiscope::forobj son $tree treeChild {
			if { [::utilities::isTreeOperator $son expr_stmt] } {
				switch [::utilities::treeOperatorName [::logiscope::treeGetSon $son EXPR]] {
					lt -
					gt -
					ge -
					le -
					eq -
					neq -
					and -
					or -
					true -
					false -
					bwnot -
					not -
					lsh -
					rsh -
					rrsh -
					bwand -
					bwor -
					bwxor -
					cast -
					plus -
					minus -
					mul -
					div -
					rem -
					uminus -
					uplus {
						::logiscope::addViolation $son
					}
				}
			}
		}
	}
	return 1
}

