.NAME # and ## operators

.DESCRIPTION
	The # and ## operators should not be used. 

.COMMENT V7.0

.SEVERITY Advisory

.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 ... nodes
  utilities::filterTree $tree [list [namespace current]::check]
}

proc check { node } {
	if {[::utilities::isTreeOperator $node pp_define]} {
		set pp_text [::logiscope::treeGetSon $node PP_TEXT]
		set content ""
		::logiscope::forobj l $pp_text treeChild {
			set content $content[::utilities::treeAtomString $l]
		}
		if {[regexp {.*#{1,2}.*} $content]} {
			::logiscope::addViolation $node			
		}
	}
	return 1
}
