.NAME Size of arrays

.DESCRIPTION
When an array is declared, its size shall either be stated 
explicitly or defined implicitly by initialization. 

.COMMENT V7.0

.SEVERITY Required

.COMMENT
Please refer to the MISRA C++:2008 document for further details (www.misra-cpp.com)

.COMMAND tcl

.CODE

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

proc compute {standardName tree} {
  variable CurrentParameterList
  # Check all array_dcltr nodes
  utilities::filterTree $tree [list [namespace current]::check]
}

proc check { node } {
	if { [::utilities::isTreeOperator $node array_dcltr] } {
		# is it an initialized array ?
		set father [::logiscope::treeUp $node]
		if { [::utilities::isTreeOperator $father dcltr_noinit] } {
			# not initialized. Is there a dimension
			set dim [::logiscope::treeDown $node 1]
			if { [::utilities::isTreeOperator $dim none] } {
				::logiscope::addViolation $node
			}
		}
	}
	return 1
}
