Index: trunk/t3q-examples/.project
===================================================================
--- trunk/t3q-examples/.project	(revision 4)
+++ trunk/t3q-examples/.project	(revision 4)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>t3q-examples</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>de.ugoe.cs.swe.trex.ui.rulebuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>de.ugoe.cs.swe.trex.ui.trexnature</nature>
+	</natures>
+</projectDescription>
Index: trunk/t3q-examples/CodeFormatting/Generic/formattingIssues.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/Generic/formattingIssues.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/Generic/formattingIssues.ttcn3	(revision 4)
@@ -0,0 +1,19 @@
+module formattingIssues {
+	import from a all;
+	import from a all;
+	
+	group a {
+	function f_ssMsInitiateDhcpv4(){
+		//blas bla blas
+	} //end function f_ssMsInitiateDhcpv4
+
+	altstep as(){
+	}
+    function f_ssMsStartDhcpv4 (){
+ 		var integer a := b;
+ 
+    }
+    }
+    
+    
+}
Index: trunk/t3q-examples/CodeFormatting/Generic/generic.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/Generic/generic.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/Generic/generic.ttcn3	(revision 4)
@@ -0,0 +1,204 @@
+module generic {
+	
+
+//module parameters
+modulepar boolean mp_boolean := true;
+modulepar { integer mp_int1, mp_int2 := 2; integer mp_int3 := 3;}
+
+
+//full function body with multiple parameters, including passing modes, runs on clause and return value
+function f_sample2 ( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) 
+runs on R3Comp 
+return FncRetCode {
+  var FncRetCode v_ret := e_success;
+
+  alt {
+    [] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd (
+                          e_RadiusAccountingRequest,
+                          m_radiusAccntReq_any ) ) {
+      return e_error;
+    }
+  } 
+  return v_ret;
+}   
+//function skeleton with a single parameter, including a passing mode, with a runs on clause
+function f_sample1 (in template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//function skeleton with a single parameter, with a runs on clause 
+function f_sample11 (template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//function skeleton without parameters, with a return value
+function f_sample () 
+	return r {
+}
+
+//full function body with multiple parameters, including passing modes, no further clauses
+function f_sample21( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) {
+
+  var integer v_var1 := 0;
+  var integer v_var2 := 10;
+  
+  while (v_var1 < v_var2){
+  	v_var1:=v_var1+1;
+  }
+  
+}
+
+
+//altstep skeleton without parameters
+altstep a_sample () 
+	runs on R3Comp {
+}
+
+//altstep with full body, multiple parameters, with passing modes and a runs on clause
+
+altstep a_sample2 ( template R3Msg p_radiusAccntReq, inout template R3Msg p_radiusAccntRsp ) 
+	runs on R3Comp {
+
+[] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+ }
+
+
+//altstep skeleton with a single parameter
+altstep a_sample1 (template R3Msg p_radiusAccntReq) {
+}
+
+//sample test case with full body, multiple parameters, with modifiers, runs on and system clauses
+testcase tc_sample2 ( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) 
+runs on R3Comp 
+system R3System {
+  var FncRetCode v_ret := e_success;
+
+  alt {
+    [] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd (
+                          e_RadiusAccountingRequest,
+                          m_radiusAccntReq_any ) ) {
+    }
+    [] a_sample2 (m_r3MonitorInd,m_r3MonitorInd);
+    [] a_sample1 (m_r3MonitorInd);
+    [] a_sample0 ();
+  }
+
+}   
+//sample test case skeleton with a single parameter, including a passing mode, with a runs on clause
+testcase tc_sample1 (in template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//test tcase skeleton with a single parameter, with a runs on clause and a system clause 
+testcase tc_sample11 (template R3Msg p_radiusAccntReq) 
+	runs on R3Comp system R3System {
+	f_sample();
+	f_sample1(p_radiusAccntReq);
+	f_sample2(p_radiusAccntReq,p_radiusAccntRsp) 
+}
+
+//test case skeleton without parameters, with a runs on clause
+testcase tc_sample () 
+	runs on R3Comp {
+}
+
+	//template with a single parameter
+	template type1 template1 (integer i) :={
+		int1 :=i,
+		int2 :=2
+	}
+
+	template type1 template11 (integer i) modifies template1 :={
+		int1 :=i,
+		int2 :=4 
+	}
+
+
+
+	//template with multiple parameters
+	template type1 template2 (integer i1, integer i2) :={
+		int1 :=i1,
+		int2 :=i2
+	}
+
+	
+	signature s_lookup () return charstring exception (e_NotFound);
+
+	signature s_accept () return charstring exception (e_NotFound);
+
+	
+	signature s_lookup1 (in charstring key) return charstring exception (e_NotFound);
+	
+	signature s_lookup2 (in charstring key, in charstring id) return charstring exception (e_NotFound);
+	
+	signature s_lookup3 (in charstring key, in charstring id, inout integer state) return charstring exception (e_NotFound);
+	
+	//not clear if legal, or useful...
+	//parser seems to fail
+	//it is legal
+	type record type2 (integer i1, integer i2) {
+		integer range (i1 .. i2)
+	}
+
+	type integer range2 (1 .. 10);
+
+	//this should also be legal although maybe not in the current version
+	//the above is an indirect version
+	//type integer intRange (integer min, integer max ) (min .. max);
+	const type2(1,10) c_range := 3;
+	
+	//type integer binary (0,1);
+	//type integer octary (0 .. 7);
+
+	//illegal 
+	//type record type3 (integer i1, integer i2) {
+	//	i1 binary,
+	//	i2 octary
+	//}
+	
+	testcase tc_sample_procedurebased() runs on sampleComponent system systemComponent{
+		port1.call(s_lookup:{x}) {
+			[]port1.getreply(s_accept:{y}) {
+			
+			}
+		}
+	}
+	
+	control{
+		execute(tc_sample1(template_sample1));
+		execute(tc_sample2(template_sample1,template_sample2));
+		execute(tc_sample());
+	}
+	
+
+	
+}
Index: trunk/t3q-examples/CodeFormatting/altsteps.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/altsteps.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/altsteps.ttcn3	(revision 4)
@@ -0,0 +1,26 @@
+module altsteps {
+//altstep skeleton without parameters
+altstep a_sample () 
+	runs on R3Comp {
+}
+
+//altstep with full body, multiple parameters, with passing modes and a runs on clause
+
+altstep a_sample2 ( template R3Msg p_radiusAccntReq, inout template R3Msg p_radiusAccntRsp ) 
+	runs on R3Comp {
+
+		[]	r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      		v_ret := e_success;
+    	}
+    	[] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      		v_ret := e_success;
+    	}
+ }
+
+
+//altstep skeleton with a single parameter
+altstep a_sample1 (template R3Msg p_radiusAccntReq) {
+}	
+}
Index: trunk/t3q-examples/CodeFormatting/functions.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/functions.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/functions.ttcn3	(revision 4)
@@ -0,0 +1,54 @@
+module functions {
+//full function body with multiple parameters, including passing modes, runs on clause and return value
+function f_sample2 ( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) 
+runs on R3Comp 
+return FncRetCode {
+  var FncRetCode v_ret := e_success;
+
+  alt {
+    [] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd (
+                          e_RadiusAccountingRequest,
+                          m_radiusAccntReq_any ) ) {
+      return e_error;
+    }
+  } 
+  return v_ret;
+}   
+//function skeleton with a single parameter, including a passing mode, with a runs on clause
+function f_sample1 (in template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//function skeleton with a single parameter, with a runs on clause 
+function f_sample11 (template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//function skeleton without parameters, with a return value
+function f_sample () 
+	return r {
+}
+
+//full function body with multiple parameters, including passing modes, no further clauses
+function f_sample21( template R3Msg p_radiusAccntReq, out template R3Msg p_radiusAccntRsp ) {
+
+  var integer v_var1 := 0;
+  var integer v_var2 := 10;
+  
+  while (v_var1 < v_var2){
+  	v_var1:=v_var1+1;
+  }
+  
+}
+	
+}
Index: trunk/t3q-examples/CodeFormatting/misc.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/misc.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/misc.ttcn3	(revision 4)
@@ -0,0 +1,37 @@
+module misc {
+
+//module parameters
+modulepar boolean mp_boolean := true;
+modulepar { integer mp_int1, mp_int2 := 2; integer mp_int3 := 3;}
+
+	//template with a single parameter
+	template type1 template1 (integer i) :={
+		int1 :=i,
+		int2 :=2
+	}
+
+	template type1 template11 (integer i) modifies template1 :={
+		int1 :=i,
+		int2 :=4 
+	}
+
+
+
+	//template with multiple parameters
+	template type1 template2 (integer i1, integer i2) :={
+		int1 :=i1,
+		int2 :=i2
+	}
+
+	type record type2 (integer i1, integer i2) {
+		integer range (i1 .. i2)
+	}
+
+	type integer range2 (1 .. 10);
+
+	const type2(1,10) c_range := 3;
+	
+
+
+	
+}
Index: trunk/t3q-examples/CodeFormatting/multilinecomments.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/multilinecomments.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/multilinecomments.ttcn3	(revision 4)
@@ -0,0 +1,45 @@
+/**
+sum
+	top
+		level comment
+*/
+
+module multilinecomments {
+	/**jhkjhgkhh
+	
+	*** asdf 
+	;kj;lkj;kk
+	k';ugg
+	*/
+	//lgftf
+	//iut76riug
+	function f_1(){
+/* 0
+	 1
+	2 
+3
+4*/
+	}
+	
+	template integer t2 := {
+	
+	}
+	/* 0
+	 1
+	2 
+3
+4*/
+	function t2(){
+	} //end function f_sendEchoRequest
+
+		/* * @desc
+*........
+*/
+	function f_receiveEchoRequest() {
+	} 
+	//some some
+	/*********************************************************************/
+	//then some
+	/*********************************************************************/
+
+}
Index: trunk/t3q-examples/CodeFormatting/testcases.ttcn3
===================================================================
--- trunk/t3q-examples/CodeFormatting/testcases.ttcn3	(revision 4)
+++ trunk/t3q-examples/CodeFormatting/testcases.ttcn3	(revision 4)
@@ -0,0 +1,63 @@
+module testcases {
+	//sample test case with full body, multiple parameters, with modifiers, runs on and system clauses
+testcase tc_sample2 ( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) 
+runs on R3Comp 
+system R3System {
+  var FncRetCode v_ret := e_success;
+
+  alt {
+    [] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd (
+                          e_RadiusAccountingRequest,
+                          m_radiusAccntReq_any ) ) {
+    }
+    [] a_sample2 (m_r3MonitorInd,m_r3MonitorInd);
+    [] a_sample1 (m_r3MonitorInd);
+    [] a_sample0 ();
+  }
+
+}   
+//sample test case skeleton with a single parameter, including a passing mode, with a runs on clause
+testcase tc_sample1 (in template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//test tcase skeleton with a single parameter, with a runs on clause and a system clause 
+testcase tc_sample11 (template R3Msg p_radiusAccntReq) 
+	runs on R3Comp system R3System {
+	f_sample();
+	f_sample1(p_radiusAccntReq);
+	f_sample2(p_radiusAccntReq,p_radiusAccntRsp) 
+}
+
+//test case skeleton without parameters, with a runs on clause
+testcase tc_sample () 
+	runs on R3Comp {
+}	
+
+	
+	testcase tc_sample_procedurebased() runs on sampleComponent system systemComponent{
+		port1.call(s_lookup:{x}) {
+			[]port1.getreply(s_accept:{y}) {
+			
+			}
+		}
+	}
+	
+	control{
+		execute(tc_sample1(template_sample1 := template_sample2));
+		execute(tc_sample2(template_sample1,template_sample2));
+		execute(tc_sample());
+	}
+	
+
+}
Index: trunk/t3q-examples/Identifiers/Identifiers.ttcn3
===================================================================
--- trunk/t3q-examples/Identifiers/Identifiers.ttcn3	(revision 4)
+++ trunk/t3q-examples/Identifiers/Identifiers.ttcn3	(revision 4)
@@ -0,0 +1,260 @@
+module Identifiers {
+	//ALSO not ready for formatting, investigate
+
+	
+	group module_parameters{
+		//module parameters - done
+		//TREE => ModuleDef->ModuleParDef->ModulePar->Type
+		//											->ModuleParList->Identifier | ConstExpression
+		//								 ->MultitypedModuleParList->ModulePar*
+		//				   				 
+		modulepar u_1 mp_1, mp_2;
+		modulepar integer mp_3, mp_4, mp_5 := 1, mp_6;
+		modulepar {
+			u_1 mp_7 :=1, mp_8;
+			integer mp_9;
+		}
+		modulepar{
+		}
+	}
+
+	
+	//=======================================//
+	
+	group signatures{
+		//signature definitions - done
+		//TREE => ModuleDef->SignatureDef->Identifier
+		signature s_1 ();
+	}	
+
+	group templates{
+		//template definitions - done ?
+		//TREE => ModuleDef->TemplateDef->TemplateRestriction ?
+		//								->BaseTemplate->Type | Signature
+		//											  ->Identifier
+		template integer pt_1 := 1;
+
+		template u_1 ut_1 := {
+			field1 := pt_1 
+		} 
+
+		template u_1 ut_2 modifies ut_1 := {
+			field1 :=2
+		} 
+
+		template u_1 put_1 (integer p_1) := {
+			field1 := p_1 
+		} 
+
+		template u_1 put_1 (u_1 p_1) := { //repeated identifier
+			field1 := p_1 
+		} 
+	
+		template (omit) u_1 oput_1 (u_1 p_1) := {
+			field1 := p_1 
+		} 
+		
+//		template (value)
+		
+//		template (present)
+	
+	
+	}
+
+	
+	group types{
+		//type definitions
+			
+		group structured{
+			//structured - done
+			//ports - done
+			//TREE => ModuleDef->TypeDef->StructuredTypeDef->PortDef->Identifier
+			type port p_1 message{
+				inout subtype_1
+			}
+		
+			//components - done - identical to ports
+			//TREE => ModuleDef->TypeDef->StructuredTypeDef->ComponentDef->Identifier
+			type component comp_1 {
+				var subtype_1 localDef_1;
+				//...
+			}
+			type component comp_2 extends comp_1 {
+				var subtype_1 localDef_2;
+				//...
+			}
+		
+			//enum - done
+			//TREE => ModuleDef->TypeDef->StructuredTypeDef->EnumDef->Identifier | address
+			
+			type enumerated address {A,B};
+			
+			type enumerated subtype_1 {X, y, Z};
+		
+		
+			//unions - done - similar to sets and records
+			//TREE => ModuleDef->TypeDef->StructuredTypeDef->UnionDef->UnionDefBody->Identifier | address
+			type union address {subtype_1 field_1}
+			
+			type union u_1{
+				subtype_1 field_1	
+			}	
+	
+			group sets_and_records{	
+				//records - done
+				//TREE => ModuleDef->TypeDef->StructuredTypeDef->RecordDef->StructDefBody->Identifier | address
+				type record address {}
+				
+				type record r_1{
+					subtype_1 field_1	
+				}	
+			
+				//sets - done - identical to records
+				//TREE => ModuleDef->TypeDef->StructuredTypeDef->SetDef->StructDefBody->Identifier | address
+				type set address {}
+				
+				type set s_1{
+					subtype_1 field_1	
+				}	
+				
+				//record of - done
+				//TREE => ModuleDef->TypeDef->StructuredTypeDef->RecordOfDef->StringLength ?
+				//															->StructOfDefBody->(Type | NestedTypeDef)->Identifier | address
+				type record of subtype_1 address (a,b) //=> this should be legit generates errors though 
+				type record of subtype_1 ro_1
+			
+				type record length(2) of subtype_1 address (a,b) 
+				type record length(2..4) of subtype_1 ro_2
+				
+				//with nested types
+				type record of record{subtype_1 field_1} address (a,b) 
+				type record of record{subtype_1 field_1} ron_1
+			
+				type record length(2) of record{subtype_1 field_1}  address (a,b) 
+				type record length(2..4) of record{subtype_1 field_1}  ro_2
+				
+				
+				//set of - done - identical to record of 
+				//TREE => ModuleDef->TypeDef->StructuredTypeDef->SetOfDef->StringLength ?
+				//  													 ->StructOfDefBody->(Type | NestedTypeDef)->Identifier | address
+				type set of subtype_1 address (a,b) 
+				type set of subtype_1 ro_1
+			
+				type set length(2) of subtype_1 address (a,b) 
+				type set length(2..4) of subtype_1 ro_2
+				
+				//with nested types
+				type set of set{subtype_1 field_1} address (a,b) 
+				type set of record{subtype_1 field_1} ron_1
+			
+				type set length(2) of record{subtype_1 field_1}  address (a,b) 
+				type set length(2..4) of set{subtype_1 field_1}  ro_2
+				
+			}
+		}
+		group subtyped{
+			//subtyped - done
+			//TREE => ModuleDef->TypeDef->SubTypeDef->Type
+			//										->Identifier | address
+			
+			type integer subtype_a;
+			
+			type subtype_a subtype_b;
+				
+			type integer subtype_1 (1..10);
+			
+			type subtype_1 subtype_2 (4..8);
+			
+			type integer address (A .. D);
+			
+			type subtype_1 address (X, y, Z);
+			
+			type integer subtype_3[3] (1..10);
+			
+			type subtype_1 subtype_4[4] (4..8);
+			
+			type integer address[2] (A .. D);
+			
+			type subtype_1 address[2] (X, y, Z);
+	
+		}
+	}
+	
+	group constants{
+		//constant definitions - done
+		//TREE => ModuleDefinition->ConstDef->Type
+		//								    ->SingleConstDef->Identifier
+		const subtype_1 c_1 := x;
+		const subtype_2 c_2 := y,c_3 := z;
+	}
+	
+	group functions{	
+		//function definitions - done
+		//TREE => ModuleDefinition->FunctionDef->Identifier
+	
+		function f_1 () runs on comp_1 {
+			var subtype_1 localDef_1;
+			//...
+		}
+	
+		function f_2 (subtype_1 fp_1, subtype_2 fp_2) runs on comp_1 {
+			var subtype_1 localDef_1;
+			//...
+		}
+	}
+	
+	group testcases{
+		//testcase definitions - done
+		//TREE => ModuleDefinition->TestcaseDef->Identifier
+	
+		testcase tc_1 () runs on comp_1 system sys_1 {
+			var subtype_1 localDef_1;
+			//...
+		}
+	
+		testcase tc_2 (subtype_1 fp_1, subtype_2 fp_2) runs on comp_1 system sys_1 {
+			var subtype_1 localDef_1;
+			//...
+		}
+	}
+	
+	group altsteps{
+		//altstep definitions - done
+		//TREE => ModuleDefinition->AltstepDef->Identifier
+		
+		altstep as_1 () runs on comp_1{
+		 	var subtype_1 localDef_1;
+		 	//...
+		}
+	
+		altstep as_2 (type_1 fp_1, type_2 fp_2) runs on comp_1{
+		 	var subtype_1 localDef_1;
+		 	//...
+		}
+	}
+		
+	//=======================================//
+
+	//group definitions - done
+	////TREE => ModuleDefinition->GroupDef->Identifier
+	group g_1 {
+		group g_2{
+		
+		}
+	}
+	
+	//=======================================//
+
+	group externals{
+		//external constant definitions - done
+		//TREE => ModuleDefinition->ExtConstDef->Type
+		//									   ->Identifier+
+		external const subtype_1 cx_1;
+		external const type_2 cx_2, cx_3;
+	
+		//external function definitions - done
+		//TREE => ModuleDefinition->ExtFunctionDef->Identifier
+		external function fx_1 ();
+		external function fx_2 (type_1 fp_1, type_2 fp_2) return type_3;
+	}
+}
Index: trunk/t3q-examples/NamingConventions/NC_modules_groups_dataTypes.ttcn3
===================================================================
--- trunk/t3q-examples/NamingConventions/NC_modules_groups_dataTypes.ttcn3	(revision 4)
+++ trunk/t3q-examples/NamingConventions/NC_modules_groups_dataTypes.ttcn3	(revision 4)
@@ -0,0 +1,45 @@
+module NC_modules_groups_dataTypes {
+    //data type definitions, good and bad
+    type record address {
+        charstring host,
+        integer portField
+    }
+
+    type address Addr;
+
+    type set of charstring Method_List;
+
+    type record of charstring CharList;
+
+    type record of charstring charList1;
+
+    type record TypeA {
+        integer field1,
+        charstring field2,
+        boolean feild3
+    }
+
+    type record TypeB {
+        integer field1,
+        charstring field2,
+        boolean feild3,
+        TypeA field4
+    }
+    //groups, good and bad
+
+    group g1 {
+    } 
+
+    group G1 {
+    }
+    //ports, filed under dataTypes, good and bad 
+
+    type port port_1 message {
+        inout integer;
+    }
+
+    type port Port_2 message {
+        inout integer;
+    }
+
+}
Index: trunk/t3q-examples/NamingConventions/NC_parameters_functions_testCases_altsteps.ttcn3
===================================================================
--- trunk/t3q-examples/NamingConventions/NC_parameters_functions_testCases_altsteps.ttcn3	(revision 4)
+++ trunk/t3q-examples/NamingConventions/NC_parameters_functions_testCases_altsteps.ttcn3	(revision 4)
@@ -0,0 +1,43 @@
+module NC_parameters_functions_testCases_altsteps {
+
+	//module parameters, good and bad
+    modulepar boolean PC_UAS := true
+      with {extension "Description: Does IUT behaves as UA Server ?"}
+ 
+    modulepar integer MP_1;
+
+    modulepar {
+        integer MP_2:=3, Mp_3;
+    } 
+
+    modulepar integer mP_4, MP_5;
+
+    //altsteps, good and bad
+    altstep a_a1()  {
+    }
+
+    altstep a_1()  {
+    }
+
+    altstep aa_1()  {
+    }
+
+//functions, good and bad
+//also variables, component instances and constants
+    function f_a0() {
+        var integer v_a1, b;
+        var comp_1 ptc1;
+        const integer c_a1 := 1, c_2 := 1;
+    }
+
+    function ef_0() {
+    }
+
+    testcase tc_1() runs on comp_1 {
+    }
+
+    testcase TC_1() runs on comp_1 {
+        map(self:P2, system:p1);
+    }
+
+}
Index: trunk/t3q-examples/NamingConventions/NC_stf160templates.ttcn3
===================================================================
--- trunk/t3q-examples/NamingConventions/NC_stf160templates.ttcn3	(revision 4)
+++ trunk/t3q-examples/NamingConventions/NC_stf160templates.ttcn3	(revision 4)
@@ -0,0 +1,88 @@
+module NC_stf160templates {
+
+	//good ones
+	template (value) type1 cs_template1 := {
+	
+	}
+
+	template (value) type1 cs_template2 (charstring cs) := {
+	
+	}
+
+	template (value) type1 cs_template3 (template (value) charstring cs) := {
+	
+	}
+
+	template (omit) type1 cs_template4 (template (value) charstring cs) := {
+	
+	}
+
+	template (value) type1 cs_template5 (template (omit) charstring cs) := {
+	
+	}
+
+	template type1 cr_template1 := {
+	
+	}
+
+	template (present) type1 cr_template2 (charstring cs) := {
+	
+	}
+
+	template type1 cr_template3 (template (value) charstring cs) := {
+	
+	}
+
+	template (present) type1 cr_template4 (template (value) charstring cs) := {
+	
+	}
+
+	template type1 cr_template5 (template (omit) charstring cs) := {
+	
+	}
+
+	//bad ones
+	template type1 cs_badtemplate1 := {
+	
+	}
+	template (present) type1 cs_badtemplate2 (template (omit) charstring cs) := {
+	
+	}
+	
+	template (value) type1 cr_badtemplate3 (template (value) charstring cs) := {
+	
+	}
+
+	//inconclusive or bad?
+	template (omit) type1 cs_badtemplate4 (template charstring cs) := {
+	
+	}
+	template (omit) type1 cs_badtemplate5 (template (present) charstring cs) := {
+	
+	}
+
+	//derived templates
+	//good
+	template (present) type1 dcr_template4 (template (value) charstring cs) modifies cr_template4 := {
+	
+	}
+
+	template type1 dcr_template5 (template (omit) charstring cs) modifies dcr_template5 := {
+	
+	}
+	//bad
+	template (present) type1 cr_badtemplate4d (template (value) charstring cs) modifies cr_template4 := {
+	
+	}
+
+	template (value) type1 cs_badtemplate3 (template (value) charstring cs) modifies cs_template3:= {
+	
+	}
+
+	template (value) type1 dcr_badtemplate5 (template (omit) charstring cs) modifies cr_template5 := {
+	
+	}
+	
+	
+
+}
Index: trunk/t3q-examples/NamingConventions/NC_templates_constants_signatures_enumeratedValues.ttcn3
===================================================================
--- trunk/t3q-examples/NamingConventions/NC_templates_constants_signatures_enumeratedValues.ttcn3	(revision 4)
+++ trunk/t3q-examples/NamingConventions/NC_templates_constants_signatures_enumeratedValues.ttcn3	(revision 4)
@@ -0,0 +1,100 @@
+module NC_templates_constants_signatures_enumeratedValues {
+    //template definitions, with and without matching symbols, good and bad
+    template TypeA m_templateB := {
+        field1 := ?, 
+        field2 := "a", 
+        field3 := true
+    }
+
+    template TypeA mw_templateC := {
+        field1 := 1, 
+        field2 := pattern "a", 
+        field3 := true
+    }
+
+    template TypeA m_templateA := {
+        field1 := 1, 
+        field2 := "a", 
+        field3 := true
+    }
+
+	//derived templates
+    template (value) TypeA md_templateAd modifies m_templateA := {
+        field1 := 2
+    }
+
+    template TypeA mdw_templateCd modifies m_templateC := {
+        field2 := pattern "a", 
+        field3 := true
+    }
+
+
+    template TypeB m_templateBA := {
+        field1 := 1, 
+        field2 := "a", 
+        field3 := true,
+        //field4 := m_templateA  
+        field4 := {
+            field1 := 1, 
+            field2 := "a", 
+            field3 := true
+        }
+    }
+
+    template integer m_i1 := (1, 2);
+
+    template integer m_i2 := ?;
+
+	template GrantMngtSubHeader m_grantMngtUgsSi0 := {
+		schSvcUgs := {
+			si := '0'B ,
+			pm := ? ,
+			reserved14 := c_14ZeroBits
+		}
+	}
+
+
+	//enumerated values, good and bad,
+	//also data types, good and bad
+	type enumerated Enum {
+		e_a, e_b, e_c
+	}
+
+	type enumerated enum {
+		a, b, c
+	}
+
+	//signatures, goot and bad
+	//also formal parameters, good and bad
+    signature s_lookup1(in charstring p_key) return charstring exception (e_NotFound);
+
+    signature sx_lookup1(in charstring key) return charstring exception (e_NotFound);
+
+	//constants and external constants, good and bad
+    const integer c_a1 := 2;
+
+    const integer c_1 := 2 , c_2 :=3;
+
+	external const integer cx_a0;
+    external const integer ecx_a0, cx_1;
+	
+	function f_00(){
+		const type_00 const_00 := 1;
+	}
+	
+	altstep a_00(){
+		const type_00 const_00 := 1;
+	}
+	
+	testcase ts_00() runs on component_00 {
+		const type_00 cl_onst_00 := 1;
+	}
+
+    const integer cl_a1 := 2;
+	
+	control{
+		const type_00 cl_onst_00 := 1;
+	}
+	
+
+}
Index: trunk/t3q-examples/NamingConventions/NC_variables_timers_componentInstances_portInstances.ttcn3
===================================================================
--- trunk/t3q-examples/NamingConventions/NC_variables_timers_componentInstances_portInstances.ttcn3	(revision 4)
+++ trunk/t3q-examples/NamingConventions/NC_variables_timers_componentInstances_portInstances.ttcn3	(revision 4)
@@ -0,0 +1,36 @@
+module NC_variables_timers_componentInstances_portInstances {
+    //port instances, good and bad
+    //also component  data-type definition, bad
+    type component comp_1 {
+        port port_1 p1, P3
+        port port_1 P2
+        port port_1 p4
+    }
+    //timer, variable and component instances in a component, good and bad
+    //also component data-type definition, good
+
+    type component Comp_1 {
+        timer tc_a1, Tc_a2;
+        var integer vc_a, c;
+        var integer b := 2, vc_d := 3;
+        var integer vc_1e;
+        var Comp_12 Cc, bB, Aa;
+    }
+    //variable, timer and component instances in a function, good and bad	
+    //also formal parameters, good
+    //also function definition, good
+
+    function f_a3(inout charstring p_c, in template integer p_ti, inout timer p_t, inout port_1 p_p) {
+        p_t.start;
+        var integer a, v_c;
+        var integer b := 2, v_1d := 3;
+        var integer v_e;
+        var template TypeA vx_ta;
+        var Comp_1 Cc, bB, Aa;
+        timer t_a1, T_a2;
+        t_1.start;
+        for (var integer i := 0; i < 10; i := i + 1) {
+        }
+    }
+
+}
Index: trunk/t3q-examples/PrettyPrintingAndFormatting-Preliminary/formattingTester.ttcn3
===================================================================
--- trunk/t3q-examples/PrettyPrintingAndFormatting-Preliminary/formattingTester.ttcn3	(revision 4)
+++ trunk/t3q-examples/PrettyPrintingAndFormatting-Preliminary/formattingTester.ttcn3	(revision 4)
@@ -0,0 +1,201 @@
+module formattingTester {
+
+//module parameters
+modulepar boolean mp_boolean := true;
+modulepar { integer mp_int1, mp_int2 := 2; integer mp_int3 := 3;}
+
+
+//full function body with multiple parameters, including passing modes, runs on clause and return value
+function f_sample2 ( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) 
+runs on R3Comp 
+return FncRetCode {
+  var FncRetCode v_ret := e_success;
+
+  alt {
+    [] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd (
+                          e_RadiusAccountingRequest,
+                          m_radiusAccntReq_any ) ) {
+      return e_error;
+    }
+  } 
+  return v_ret;
+}   
+//function skeleton with a single parameter, including a passing mode, with a runs on clause
+function f_sample1 (in template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//function skeleton with a single parameter, with a runs on clause 
+function f_sample11 (template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//function skeleton without parameters, with a return value
+function f_sample () 
+	return r {
+}
+
+//full function body with multiple parameters, including passing modes, no further clauses
+function f_sample21( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) {
+
+  var integer v_var1 := 0;
+  var integer v_var2 := 10;
+  
+  while (v_var1 < v_var2){
+  	v_var1:=v_var1+1;
+  }
+  
+}
+
+
+//altstep skeleton without parameters
+altstep a_sample () 
+	runs on R3Comp {
+}
+
+//altstep with full body, multiple parameters, with passing modes and a runs on clause
+
+altstep a_sample2 ( template R3Msg p_radiusAccntReq, inout template R3Msg p_radiusAccntRsp ) 
+	runs on R3Comp {
+
+[] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+ }
+
+
+//altstep skeleton with a single parameter
+altstep a_sample1 (template R3Msg p_radiusAccntReq) {
+}
+
+//sample test case with full body, multiple parameters, with modifiers, runs on and system clauses
+testcase tc_sample2 ( 
+  template R3Msg p_radiusAccntReq, 
+  out template R3Msg p_radiusAccntRsp ) 
+runs on R3Comp 
+system R3System {
+  var FncRetCode v_ret := e_success;
+
+  alt {
+    [] r3Port.receive ( m_r3MonitorInd ( p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd ( 
+                          e_RadiusAccountingRequest,
+                          p_radiusAccntReq ) ) {
+      v_ret := e_success;
+    }
+    [] r3Port.receive ( m_r3MonitorInd (
+                          e_RadiusAccountingRequest,
+                          m_radiusAccntReq_any ) ) {
+    }
+    [] a_sample2 (m_r3MonitorInd,m_r3MonitorInd);
+    [] a_sample1 (m_r3MonitorInd);
+    [] a_sample0 ();
+  }
+
+}   
+//sample test case skeleton with a single parameter, including a passing mode, with a runs on clause
+testcase tc_sample1 (in template R3Msg p_radiusAccntReq) 
+	runs on R3Comp {
+}
+
+//test tcase skeleton with a single parameter, with a runs on clause and a system clause 
+testcase tc_sample11 (template R3Msg p_radiusAccntReq) 
+	runs on R3Comp system R3System {
+	f_sample();
+	f_sample1(p_radiusAccntReq);
+	f_sample2(p_radiusAccntReq,p_radiusAccntRsp) 
+}
+
+//test case skeleton without parameters, with a runs on clause
+testcase tc_sample () 
+	runs on R3Comp {
+}
+
+	//template with a single parameter
+	template type1 template1 (integer i) :={
+		int1 :=i,
+		int2 :=2
+	}
+
+	template type1 template11 (integer i) modifies template1 :={
+		int1 :=i,
+		int2 :=4 
+	}
+
+
+
+	//template with multiple parameters
+	template type1 template2 (integer i1, integer i2) :={
+		int1 :=i1,
+		int2 :=i2
+	}
+
+	
+	signature s_lookup () return charstring exception (e_NotFound);
+
+	signature s_accept () return charstring exception (e_NotFound);
+
+	
+	signature s_lookup1 (in charstring key) return charstring exception (e_NotFound);
+	
+	signature s_lookup2 (in charstring key, in charstring id) return charstring exception (e_NotFound);
+	
+	signature s_lookup3 (in charstring key, in charstring id, inout integer state) return charstring exception (e_NotFound);
+	
+	//not clear if legal, or useful...
+	//parser seems to fail
+	//it is legal
+	type record type2 (integer i1, integer i2) {
+		integer range (i1 .. i2)
+	}
+
+	type integer range2 (1 .. 10);
+
+	//this should also be legal although maybe not in the current version
+	//the above is an indirect version
+	//type integer intRange (integer min, integer max ) (min .. max);
+	const type2(1,10) c_range := 3;
+	
+	//type integer binary (0,1);
+	//type integer octary (0 .. 7);
+
+	//illegal 
+	//type record type3 (integer i1, integer i2) {
+	//	i1 binary,
+	//	i2 octary
+	//}
+	
+	testcase tc_sample_procedurebased() runs on sampleComponent system systemComponent{
+		port1.call(s_lookup:{x}) {
+			[]port1.getreply(s_accept:{y}) {
+			
+			}
+		}
+	}
+	
+	control{
+		execute(tc_sample1(template_sample1));
+		execute(tc_sample2(template_sample1,template_sample2));
+		execute(tc_sample());
+	}
+	
+}
Index: trunk/t3q-examples/checkExternalFunctionInvocationPrecededByLogStatement/checkExternalFunctionInvocationPrecededByLogStatement.ttcn3
===================================================================
--- trunk/t3q-examples/checkExternalFunctionInvocationPrecededByLogStatement/checkExternalFunctionInvocationPrecededByLogStatement.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkExternalFunctionInvocationPrecededByLogStatement/checkExternalFunctionInvocationPrecededByLogStatement.ttcn3	(revision 4)
@@ -0,0 +1,61 @@
+module checkExternalFunctionInvocationFollowedByLogStatement {
+	external function fx_example1();
+	external function fx_example2(integer p_int) return integer;
+	external function fx_example2(charstring p_cs) return charstring;
+	
+	//inconclusive - in a constant definition
+	const integer c := fx_example1(1);
+
+	//inconclusive - unresolved 
+	function f_example1() {
+		fx_example0();
+	}
+	
+	//bad - at the end of a scope 
+	function f_example1() {
+		fx_example1();
+	}
+
+	//bad - followed
+	function f_example2() {
+		fx_example1();
+		log("External Function fx_example1 called!")
+	}
+
+	//bad - at the end of a scope without SemiColon
+	function f_example3() {
+		fx_example1()
+	}
+
+	//bad - at the end of a scope without SemiColon, followed
+	function f_example4() {
+		fx_example1()
+		log("External Function fx_example1 called!")
+	}
+
+	//multiple
+	testcase tc1() runs on mtcType system systemType {
+		//bad
+		fx_example1();
+		log("External Function fx_example1 called!")
+		f_example1();
+
+		//good
+		log("External Function fx_example1 called!")
+		fx_example1();
+
+		f_example2() 
+		
+		//bad	
+		fx_example1()
+
+		//bad
+		fx_example1();
+		log("External Function fx_example1 called!")
+	}
+	
+	control {
+		execute(tc1());
+	}
+
+}
Index: trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,33 @@
+module checkFunctionsModuleContainmentBad {
+    import from LibCommon_time all;
+
+    // good part, only functions and altsteps
+
+    function f_1 () {
+    }
+
+    altstep a_1 () {
+    }
+
+    //bad part
+
+    type record typeA {
+        integer field1,
+        boolean feild2
+    }
+
+    group GroupedDefs {
+        function f_2 () {
+        }
+        altstep a_2 () {
+        }
+        const integer c_1 := 1;
+    }
+
+    //configurable part
+    //depending on the configuration external functions 
+    //may (default) or may not be allowed 
+
+    external function ef_1 ();
+
+}
Index: trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkFunctionsModuleContainmentCheck/checkFunctionsModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,24 @@
+module checkFunctionsModuleContainmentGood {
+    import from LibCommon_time all;
+
+    // good module, only functions and altsteps
+
+    function f_1 () {
+    }
+
+    altstep a_1 () {
+    }
+
+    group GroupedDefs {
+        function f_2 () {
+        }
+        altstep a_2 () {
+        }
+    }
+
+    //depending on the configuration external functions 
+    //may (default) or may not be allowed 
+
+    external function ef_1 ();
+
+}
Index: trunk/t3q-examples/checkImportsComeFirst/checkImportsComeFirstBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkImportsComeFirst/checkImportsComeFirstBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkImportsComeFirst/checkImportsComeFirstBad.ttcn3	(revision 4)
@@ -0,0 +1,13 @@
+module checkImportsComeFirst {
+	import from LibCommon_time all;
+    
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+    //more imports after other definitions
+
+	import from LibCommon_clock all;
+
+}
Index: trunk/t3q-examples/checkImportsComeFirst/checkImportsComeFirstGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkImportsComeFirst/checkImportsComeFirstGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkImportsComeFirst/checkImportsComeFirstGood.ttcn3	(revision 4)
@@ -0,0 +1,11 @@
+module checkImportsComeFirst {
+	import from LibCommon_time all;
+	import from LibCommon_clock all;
+    
+    //imports come first
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+}
Index: trunk/t3q-examples/checkInconcOrFailSetVerdictPrecededByLog/checkInconcOrFailSetVerdictPrecededByLog.ttcn3
===================================================================
--- trunk/t3q-examples/checkInconcOrFailSetVerdictPrecededByLog/checkInconcOrFailSetVerdictPrecededByLog.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkInconcOrFailSetVerdictPrecededByLog/checkInconcOrFailSetVerdictPrecededByLog.ttcn3	(revision 4)
@@ -0,0 +1,37 @@
+module checkInconcOrFailSetverdictPrecededByLog {
+    
+    testcase t_sendMsg() runs on myComponent {
+        p1.send(msg_a);
+        
+        // this is as expected
+        alt {
+            [] p2.receive(msg_b) {
+            	someOtherfunction();
+                log("*** t_sendMsg: INFO: Wrong message has been received ***") 
+                setverdict(fail);
+				someOtherfunction();
+            }
+            [] p2.receive(msg_c) {
+                setverdict(pass);
+            }
+            [] p2.receive {
+                log("*** t_sendMsg: INFO: Unexpected message, possibly malicious ***"); 
+                setverdict(inconc);
+            }
+        }        
+        // here, the log statements are missing        
+        alt {
+            [] p2.receive(msg_b) {
+                setverdict(fail);
+            }
+            [] p2.receive(msg_c) {
+                setverdict(pass);
+            }
+            [] p2.receive {
+                setverdict(inconc);
+            }
+        }        
+        
+    }
+
+}
Index: trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,29 @@
+module checkInterfaceModuleContainmentBad {
+    import from LibCommon_time all;
+
+    // bad module
+
+	type component component_1 {
+	}
+
+	type port port_1 message{
+		in integer
+	}
+	const integer c_1 := 0;
+
+	group g_1{
+		type component component_2 {
+		}
+		type port port_2 message{
+			out integer
+		}
+
+		const integer c_2 := 1;
+	}
+
+	//are control parts permissible?
+	control {
+	
+	}
+	    
+}
Index: trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkInterfaceModuleContainmentCheck/checkInterfaceModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,22 @@
+module checkInterfaceModuleContainmentGood {
+    import from LibCommon_time all;
+
+    // good module, only component definitions
+
+	type component component_1 {
+	}
+
+	group g_1{
+		type component component_2 {
+		}
+		type port port_1 message{
+			in integer
+		}
+	}
+
+	//are control parts permissible?
+	control {
+	
+	}
+	    
+}
Index: trunk/t3q-examples/checkLocalDefinitionsComeFirst/checkLocalDefinitionsComeFirst.ttcn3
===================================================================
--- trunk/t3q-examples/checkLocalDefinitionsComeFirst/checkLocalDefinitionsComeFirst.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkLocalDefinitionsComeFirst/checkLocalDefinitionsComeFirst.ttcn3	(revision 4)
@@ -0,0 +1,109 @@
+module checkLocalDefinitionsComeFirst {
+	//the good ones
+	function f_sample0() {
+		var integer a;
+		var charstring b;
+		as_sample0();
+		if (b) {
+			
+		}
+	}
+
+	altstep as_sample2() {
+		var integer a;
+		var charstring b;
+		[]t.timeout{
+		
+		}
+		
+	
+	}
+	
+	testcase tc_sample0() runs on sampleComponent {
+		var integer a;
+		var charstring b;
+		f_sample1();
+		if (a){
+		
+		} else {
+			alt{
+				[]t.timeout{
+				}
+				[]as_sample2()
+			}		
+		}
+		
+	}
+
+	//the bad ones
+	function f_sample1() {
+
+		var integer a;
+		timer t1;
+		var charstring b;
+		as_sample0();
+		if (b) {
+			var charstring c;
+		}
+	}
+
+	altstep as_sample1() {
+
+		timer t1;
+		const integer x:=1;
+		var integer a;
+		var charstring b;
+		[]t.timeout{
+		
+		}
+		
+	
+	}
+
+
+	altstep as_sample0() runs on sampleComponent{
+		var integer a;
+		var charstring b;
+		[]t.timeout{
+			timer xt;
+			var charstring c;
+		}
+		
+	
+	}
+	
+	testcase tc_sample1() runs on sampleComponent {
+		var integer a;
+		var charstring b;
+		f_sample0();
+		if (a){
+			var charstring d;
+		
+		} else {
+			alt{
+				[]t.timeout{
+					timer xx;
+					var charstring e;
+				}
+				[]as_sample1()
+			}		
+		}
+		
+	}
+	
+	type component sampleComponent {
+
+		var integer x;
+		const integer cx:=4;
+		port portType instance;
+		timer tx;
+	
+	}
+
+	 control {
+	 	var integer controlVar;
+	 	const integer cx:=4;
+		for (var integer x:=1; x< 5; x:=x+1){
+		}
+	 }
+}
Index: trunk/t3q-examples/checkLocalDefinitionsComeFirst/tmp.ttcn3
===================================================================
--- trunk/t3q-examples/checkLocalDefinitionsComeFirst/tmp.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkLocalDefinitionsComeFirst/tmp.ttcn3	(revision 4)
@@ -0,0 +1,36 @@
+module tmp {
+
+	
+	altstep as_sample0() runs on sampleComponent{
+		var integer a;
+		var charstring b;
+		[]t.timeout{
+			timer xt;
+//			var charstring c;
+			const integer bx := 2;
+		}
+	}
+
+	function xx () {
+		timer t;
+		alt { 
+		[]t.timeout {
+			timer xt;
+			var charstring c;
+		
+		}
+		}
+	}
+	
+	testcase tx_00 () runs on sampleComponent {
+		var charstring xxx ;
+		timer xt
+	}
+
+	type component sampleComponent {
+		var integer x;
+		const integer cx:=4;
+		timer tx;
+	}
+
+}
Index: trunk/t3q-examples/checkLogFormat/checkLogFormat.ttcn3
===================================================================
--- trunk/t3q-examples/checkLogFormat/checkLogFormat.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkLogFormat/checkLogFormat.ttcn3	(revision 4)
@@ -0,0 +1,55 @@
+module checkLogFormatModule {
+
+    function f_1 ()
+    runs on myComponent {
+
+        //incorrect
+        log ( "***" )
+    }
+
+
+    const integer c_1 := 1;
+
+    testcase t_sendMsg ()
+    runs on myComponent {
+
+        // correct
+        log ( "*** t_sendMsg: INFO: Wrong message has been received ***" )
+        f_1 (); //if this statement were absent 
+                //and subsequent log processing enabled
+                //the above log sattement will be analyzed
+                //together with the following split log statements
+
+        // also correct, given subsequent log processing is enabled 
+        log ( "*** t_sendMsg: " );
+        log ( "INFO: " );
+        log ( "Wrong message has been received ***" );
+        f_1 ();
+
+        //correct , given subsequent log processing is enabled
+        log ( "*** t_sendMsg: " );
+        log ( "INFO: " );
+        log ( f_2 () );
+        log ( "Wrong message has been received ***" );
+        f_1 ();
+
+        // some simple malformed log statements
+        //will be combined as one if subsequent log processing is enabled
+        log ( "*** : INFORMATION: Wrong message has been received ***" )
+        log ( "** t_sendMsg: INFO: Wrong message has been received **" )
+        log ( "*** t_sendMsg22: INFO: Wrong message has been received ***" )
+        log ( "*** t_sendMsg: INFORMATION: Wrong message has been received ***" )
+
+        //correct under different configuration / not combined with the above
+        log ( "*** INFO: Wrong message has been received ***" );
+    }
+
+    control {
+
+        //incorrect
+        log ( ".." );
+
+        //correct, if not combined with the above
+        log ( "*** t_sendMsg22: INFO: Wrong message has been received ***" )
+    }
+}
Index: trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,19 @@
+module checkModuleParamsModuleContainmentBad {
+    import from LibCommon_time all;
+
+    // good part, only module parameters
+	modulepar integer mp_1;
+	
+	modulepar {
+		integer mp_2;
+		charstring mp_3;
+	}
+    
+    //bad part
+    const integer c_1 := 1;
+    
+    group GroupedDefs{
+		modulepar integer mp_4;
+		const integer c_2 := 2;
+    }
+}
Index: trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkModuleParamsModuleContainmentCheck/checkModuleParamsModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,16 @@
+module checkModuleParamsModuleContainmentGood {
+    import from LibCommon_time all;
+
+    // good module, only module parameters
+	modulepar integer mp_1;
+	
+	modulepar {
+		integer mp_2;
+		charstring mp_3;
+	}
+    
+    group GroupedDefs{
+		modulepar integer mp_4;
+
+    }
+}
Index: trunk/t3q-examples/checkNoAllKeywordInPortDefinitions/checkNoAllKeywordInPortDefinitions.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoAllKeywordInPortDefinitions/checkNoAllKeywordInPortDefinitions.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoAllKeywordInPortDefinitions/checkNoAllKeywordInPortDefinitions.ttcn3	(revision 4)
@@ -0,0 +1,28 @@
+module checkNoAllKeywordInPortDefinitions {
+
+	type port samplePortType_m0 message {
+		in charstring
+		out integer
+	}
+
+
+	type port samplePortType_m1 message {
+		inout all
+		in charstring
+		out integer
+	}
+
+	type port samplePortType_p0 procedure {
+		in a
+		out b
+	}
+
+
+	type port samplePortType_p1 procedure {
+		inout a
+		in all
+		out all
+
+	}
+
+}
Index: trunk/t3q-examples/checkNoAnyTypeKeyword/checkNoAnyTypeKeyword.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoAnyTypeKeyword/checkNoAnyTypeKeyword.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoAnyTypeKeyword/checkNoAnyTypeKeyword.ttcn3	(revision 4)
@@ -0,0 +1,9 @@
+module checkNoAnyTypeKeyword {
+    type integer A;
+    
+    const anytype c_1 := { A := 1};
+    
+    function f_example1(in anytype p1){
+
+    }
+}
Index: trunk/t3q-examples/checkNoInlineTemplates/checkNoInlineTemplates.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoInlineTemplates/checkNoInlineTemplates.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoInlineTemplates/checkNoInlineTemplates.ttcn3	(revision 4)
@@ -0,0 +1,14 @@
+module checkNoInlineTemplates {
+    testcase tc_00 ()
+    runs on someComponent {
+
+        //...
+        somePort.send ( someDataType:{
+            field1 := 1, 
+            field2 := true
+        } );
+
+    //...
+    }
+
+}
Index: trunk/t3q-examples/checkNoLabelsOrGotoStatements/checkNoLabelsOrGotoStatements.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoLabelsOrGotoStatements/checkNoLabelsOrGotoStatements.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoLabelsOrGotoStatements/checkNoLabelsOrGotoStatements.ttcn3	(revision 4)
@@ -0,0 +1,19 @@
+module checkNoLabelsOrGotoStatements {
+	testcase tc1() runs on mtcType system systemType {
+		label TC_START;
+		
+		alt{
+			[] p1.receive {
+				label P1_RECEIVE;
+				p1.send(integer:1);
+				goto TC_END;
+			}
+			[] p2.receive {
+				p1.send(integer:2);
+				goto TC_START;
+			}
+		}
+		
+		label TC_END;
+	}
+}
Index: trunk/t3q-examples/checkNoLiterals/checkNoLiterals.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoLiterals/checkNoLiterals.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoLiterals/checkNoLiterals.ttcn3	(revision 4)
@@ -0,0 +1,19 @@
+module checkNoLiterals {
+	modulepar {
+		integer mpa := 42;
+	}
+
+	const integer c_0 := 33;
+
+	template integer someRange := (1..10);
+
+	function f_0(){
+		var integer a := 1;
+		var charstring b := "a";
+		var typeA varA := x;
+		var template typeA varTempA := ?
+		timer t := 4;
+		const integer c := 2;
+		var template integer someRange := (1..10);
+	}
+}
Index: trunk/t3q-examples/checkNoModifiedTemplateOfModifiedTemplate/checkNoModifiedTemplateOfModifiedTemplate.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoModifiedTemplateOfModifiedTemplate/checkNoModifiedTemplateOfModifiedTemplate.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoModifiedTemplateOfModifiedTemplate/checkNoModifiedTemplateOfModifiedTemplate.ttcn3	(revision 4)
@@ -0,0 +1,58 @@
+module checkNoModifiedTemplateOfModifiedTemplate {
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    template MyRecordType MyTemplate1 := {
+        field1 := 123, 
+        field2 := "A string", 
+        field3 := true
+    }
+
+    template MyRecordType MyTemplate2 modifies MyTemplate1 := {
+        field1 := omit,  
+        field2 := "A modified string"
+    }
+
+    // MyTemplate2 is already a modified template
+    template MyRecordType MyTemplate3 modifies MyTemplate2 := {
+        field1 := 22 
+    }
+
+    // this one is even modified two times
+    template MyRecordType MyTemplate4 modifies MyTemplate3 := {
+        field3 := false
+    }
+
+	// NESTED TEMPLATES
+	type record MyRecordType2 {
+        integer field1 optional,
+        charstring field2,
+        boolean field3,
+        MyRecordType nestedTemplate
+    }
+
+    template MyRecordType MyNestedTemplate1 := {
+        field1 := 123, 
+        field2 := "A string", 
+        field3 := true,
+        nestedTemplate :={field1:= 1, field2:="a", field3:=true}
+    }
+
+
+
+    template MyRecordType MyNestedTemplate2 modifies MyNestedTemplate1 := {
+        field2 := "B string", 
+        nestedTemplate :={field1:= 2, field2:="b", field3:=true}
+    }
+
+    template MyRecordType MyNestedTemplate3 modifies MyNestedTemplate2 := {
+        field2 := "C string", 
+        nestedTemplate :={field1:= 3, field2:="c", field3:=true}
+    }
+	
+
+
+}
Index: trunk/t3q-examples/checkNoModifiedTemplateOfModifiedTemplate/checkNoModifiedTemplateOfModifiedTemplateExternal.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoModifiedTemplateOfModifiedTemplate/checkNoModifiedTemplateOfModifiedTemplateExternal.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoModifiedTemplateOfModifiedTemplate/checkNoModifiedTemplateOfModifiedTemplateExternal.ttcn3	(revision 4)
@@ -0,0 +1,27 @@
+module checkNoModifiedTemplateOfModifiedTemplateExternal {
+    import from checkNoModifiedTemplateOfModifiedTemplate all;
+    
+    template MyRecordType MyTemplate5 modifies MyTemplate1 := {
+        field1 := omit,  
+        field2 := "A modified string"
+    }
+
+    // MyTemplate2 is already a modified template
+    template MyRecordType MyTemplate6 modifies MyTemplate2 := {
+        field1 := 22
+    }
+
+    // this one is even modified two times
+    template MyRecordType MyTemplate7 modifies MyTemplate6 := {
+        field3 := false
+    }
+
+
+	//nested
+	template MyRecordType MyNestedTemplate4 modifies MyNestedTemplate2 := {
+        field2 := "D string", 
+        nestedTemplate :={field1:= 4, field2:="d", field3:=true}
+    }
+	
+
+}
Index: trunk/t3q-examples/checkNoNestedAltStatements/checkNoNestedAltStatements.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoNestedAltStatements/checkNoNestedAltStatements.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoNestedAltStatements/checkNoNestedAltStatements.ttcn3	(revision 4)
@@ -0,0 +1,97 @@
+module checNoNestedAltStatements {
+    altstep as_0 ()
+    runs on myComponent {
+
+        //nesting within an altstep
+        [] p2.receive ( msg_b ) {
+        }
+        [] p2.receive ( msg_c ) {
+            setverdict ( pass );
+
+            // nested alt, level 1
+            alt {
+                [] p2.receive ( msg_b ) {
+                }
+                [] p2.receive ( msg_c ) {
+                    setverdict ( pass );
+                }
+                [] p2.receive {
+                }
+            }
+        }
+        [] p2.receive {
+
+            // nested alt, level 1
+            alt {
+                [] p2.receive ( msg_b ) {
+                }
+                [] p2.receive ( msg_c ) {
+                    setverdict ( pass );
+                }
+                [] p2.receive {
+
+                    // nested alt, level 2
+                    alt {
+                        [] p2.receive ( msg_b ) {
+                        }
+                        [] p2.receive ( msg_c ) {
+                            setverdict ( pass );
+                        }
+                        [] p2.receive {
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    testcase t_sendMsg ()
+    runs on myComponent {
+
+        //nesting within alt statement
+        p1.send ( msg_a );
+        alt {
+            [] p2.receive ( msg_b ) {
+            }
+            [] p2.receive ( msg_c ) {
+                setverdict ( pass );
+
+                // nested alt, level 1
+                alt {
+                    [] p2.receive ( msg_b ) {
+                    }
+                    [] p2.receive ( msg_c ) {
+                        setverdict ( pass );
+                    }
+                    [] p2.receive {
+                    }
+                }
+            }
+            [] p2.receive {
+
+                // nested alt, level 1
+                alt {
+                    [] p2.receive ( msg_b ) {
+                    }
+                    [] p2.receive ( msg_c ) {
+                        setverdict ( pass );
+                    }
+                    [] p2.receive {
+
+                        // nested alt level 2
+                        alt {
+                            [] p2.receive ( msg_b ) {
+                            }
+                            [] p2.receive ( msg_c ) {
+                                setverdict ( pass );
+                            }
+                            [] p2.receive {
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+}
Index: trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOn.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOn.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOn.ttcn3	(revision 4)
@@ -0,0 +1,98 @@
+module checkNoOverSpecificRunsOn {
+    
+    //global const for validation
+    const someType someGlobalConst := 21;
+
+	//component in question
+    type component someComponent {
+        var someType someVarName := 2;
+        var someType someOtherVarName := 2, someAnotherVarName := 4;
+        var charstring someCharStringVar := "xyz";
+        var template someType someTemplateVarName := 3;
+        const someType someConstName := 1;
+        const integer someIntegerConstName := 42;
+        const someOtherType someConstName2 := someModuleParameterName2, someConstName3 := someModuleParameterName3;
+        timer someTimer;
+        port somePortType somePortInstance;
+    }
+
+	type component someComponent2 extends someComponent{
+        port somePortType somePortInstance2;
+		
+	}
+
+	//good
+    function someFunction ()
+    runs on someComponent {
+        //some references to component definitions here
+        someTimer.start ( 10.0 );
+    }
+
+	//bad
+    function someOverSpecificFunction ()
+    runs on someComponent {
+		//ay(); //this will make it valid
+		//wrapperfunction(); //this will make it valid
+		wrapperFunction(); //unresolvable due to a typo - proper error message provided 
+    //no references to component definitions here 
+    }
+
+	//irrelevant
+    function someGenericFunction () runs on someComponent{
+		somePortInstance.send("x");
+    //no relation
+    }
+
+
+
+    //good 
+    //a tricky example with a referenced function that uses the relevant fields
+    //wraper function
+    function wrapperfunction ()
+    runs on someComponent {
+
+        //function that uses the component definitions
+        someFunction ();
+    }
+
+	//bad
+    testcase tcx ()
+    runs on someComponent {
+		//ay(); //this will make it valid
+    }
+
+	//good
+	//tricky wrapper example
+    altstep ax ()
+    runs on someComponent {
+    	var integer a := someFunction();
+        [] ay ()
+        [] ay ()
+    }
+
+	//good
+    altstep ay ()
+    runs on someComponent {
+    	var integer a := someFunction();	
+
+        [] someTimer.timeout {
+			wrapperfunction();
+        }
+    }
+
+	//tricky cyclic call sequences
+	function f1() runs on someComponent{
+		f2();
+		f3()
+	}
+	function f2() runs on someComponent{
+		f1()
+		f4()
+	}
+	function f3() runs on someComponent{
+		f2()
+	}
+	function f4() runs on someComponent{
+	
+	}
+}
Index: trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOnOverImport.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOnOverImport.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOnOverImport.ttcn3	(revision 4)
@@ -0,0 +1,49 @@
+module checkNoOverSpecificRunsOnOverImport {
+	
+	import from checkNoOverSpecificRunsOn { type someComponent}
+	
+	const someType someGlobalConst := 21;
+	
+	type component someComponent2 {
+		var someType someVarName := 2;
+		var someType someOtherVarName := 2, someAnotherVarName := 4;
+		var charstring someCharStringVar := "xyz";
+		var template someType someTemplateVarName := 3;
+		const someType someConstName := 1;
+		const integer someIntegerConstName := 42;
+		const someOtherType someConstName2 := someModuleParameterName2, someConstName3 := someModuleParameterName3;
+		timer someTimer;
+		port somePortType somePortInstance;
+	}
+	
+	function someFunction1() runs on someComponent {
+		//some references to component definitions here
+		someTimer.start(10.0);
+//		alt{
+//		[]somePortInstance.receive(integer:2)
+//		{
+//				somePortInstance.send(integer:3);
+//		}
+//		}
+	}
+
+	function someFunction2() runs on someComponent2 {
+		//some references to component definitions here
+		someTimer.start(10.0);
+	}
+
+	
+	function someOverSpecificFunction() runs on someComponent {
+		//no references to component definitions here 
+	}
+
+	function someOverSpecificFunction2() runs on someComponent2 {
+		//no references to component definitions here 
+	}
+
+	
+	function someGenericFunction2(){
+		//no relation
+	
+	}
+}
Index: trunk/t3q-examples/checkNoPermutationKeyword/checkNoPermutationKeyword.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoPermutationKeyword/checkNoPermutationKeyword.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoPermutationKeyword/checkNoPermutationKeyword.ttcn3	(revision 4)
@@ -0,0 +1,8 @@
+module checkNoPermutationKeywordModule {
+    type record of integer MySequenceOfType;
+
+    // matches any of the following sequences of 4 integers: 1,2,3,5; 1,3,2,5; 2,1,3,5; 
+    // 2,3,1,5; 3,1,2,5; or 3,2,1,5 
+    template MySequenceOfType MyTemplate1 := {permutation(1, 2, 3), 5};
+
+}
Index: trunk/t3q-examples/checkNoUnusedFormalParameters/checkNoUnusedFormalParameters.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedFormalParameters/checkNoUnusedFormalParameters.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedFormalParameters/checkNoUnusedFormalParameters.ttcn3	(revision 4)
@@ -0,0 +1,85 @@
+module checkNoUnusedFormalParameters {
+    
+    function f_0 ( 
+        in someType someParName, //bad 
+        out template someOtherType someOtherParName, //bad 
+        out someOtherType someYetAnotherParName, //bad
+        inout timer timerParName, //bad
+        inout portType portParName //bad
+    ) {
+    }
+
+	type record t_t { //neutral
+		integer f1
+	}
+
+	template t_t t_templ  :={ //neutral
+		f1 := 0
+	}
+
+	template t_t t_templ2 (integer x1)  :={ //good
+		f1 := x1 
+	}
+
+	template t_t t_templ3 (integer x1)  :={ //bad
+		f1 := 2 
+	}
+	
+	template t_t t_templ4 (integer x1)  :={ //bad
+		f1 := 2 
+	}
+
+	template t_t t_templ5 (template templateType t1)  :={ //good
+		f1 := t1
+	}
+
+	template t_t t_templ6 (integer x1, integer y2) modifies t_templ2 :={ //good
+		f2 := y2
+	}
+
+	template t_t t_templ7 (integer x1, integer y2) modifies t_templ2 :={ //bad
+		f2 := 2 
+	}
+
+	template t_t t_templ8 (template templateType t1, template templateType t2) modifies t_templ5 :={ //good
+		f2 := t2
+		 
+	}
+
+
+
+    function f_1 ( inout timer p_t ) { //good
+    	p_t.start(10)
+    }
+
+    function f_2 ( inout portType p_p ) { //good
+    	p_p.send(integer:0); 
+    	p_p.send(t_t:{0});
+    }
+
+    function f_3 ( inout omit templateType p_t ) { //good
+    	p_p.send(p_t);
+    }
+
+    function f_4 ( inout template templateType p_t ) { //good
+    	var integer x := 1;
+    	p_p.send(integer:x);
+    	p_p.send(p_t);
+    	p_p.send(t_templ);
+    	p_p.send(t_t:{0});
+    	p_p.send(0);
+    	p_p.send("x");
+
+    }
+
+    function f_5 ( inout template ( value ) templateType p_t ) { //bad
+    }
+
+	external function fx_1 (charstring y1, integer x2); //neutral
+
+    function f(charstring b, integer a){ //bad 2x
+//    	var integer c := a;
+    }
+
+
+}
Index: trunk/t3q-examples/checkNoUnusedFormalParameters/tmp.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedFormalParameters/tmp.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedFormalParameters/tmp.ttcn3	(revision 4)
@@ -0,0 +1,9 @@
+module tmp {
+	template t_t t_templ2 (integer xxx)  :={
+		f1 := xxx,
+		f2 := xxx
+	}
+	function f_x(integer yyy){
+		f_x(yyy);
+	}
+}
Index: trunk/t3q-examples/checkNoUnusedImports/checkNoUnusedImportsBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedImports/checkNoUnusedImportsBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedImports/checkNoUnusedImportsBad.ttcn3	(revision 4)
@@ -0,0 +1,34 @@
+module checkNoUnusedImportsBad {
+	import from importAll all except {type comp_A, comp_Aa; altstep a_Aa};
+
+	import from exactImports {function f_B, f_C; type comp_B};
+	import from exactImports {function f_D; type comp_C};
+	import from exactImports {const c_Bx};
+	//import from importAll {const c_B};
+	//import from exactImports {group ports except {type p_A}};
+	//import from exactImports {group all except ports};
+	import from exactImports {group ports.a.b};
+	//import from exactImports {group b};
+	//import from exactImports {group all};
+	//import from exactImports {type p_A};
+	import from exactImports {altstep all except a_A, a_C};
+	import from exactImports {testcase all; function all};
+	
+	
+	type component comp_D {
+		port p_Ax port_A;
+		//var integer x := exactImports.c_B;
+	}
+	
+	
+
+	function f_E() runs on comp_B{
+		f_A();
+		a_D();
+	}
+	
+	function f_F() {
+	
+	}
+
+}
Index: trunk/t3q-examples/checkNoUnusedImports/checkNoUnusedImportsGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedImports/checkNoUnusedImportsGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedImports/checkNoUnusedImportsGood.ttcn3	(revision 4)
@@ -0,0 +1,3 @@
+module checkNoUnusedImportsGood {
+	
+}
Index: trunk/t3q-examples/checkNoUnusedImports/exactImports.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedImports/exactImports.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedImports/exactImports.ttcn3	(revision 4)
@@ -0,0 +1,57 @@
+module exactImports {
+	type component comp_B {
+	
+	}
+
+	type component comp_C {
+	
+	}
+	
+	function f_B () runs on comp_B {
+	
+	}
+	function f_C () runs on comp_B {
+	
+	}
+	function f_D() {
+	
+	}
+	
+	const integer c_Bc := 42;
+	
+	altstep a_B(){
+	}
+	altstep a_C(){
+	}
+
+	altstep a_D(){
+	}
+	
+	
+	group ports{
+		group a{
+			group b{
+				type port p_Ax message{
+					inout all
+				}
+					
+			}
+		}
+		type port p_A message{
+			inout all
+		}
+	
+		type port p_B message{
+			inout all
+		}
+	}
+	
+	testcase tc_B () runs on comp_B {
+	
+	}
+	testcase tc_C () runs on comp_B {
+	
+	}
+	
+
+}
Index: trunk/t3q-examples/checkNoUnusedImports/importAll.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedImports/importAll.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedImports/importAll.ttcn3	(revision 4)
@@ -0,0 +1,20 @@
+module importAll {
+	
+	const integer c_B := 43;
+	
+	type component comp_A {
+	
+	}
+
+	type component comp_Aa {
+	
+	}
+
+	group x{
+	function f_A () runs on comp_A {
+	
+	}
+	}
+	altstep a_A () {
+	}
+}
Index: trunk/t3q-examples/checkNoUnusedLocalDefinitions/checkNoUnusedLocalDefinitions.ttcn3
===================================================================
--- trunk/t3q-examples/checkNoUnusedLocalDefinitions/checkNoUnusedLocalDefinitions.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkNoUnusedLocalDefinitions/checkNoUnusedLocalDefinitions.ttcn3	(revision 4)
@@ -0,0 +1,49 @@
+module checkNoUnusedLocalDefinitions {
+	
+	type component someComponent{
+		timer componentTimer1, componentTimer2;
+		port portType p1,p2;
+	}
+	
+	function f_0(){
+		timer localTimer;
+		var integer v1;
+		const integer c1:=1;
+		var template t1 template1;
+		var someComponent comp1;
+		template (present) t1 template2 :={f1:=1};
+	}
+	
+	altstep as_0(){
+		timer localTimer;
+		var integer v1, v2;
+		const integer c1:=1;
+		var template t1 template1;
+		var someComponent comp1;
+		[] p.receive(template1) -> value v1 
+		{
+			v2 := v1.x;
+		}
+
+	}
+	
+	testcase tc_0() runs on someComponent{
+		timer localTimer;
+		var integer v1;
+		const integer c1:=1;
+		var template t1 template1;
+		var someComponent comp1;
+		componentTimer1.start; //good
+	}
+	control {
+		timer localTimer;
+		var integer v1,v2;
+		const integer c1:=1;
+		var template t1 template1;
+		var someComponent comp1;
+	
+	}
+	
+	
+	
+}
Index: trunk/t3q-examples/checkPortMessageGrouping/checkPortMessageGrouping.ttcn3
===================================================================
--- trunk/t3q-examples/checkPortMessageGrouping/checkPortMessageGrouping.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkPortMessageGrouping/checkPortMessageGrouping.ttcn3	(revision 4)
@@ -0,0 +1,89 @@
+module checkPortMessageGrouping {
+    import from checkPortMessageGroupingExternal all;
+    //correct examples
+
+    group correct {
+        type port port1 message {
+            in m1;
+            out m2, m3;
+        }
+        type port port2 message {
+            inout m1, m3;
+        }
+        type port port3 message {
+            inout m4, m3;
+            out m1, m2;
+            in integer, charstring;
+            out integer;
+        }
+        type port port4 procedure {
+            in sm1, sm2;
+            out sm3, sm4;
+            inout sm5, sm6;
+        }
+        type port port5 mixed {
+            in sm1, m1;
+            out integer;
+        }
+        group nested {
+            group signatures {
+                signature sm1();
+                signature sm2();
+                signature sm3();
+                signature sm4();
+                signature sm5();
+                signature sm6();
+            } 
+
+        } 
+
+        type integer m1;
+
+        type record m2 {
+
+        }
+
+        type set m3 {
+
+        }
+
+        type record m4 {
+
+        }
+
+    }
+    //incorrect examples 
+
+    group incorrect {
+        type port port6 message {
+            in m1, m2;
+            out m3;
+        }
+        type port port7 message {
+            inout checkPortMessageGroupingExternal.m5;
+            out m6;
+        }
+        type port port8 procedure {
+            inout sm1, sm2;
+            out sm3;
+        }
+    } 
+
+    type record m6 {
+
+    }
+
+    type port port9 message {
+        inout m6, m7;
+    }
+
+    group g1 {
+        type set m7 {
+
+        }
+        type record m8 {
+
+        }
+    } 
+
+}
Index: trunk/t3q-examples/checkPortMessageGrouping/checkPortMessageGroupingExternal.ttcn3
===================================================================
--- trunk/t3q-examples/checkPortMessageGrouping/checkPortMessageGroupingExternal.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkPortMessageGrouping/checkPortMessageGroupingExternal.ttcn3	(revision 4)
@@ -0,0 +1,6 @@
+module checkPortMessageGroupingExternal {
+	group incorrect{
+		type integer m5;
+	}
+	
+}
Index: trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,25 @@
+module checkTemplatesModuleContainmentBad {
+    import from LibCommon_time all;
+
+    // good part, only templates
+    template MyRecordType t_1 := {
+        field1 := 1,
+        field2 := "a",
+        field3 :=true
+    }
+
+    template integer t_2 := (0,1,2,3,4,5,6,7);
+    
+    
+    group GroupedDefs{
+	    template integer t_3 :=(0 .. 10);
+		//bad part
+		const integer c_1 := 2;
+	
+    }
+
+	//bad part
+	function f_2(){
+	}
+
+}
Index: trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTemplatesModuleContainmentCheck/checkTemplatesModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,18 @@
+module checkTemplatesModuleContainmentGood {
+    import from LibCommon_time all;
+
+    // good module, only templates
+    template MyRecordType t_1 := {
+        field1 := 1,
+        field2 := "a",
+        field3 :=true
+    }
+
+    template integer t_2 := (0,1,2,3,4,5,6,7);
+    
+    
+    group GroupedDefs{
+	    template integer t_3 :=(0 .. 10);
+
+    }
+}
Index: trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,25 @@
+module checkTestControlModuleContainmentBad {
+    import from LibCommon_time all;
+
+    //bad part
+
+	modulepar integer mp_1;
+	
+	modulepar {
+		integer mp_2;
+		charstring mp_3;
+	}
+    
+    
+    const integer c_1 := 1;
+    
+    group GroupedDefs{
+		modulepar integer mp_4;
+		const integer c_2 := 2;
+    }
+
+	control {
+	
+	}
+
+}
Index: trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestControlModuleContainmentCheck/checkTestControlModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,14 @@
+module checkTestControlModuleContainmentGood {
+    import from LibCommon_time all;
+
+    // good module, only control part
+
+	group g_1{
+	
+	}
+
+	control {
+	
+	}
+	    
+}
Index: trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,28 @@
+module checkTestSystemModuleContainmentBad {
+    import from LibCommon_time all;
+
+    // bad module, port definitions as well
+
+	type component component_1 {
+	}
+
+	type port port_1 message{
+		in integer
+	}
+
+	group g_1{
+		type component component_2 {
+		}
+		type port port_2 message{
+			out integer
+		}
+
+	
+	}
+
+	//are control parts permissible?
+	control {
+	
+	}
+	    
+}
Index: trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestSystemModuleContainmentCheck/checkTestSystemModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,20 @@
+module checkTestSystemModuleContainmentGood {
+    import from LibCommon_time all;
+
+    // good module, only component definitions
+
+	type component component_1 {
+	}
+
+	group g_1{
+		type component component_2 {
+		}
+	
+	}
+
+	//are control parts permissible?
+	control {
+	
+	}
+	    
+}
Index: trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentBad.ttcn3	(revision 4)
@@ -0,0 +1,45 @@
+module checkTestcasesModuleContainmentBad {
+    import from LibCommon_sync all;
+
+    // bad module
+	function f_1() runs on component_1{
+	}
+
+	testcase tc_1() runs on component_1{
+			var component_1 ptc0 := component_1.create;
+			ptc0.start(f_1());
+			ptc0.start(f_0()); // defined elsewhere
+			f_3(); //does not count - not in a start statement
+	}    
+	//not used in a start statement
+	function f_3() runs on component_1{
+	}
+
+    //not a testcase or a function\
+    const integer c_1 := 0;
+    
+    
+    group GroupedDefs{
+	//not used in a start statement
+		function f_4() runs on component_1 return float{
+		}
+
+		function f_2() runs on component_1{
+			var component_1 ptc1 := component_1.create;
+			ptc1.start(f_1());
+			ptc1.start(f_0(f_4())); // does not count - used as a nested parameter
+			f_4(); //does not count - not in a start statement
+			timer t;
+			t.start(f_4()); //does not count - used in a timer start operation
+			
+		}
+		
+		testcase tc_2() runs on component_1{
+			var component_1 ptc2 := component_1.create;
+			ptc2.start(f_1());
+			ptc2.start(f_0()); // defined elsewhere
+		
+		}
+
+    }
+}
Index: trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestcasesModuleContainmentCheck/checkTestcasesModuleContainmentGood.ttcn3	(revision 4)
@@ -0,0 +1,30 @@
+module checkTestcasesModuleContainmentGood {
+    import from LibCommon_sync all;
+
+    // good module, only testcases and functions in start statements
+	function f_1() runs on component_1{
+	}
+
+	testcase tc_1() runs on component_1{
+			var component_1 ptc0 := component_1.create;
+			ptc0.start(f_1());
+			ptc0.start(f_0()); // defined elsewhere
+	
+	}    
+    
+    group GroupedDefs{
+		function f_2() runs on component_1{
+			var component_1 ptc1 := component_1.create;
+			ptc1.start(f_1());
+			ptc1.start(f_0()); // defined elsewhere
+		}
+		
+		testcase tc_2() runs on component_1{
+			var component_1 ptc2 := component_1.create;
+			ptc2.start(f_2());
+			ptc2.start(f_0()); // defined elsewhere
+		
+		}
+
+    }
+}
Index: trunk/t3q-examples/checkTestcasesModuleImportsLibCommon_Sync/checkTestcasesModuleImportsLibCommon_SyncGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestcasesModuleImportsLibCommon_Sync/checkTestcasesModuleImportsLibCommon_SyncGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestcasesModuleImportsLibCommon_Sync/checkTestcasesModuleImportsLibCommon_SyncGood.ttcn3	(revision 4)
@@ -0,0 +1,14 @@
+module checkTestcasesModuleImportsLibCommon_syncGood {
+    import from LibCommon_Sync all;
+    
+    // good module, only types and constants
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    type integer myInt;
+    
+    const myInt myIntValue:= 2;
+}
Index: trunk/t3q-examples/checkTestcasesModuleImportsLibCommon_Sync/checkTestcasesModuleImportsLibCommon_syncBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTestcasesModuleImportsLibCommon_Sync/checkTestcasesModuleImportsLibCommon_syncBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTestcasesModuleImportsLibCommon_Sync/checkTestcasesModuleImportsLibCommon_syncBad.ttcn3	(revision 4)
@@ -0,0 +1,16 @@
+module checkTestcasesModuleImportsLibCommon_syncBad {
+    import from LibWhatever {
+        type all except LibCommon_sync;
+    };
+    
+    // good module, only types and constants
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    type integer myInt;
+    
+    const myInt myIntValue:= 2;
+}
Index: trunk/t3q-examples/checkTypeDefOrderInGroup/checkTypeDefOrderInGroup.ttcn3
===================================================================
--- trunk/t3q-examples/checkTypeDefOrderInGroup/checkTypeDefOrderInGroup.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTypeDefOrderInGroup/checkTypeDefOrderInGroup.ttcn3	(revision 4)
@@ -0,0 +1,128 @@
+module checkTypeDefOrderInGroup {
+    type record typeX {
+
+    }
+
+    group emptyGroup {
+		
+	}
+
+	type integer modInt;
+
+	//the good ones
+    group typeDefs {
+
+		type integer groupedInt;
+
+		type component P_compA {
+			var integer a := 3;
+		}
+
+		type component P_comp1 {
+		
+		}
+
+    
+        type record typeA {
+
+        }
+        type record typea {
+
+        }
+//        type record typeab {
+
+//        }
+
+
+        type record typeB {
+
+        }
+        type record typeC {
+
+        }
+    } 
+
+    type record typeY {
+
+    }
+
+    group otherDefs {
+    	altstep as_a(){
+    	
+    	}
+
+    	function f_a(){
+    	
+    	}
+   
+    } 
+
+    group mixedDefs {
+
+		type component compA {
+		
+		}
+
+		type component compB {
+		
+		}
+
+
+        type record typeD {
+
+        }
+        
+        const integer z := 5;
+        
+        type record typeE {
+
+        }
+        
+        const integer x := 2;
+        
+        type record typeF {
+
+        }
+
+		const integer y := 3;
+    } 
+
+	//the bad ones
+
+    group mixedDefsBad {
+		//E comes before D
+        type record typeE {
+
+        }
+
+        type record typeD {
+
+        }
+        
+        const integer z := 5;
+        
+        
+        const integer x := 2;
+        
+        type record typeF {
+
+        }
+		
+		//comp? come after type?
+		//+ compB before compA
+		type component compB {
+		
+		}
+		
+		type component compA {
+		
+		}
+
+
+
+
+		const integer y := 3;
+    } 
+
+
+}
Index: trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckBad.ttcn3	(revision 4)
@@ -0,0 +1,32 @@
+module checkTypesAndValuesModuleContainmentCheckBad {
+    import from LibCommon_time all;
+
+    // good part
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    type integer myInt;
+
+    const myInt myIntValue := 2;
+    // bad part
+
+    template MyRecordType MyTemplate1 := {
+        field1 := 123, 
+        field2 := "A string", 
+        field3 := true
+    }
+
+    testcase t_sendMsg() runs on myComponent {
+    }
+
+    function myfunc() {
+    }
+	group g_1{
+	
+		function f_1(){
+		}
+   	}
+}
Index: trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTypesAndValuesModuleContainmentCheck/checkTypesAndValuesModuleContainmentCheckGood.ttcn3	(revision 4)
@@ -0,0 +1,20 @@
+module checkTypesAndValuesModuleContainmentCheckGood {
+    import from LibCommon_time all;
+
+    // good module, only types and constants
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    type integer myInt;
+    
+    const myInt myIntValue:= 2;
+    
+    group GroupedDefs{
+	    type integer myGroupedInt;
+		const myGroupedInt myGroupedIntValue:= 2;
+
+    }
+}
Index: trunk/t3q-examples/checkTypesAndValuesModuleImportsLibCommon/checkTypesAndValuesModuleImportsLibCommonGood.ttcn3
===================================================================
--- trunk/t3q-examples/checkTypesAndValuesModuleImportsLibCommon/checkTypesAndValuesModuleImportsLibCommonGood.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTypesAndValuesModuleImportsLibCommon/checkTypesAndValuesModuleImportsLibCommonGood.ttcn3	(revision 4)
@@ -0,0 +1,14 @@
+module checkTypesAndValuesModuleImportsLibcommonGood {
+    import from LibCommon_time all;
+    
+    // good module, only types and constants
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    type integer myInt;
+    
+    const myInt myIntValue:= 2;
+}
Index: trunk/t3q-examples/checkTypesAndValuesModuleImportsLibCommon/checkTypesAndValuesModuleImportsLibcommonBad.ttcn3
===================================================================
--- trunk/t3q-examples/checkTypesAndValuesModuleImportsLibCommon/checkTypesAndValuesModuleImportsLibcommonBad.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkTypesAndValuesModuleImportsLibCommon/checkTypesAndValuesModuleImportsLibcommonBad.ttcn3	(revision 4)
@@ -0,0 +1,19 @@
+module checkTypesAndValuesModuleImportsLibcommonBad {
+    import from LibWhatever {
+        type all except LibCommon;
+    };
+    
+    
+    type record MyRecordType {
+        integer field1 optional,
+        charstring field2,
+        boolean field3
+    }
+
+    type integer myInt;
+    
+    const myInt myIntValue:= 2;
+}
+
+module a {
+}
Index: trunk/t3q-examples/checkZeroReferencedModuleDefinitions/checkZeroReferencedModuleDefinitions.ttcn3
===================================================================
--- trunk/t3q-examples/checkZeroReferencedModuleDefinitions/checkZeroReferencedModuleDefinitions.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkZeroReferencedModuleDefinitions/checkZeroReferencedModuleDefinitions.ttcn3	(revision 4)
@@ -0,0 +1,45 @@
+module checkZeroReferencedModuleDefinitions {
+
+    //referenced
+    type integer subtype_1 ( 1 .. 10 );
+
+    //not referenced
+
+    type subtype_1 subtype_2 ( 4 .. 8 );
+
+    //referenced
+
+    type port p_1 message {
+        inout subtype_1
+    }
+
+    //referenced
+
+    type port p_2 message {
+        out subtype_1
+    }
+
+    //not referenced => referenced within import
+
+    type component comp_1 {
+        var subtype_1 localDef_2;
+        port p_1 p1;
+
+    //...
+    }
+
+	group g1 {
+		group sg1{
+		}
+		group sg1{}
+		const integer x := 1;
+		const integer x := 2;
+	}
+	
+	group g2 {
+		group sg1{
+		
+		}
+	}
+	
+}
Index: trunk/t3q-examples/checkZeroReferencedModuleDefinitions/checkZeroReferencedModuleDefinitionsWithImports.ttcn3
===================================================================
--- trunk/t3q-examples/checkZeroReferencedModuleDefinitions/checkZeroReferencedModuleDefinitionsWithImports.ttcn3	(revision 4)
+++ trunk/t3q-examples/checkZeroReferencedModuleDefinitions/checkZeroReferencedModuleDefinitionsWithImports.ttcn3	(revision 4)
@@ -0,0 +1,19 @@
+module checkZeroReferencedModuleDefinitionsWithImports {
+    import from checkZeroReferencedModuleDefinitions {type comp_1, subtype_2};
+
+    //not referenced
+
+    type component comp_2 extends comp_1 {
+        var subtype_1 localDef_2;
+        port p_2 p2;
+
+    //...
+    }
+    
+    group g2 {
+		group sg1{
+		
+		}
+	}
+
+}
