View Javadoc
1   package de.fhdw.wtf.parser.test;
2   
3   import static org.junit.Assert.assertEquals;
4   
5   import java.util.List;
6   import java.util.Vector;
7   
8   import org.junit.Before;
9   import org.junit.Test;
10  
11  import de.fhdw.wtf.common.ast.Attribute;
12  import de.fhdw.wtf.common.ast.AttributeModifier;
13  import de.fhdw.wtf.common.ast.Constructor;
14  import de.fhdw.wtf.common.ast.ConstructorByTypeAndSignatureState;
15  import de.fhdw.wtf.common.ast.ConstructorReference;
16  import de.fhdw.wtf.common.ast.Group;
17  import de.fhdw.wtf.common.ast.GroupElement;
18  import de.fhdw.wtf.common.ast.Model;
19  import de.fhdw.wtf.common.ast.Name;
20  import de.fhdw.wtf.common.ast.Operation;
21  import de.fhdw.wtf.common.ast.OperationModifier;
22  import de.fhdw.wtf.common.ast.UnqualifiedName;
23  import de.fhdw.wtf.common.ast.type.ByNameState;
24  import de.fhdw.wtf.common.ast.type.ClassModifier;
25  import de.fhdw.wtf.common.ast.type.ClassType;
26  import de.fhdw.wtf.common.ast.type.ProductElementType;
27  import de.fhdw.wtf.common.ast.type.ProductType;
28  import de.fhdw.wtf.common.ast.type.RegularClassType;
29  import de.fhdw.wtf.common.ast.type.SumType;
30  import de.fhdw.wtf.common.ast.type.Type;
31  import de.fhdw.wtf.common.ast.type.TypeProxy;
32  import de.fhdw.wtf.common.stream.SimpleScannerInput;
33  import de.fhdw.wtf.common.stream.SimpleTokenStream;
34  import de.fhdw.wtf.common.token.IdentifierToken;
35  import de.fhdw.wtf.common.token.Position;
36  import de.fhdw.wtf.common.token.symbols.BracketOpenToken;
37  import de.fhdw.wtf.common.token.symbols.CurlyBracketOpenToken;
38  import de.fhdw.wtf.dsl.scanner.common.Scanner;
39  import de.fhdw.wtf.dsl.scanner.modelScanner.ModelDslScanner;
40  import de.fhdw.wtf.dsl.scanner.test.VerboseTokenStream;
41  import de.fhdw.wtf.parser.Parser;
42  
43  /**
44   * Tests the parsing of constructors.
45   */
46  public class TestConstructors {
47  	/**
48  	 * Parser which is used to parse the {@link VerboseTokenStream} from scanner.
49  	 */
50  	private Parser parser;
51  	/**
52  	 * The {@link CurlyBracketOpenToken} represents "{".
53  	 */
54  	private CurlyBracketOpenToken curlyBracketOpenToken;
55  	
56  	/**
57  	 * The {@link BracketOpenToken} represents "(".
58  	 */
59  	private BracketOpenToken bracketOpenToken;
60  	
61  	/**
62  	 * The {@link BracketCloseToken} represents ")".
63  	 */
64  	// private BracketCloseToken bracketCloseToken;
65  	
66  	/**
67  	 * The String token, is an {@link IdentifierToken}, that represents "String".
68  	 */
69  	private IdentifierToken stringIdentifier;
70  	/**
71  	 * The Integer token, is an {@link IdentifierToken}, that represents "Integer".
72  	 */
73  	private IdentifierToken integerIdentifier;
74  	
75  	/**
76  	 * Creates the most important Tokens.
77  	 */
78  	@Before
79  	public void setUp() {
80  		this.bracketOpenToken = BracketOpenToken.create(Position.create("", 1, 1, 0));
81  		this.curlyBracketOpenToken = CurlyBracketOpenToken.create(Position.create("", 1, 1, 0));
82  		this.stringIdentifier = IdentifierToken.create("String", Position.create("", 1, 1, 0));
83  		this.integerIdentifier = IdentifierToken.create("Integer", Position.create("", 1, 1, 0));
84  		
85  	}
86  	
87  	/**
88  	 * Group1:group=[A:class={};];.
89  	 * 
90  	 * @throws Exception
91  	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
92  	 */
93  	@Test
94  	public void testClassWithoutConstructor() throws Exception {
95  		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={};];");
96  		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
97  		final Scanner scanner = ModelDslScanner.create();
98  		scanner.scan(input, output);
99  		
100 		final IdentifierToken group1IdentifierToken = (IdentifierToken) output.getStream().peek();
101 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 15, 6));
102 		
103 		final Vector<GroupElement> groupVector = new Vector<>();
104 		final Vector<Constructor> constructors = new Vector<>();
105 		
106 		final Name groupName = UnqualifiedName.create(group1IdentifierToken);
107 		final Group group = Group.create(groupName, groupVector, group1IdentifierToken);
108 		
109 		final Name aName = groupName.addName(aIdentifierToken);
110 		final ClassType aClass =
111 				RegularClassType.create(
112 						aName,
113 						new Vector<ClassModifier>(),
114 						new Vector<Attribute>(),
115 						new Vector<Type>(),
116 						new Vector<Operation>(),
117 						constructors,
118 						aIdentifierToken,
119 						
120 						new Vector<ClassType>());
121 		groupVector.add(aClass);
122 		
123 		final Model expected = Model.create(group1IdentifierToken);
124 		expected.addGroup(group);
125 		
126 		this.parser = Parser.create(output);
127 		final Model actual = this.parser.parse();
128 		
129 		assertEquals(0, this.parser.getExceptions().size());
130 		assertEquals(expected, actual);
131 	}
132 	
133 	/**
134 	 * Group1:group=[A:class={();};];.
135 	 * 
136 	 * @throws Exception
137 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
138 	 */
139 	@Test
140 	public void testSimpleConstructorWithoutParameters() throws Exception {
141 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={();};];");
142 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
143 		final Scanner scanner = ModelDslScanner.create();
144 		scanner.scan(input, output);
145 		
146 		final IdentifierToken group1IdentifierToken = (IdentifierToken) output.getStream().peek();
147 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 15, 6));
148 		
149 		final Vector<GroupElement> groupVector = new Vector<>();
150 		final Vector<Constructor> constructors = new Vector<>();
151 		
152 		final Name groupName = UnqualifiedName.create(group1IdentifierToken);
153 		final Group group = Group.create(groupName, groupVector, group1IdentifierToken);
154 		
155 		final Name aName = groupName.addName(aIdentifierToken);
156 		final ClassType aClass =
157 				RegularClassType.create(
158 						aName,
159 						new Vector<ClassModifier>(),
160 						new Vector<Attribute>(),
161 						new Vector<Type>(),
162 						new Vector<Operation>(),
163 						constructors,
164 						aIdentifierToken,
165 						
166 						new Vector<ClassType>());
167 		groupVector.add(aClass);
168 		
169 		final ProductType product = ProductType.create(this.bracketOpenToken);
170 		
171 		constructors.add(Constructor.create(product, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
172 		
173 		final Model expected = Model.create(group1IdentifierToken);
174 		expected.addGroup(group);
175 		
176 		this.parser = Parser.create(output);
177 		final Model actual = this.parser.parse();
178 		
179 		assertEquals(0, this.parser.getExceptions().size());
180 		assertEquals(expected, actual);
181 		
182 	}
183 	
184 	/**
185 	 * Group1:group=[A:class={();};B:class={();};C:class={();};];.
186 	 * 
187 	 * @throws Exception
188 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
189 	 */
190 	@Test
191 	public void testManyClassesWithOneConstructorOneGroup() throws Exception {
192 		final SimpleScannerInput input =
193 				new SimpleScannerInput("Group1:group=[A:class={();};B:class={();};C:class={();};];");
194 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
195 		final Scanner scanner = ModelDslScanner.create();
196 		scanner.scan(input, output);
197 		
198 		final IdentifierToken group1IdentifierToken = (IdentifierToken) output.getStream().peek();
199 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 15, 6));
200 		final IdentifierToken bIdentifierToken = IdentifierToken.create("B", Position.create("", 1, 29, 16));
201 		final IdentifierToken cIdentifierToken = IdentifierToken.create("C", Position.create("", 1, 43, 26));
202 		
203 		final Vector<GroupElement> groupVector = new Vector<>();
204 		final Vector<Constructor> aConstructors = new Vector<>();
205 		final Vector<Constructor> bConstructors = new Vector<>();
206 		final Vector<Constructor> cConstructors = new Vector<>();
207 		
208 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
209 		final Group group1 = Group.create(group1Name, groupVector, group1IdentifierToken);
210 		
211 		final Name aName = group1Name.addName(aIdentifierToken);
212 		final Name bName = group1Name.addName(bIdentifierToken);
213 		final Name cName = group1Name.addName(cIdentifierToken);
214 		
215 		final ClassType aClass =
216 				RegularClassType.create(
217 						aName,
218 						new Vector<ClassModifier>(),
219 						new Vector<Attribute>(),
220 						new Vector<Type>(),
221 						new Vector<Operation>(),
222 						aConstructors,
223 						aIdentifierToken,
224 						
225 						new Vector<ClassType>());
226 		
227 		final ClassType bClass =
228 				RegularClassType.create(
229 						bName,
230 						new Vector<ClassModifier>(),
231 						new Vector<Attribute>(),
232 						new Vector<Type>(),
233 						new Vector<Operation>(),
234 						bConstructors,
235 						
236 						bIdentifierToken,
237 						
238 						new Vector<ClassType>());
239 		
240 		final ClassType cClass =
241 				RegularClassType.create(
242 						cName,
243 						new Vector<ClassModifier>(),
244 						new Vector<Attribute>(),
245 						new Vector<Type>(),
246 						new Vector<Operation>(),
247 						cConstructors,
248 						cIdentifierToken,
249 						
250 						new Vector<ClassType>());
251 		
252 		groupVector.add(aClass);
253 		groupVector.add(bClass);
254 		groupVector.add(cClass);
255 		
256 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
257 		final ProductType bProduct = ProductType.create(this.bracketOpenToken);
258 		final ProductType cProduct = ProductType.create(this.bracketOpenToken);
259 		
260 		aConstructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
261 		bConstructors.add(Constructor.create(bProduct, bClass, new Vector<ConstructorReference>(), bIdentifierToken));
262 		cConstructors.add(Constructor.create(cProduct, cClass, new Vector<ConstructorReference>(), cIdentifierToken));
263 		
264 		final Model expected = Model.create(group1IdentifierToken);
265 		expected.addGroup(group1);
266 		
267 		this.parser = Parser.create(output);
268 		final Model actual = this.parser.parse();
269 		assertEquals(0, this.parser.getExceptions().size());
270 		assertEquals(expected, actual);
271 	}
272 	
273 	/**
274 	 * Group1:group=[A:class={();};];Group2:group=[B:class={();};];Group3.group=[C:class={();};];.
275 	 * 
276 	 * @throws Exception
277 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
278 	 */
279 	@Test
280 	public void testManyClassesWithOneConstructorDifferentGroups() throws Exception {
281 		final SimpleScannerInput input =
282 				new SimpleScannerInput(
283 						"Group1:group=[A:class={();};];Group2:group=[B:class={();};];Group3:group=[C:class={();};];");
284 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
285 		final Scanner scanner = ModelDslScanner.create();
286 		scanner.scan(input, output);
287 		
288 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
289 		final IdentifierToken group2IdentifierToken = IdentifierToken.create("Group2", Position.create("", 1, 31, 17));
290 		final IdentifierToken group3IdentifierToken = IdentifierToken.create("Group3", Position.create("", 1, 61, 34));
291 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 15, 5));
292 		final IdentifierToken bIdentifierToken = IdentifierToken.create("B", Position.create("", 1, 45, 22));
293 		final IdentifierToken cIdentifierToken = IdentifierToken.create("C", Position.create("", 1, 75, 39));
294 		
295 		final Vector<GroupElement> group1Vector = new Vector<>();
296 		final Vector<GroupElement> group2Vector = new Vector<>();
297 		final Vector<GroupElement> group3Vector = new Vector<>();
298 		final Vector<Constructor> aConstructors = new Vector<>();
299 		final Vector<Constructor> bConstructors = new Vector<>();
300 		final Vector<Constructor> cConstructors = new Vector<>();
301 		
302 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
303 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
304 		
305 		final Name group2Name = UnqualifiedName.create(group2IdentifierToken);
306 		final Group group2 = Group.create(group2Name, group2Vector, group2IdentifierToken);
307 		
308 		final Name group3Name = UnqualifiedName.create(group3IdentifierToken);
309 		final Group group3 = Group.create(group3Name, group3Vector, group3IdentifierToken);
310 		
311 		final Name aName = group1Name.addName(aIdentifierToken);
312 		final Name bName = group2Name.addName(bIdentifierToken);
313 		final Name cName = group3Name.addName(cIdentifierToken);
314 		
315 		final ClassType aClass =
316 				RegularClassType.create(
317 						aName,
318 						new Vector<ClassModifier>(),
319 						new Vector<Attribute>(),
320 						new Vector<Type>(),
321 						new Vector<Operation>(),
322 						aConstructors,
323 						aIdentifierToken,
324 						
325 						new Vector<ClassType>());
326 		final ClassType bClass =
327 				RegularClassType.create(
328 						bName,
329 						new Vector<ClassModifier>(),
330 						new Vector<Attribute>(),
331 						new Vector<Type>(),
332 						new Vector<Operation>(),
333 						bConstructors,
334 						bIdentifierToken,
335 						
336 						new Vector<ClassType>());
337 		final ClassType cClass =
338 				RegularClassType.create(
339 						cName,
340 						new Vector<ClassModifier>(),
341 						new Vector<Attribute>(),
342 						new Vector<Type>(),
343 						new Vector<Operation>(),
344 						cConstructors,
345 						cIdentifierToken,
346 						
347 						new Vector<ClassType>());
348 		group1Vector.add(aClass);
349 		group2Vector.add(bClass);
350 		group3Vector.add(cClass);
351 		
352 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
353 		final ProductType bProduct = ProductType.create(this.bracketOpenToken);
354 		final ProductType cProduct = ProductType.create(this.bracketOpenToken);
355 		
356 		aConstructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
357 		bConstructors.add(Constructor.create(bProduct, bClass, new Vector<ConstructorReference>(), bIdentifierToken));
358 		cConstructors.add(Constructor.create(cProduct, cClass, new Vector<ConstructorReference>(), cIdentifierToken));
359 		
360 		final Model expected = Model.create(group1IdentifierToken);
361 		expected.addGroup(group1);
362 		expected.addGroup(group2);
363 		expected.addGroup(group3);
364 		
365 		this.parser = Parser.create(output);
366 		final Model actual = this.parser.parse();
367 		assertEquals(0, this.parser.getExceptions().size());
368 		assertEquals(expected, actual);
369 	}
370 	
371 	/**
372 	 * Group1:group=[A:class={();(x:Integer);(s:String);(x:String,s:String);};];.
373 	 * 
374 	 * @throws Exception
375 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
376 	 */
377 	@Test
378 	public void testClassWithManyConstructor() throws Exception {
379 		final SimpleScannerInput input =
380 				new SimpleScannerInput("Group1:group=[A:class={();(x:Integer);(s:String);(x:String,s:String);};];");
381 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
382 		final Scanner scanner = ModelDslScanner.create();
383 		scanner.scan(input, output);
384 		
385 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
386 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
387 		final IdentifierToken xParameterIdentifierToken = IdentifierToken.create("x", Position.create("", 1, 28, 15));
388 		final IdentifierToken sParameterIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 0));
389 		
390 		final Vector<GroupElement> group1Vector = new Vector<>();
391 		final Vector<Constructor> constructors = new Vector<>();
392 		
393 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
394 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
395 		
396 		final Name aName = group1Name.addName(aIdentifierToken);
397 		final ClassType aClass =
398 				RegularClassType.create(
399 						aName,
400 						new Vector<ClassModifier>(),
401 						new Vector<Attribute>(),
402 						new Vector<Type>(),
403 						new Vector<Operation>(),
404 						constructors,
405 						aIdentifierToken,
406 						
407 						new Vector<ClassType>());
408 		group1Vector.add(aClass);
409 		
410 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
411 		final ProductType xProduct = ProductType.create(this.bracketOpenToken);
412 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
413 		final ProductType xsProduct = ProductType.create(this.bracketOpenToken);
414 		
415 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
416 		final ByNameState stringName = ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
417 		
418 		final TypeProxy stringTypeProxy = TypeProxy.create(this.stringIdentifier, stringName);
419 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
420 		
421 		xProduct.addElement(ProductElementType.create("x", integerTypeProxy, xParameterIdentifierToken));
422 		xsProduct.addElement(ProductElementType.create("x", stringTypeProxy, sParameterIdentifierToken));
423 		final ProductElementType stringElement1 =
424 				ProductElementType.create("s", stringTypeProxy, sParameterIdentifierToken);
425 		sProduct.addElement(stringElement1);
426 		xsProduct.addElement(stringElement1);
427 		
428 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
429 		constructors.add(Constructor.create(
430 				xProduct,
431 				aClass,
432 				new Vector<ConstructorReference>(),
433 				xParameterIdentifierToken));
434 		constructors.add(Constructor.create(
435 				sProduct,
436 				aClass,
437 				new Vector<ConstructorReference>(),
438 				sParameterIdentifierToken));
439 		constructors.add(Constructor.create(
440 				xsProduct,
441 				aClass,
442 				new Vector<ConstructorReference>(),
443 				xParameterIdentifierToken));
444 		
445 		final Model expected = Model.create(group1IdentifierToken);
446 		expected.addGroup(group1);
447 		
448 		this.parser = Parser.create(output);
449 		final Model actual = this.parser.parse();
450 		assertEquals(0, this.parser.getExceptions().size());
451 		assertEquals(expected, actual);
452 		
453 	}
454 	
455 	/**
456 	 * Group1:group=[A:class={()=A(Integer);(i:Integer);};];.
457 	 * 
458 	 * @throws Exception
459 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
460 	 */
461 	@Test
462 	public void testConstructorReferenzesOtherConstructorInTheSameClass() throws Exception {
463 		final SimpleScannerInput input =
464 				new SimpleScannerInput("Group1:group=[A:class={()=A(Integer);(i:Integer);};];");
465 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
466 		final Scanner scanner = ModelDslScanner.create();
467 		scanner.scan(input, output);
468 		
469 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
470 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
471 		final IdentifierToken iParameterIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 1));
472 		
473 		final Vector<GroupElement> group1Vector = new Vector<>();
474 		final Vector<Constructor> constructors = new Vector<>();
475 		
476 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
477 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
478 		
479 		final Name aName = group1Name.addName(aIdentifierToken);
480 		final ClassType aClass =
481 				RegularClassType.create(
482 						aName,
483 						new Vector<ClassModifier>(),
484 						new Vector<Attribute>(),
485 						new Vector<Type>(),
486 						new Vector<Operation>(),
487 						constructors,
488 						aIdentifierToken,
489 						
490 						new Vector<ClassType>());
491 		group1Vector.add(aClass);
492 		
493 		final ProductType emptyProduct = ProductType.create(this.bracketOpenToken);
494 		final ProductType integerProduct = ProductType.create(this.bracketOpenToken);
495 		
496 		final List<ConstructorReference> references = new Vector<>();
497 		final List<Type> paramTypes = new Vector<>();
498 		
499 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
500 		final ByNameState aClassName = ByNameState.create(UnqualifiedName.create(aIdentifierToken));
501 		
502 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
503 		final TypeProxy aClassTypeProxy = TypeProxy.create(aIdentifierToken, aClassName);
504 		
505 		paramTypes.add(integerTypeProxy);
506 		
507 		references.add(ConstructorReference.create(ConstructorByTypeAndSignatureState.create(
508 				aClassTypeProxy,
509 				paramTypes)));
510 		
511 		constructors.add(Constructor.create(emptyProduct, aClass, references, this.bracketOpenToken));
512 		constructors.add(Constructor.create(
513 				integerProduct,
514 				aClass,
515 				new Vector<ConstructorReference>(),
516 				this.bracketOpenToken));
517 		
518 		integerProduct.addElement(ProductElementType.create("i", integerTypeProxy, iParameterIdentifierToken));
519 		
520 		final Model expected = Model.create(group1IdentifierToken);
521 		expected.addGroup(group1);
522 		
523 		this.parser = Parser.create(output);
524 		final Model actual = this.parser.parse();
525 		
526 		assertEquals(0, this.parser.getExceptions().size());
527 		assertEquals(expected, actual);
528 		
529 	}
530 	
531 	/**
532 	 * Group1:group=[A:class={();op:[[(s:String)->{}]];};];.
533 	 * 
534 	 * @throws Exception
535 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
536 	 */
537 	@Test
538 	public void testFirstConstructorThanOperation() throws Exception {
539 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={();op:[[(s:String)->{}]];};];");
540 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
541 		final Scanner scanner = ModelDslScanner.create();
542 		scanner.scan(input, output);
543 		
544 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
545 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
546 		final IdentifierToken sParameterIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
547 		final IdentifierToken op = IdentifierToken.create("op", Position.create("", 1, 1, 0));
548 		
549 		final Vector<GroupElement> group1Vector = new Vector<>();
550 		final Vector<Constructor> constructors = new Vector<>();
551 		final Vector<Operation> operations = new Vector<>();
552 		
553 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
554 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
555 		
556 		final Name aName = group1Name.addName(aIdentifierToken);
557 		
558 		final ClassType aClass =
559 				RegularClassType.create(
560 						aName,
561 						new Vector<ClassModifier>(),
562 						new Vector<Attribute>(),
563 						new Vector<Type>(),
564 						operations,
565 						constructors,
566 						aIdentifierToken,
567 						
568 						new Vector<ClassType>());
569 		group1Vector.add(aClass);
570 		
571 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
572 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
573 		
574 		final ByNameState stringName = ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
575 		
576 		final TypeProxy stringTypeProxy = TypeProxy.create(this.stringIdentifier, stringName);
577 		
578 		sProduct.addElement(ProductElementType.create("s", stringTypeProxy, sParameterIdentifierToken));
579 		
580 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
581 		
582 		final Operation operation =
583 				Operation.create(
584 						"op",
585 						new Vector<OperationModifier>(),
586 						sProduct,
587 						aClass,
588 						SumType.create(this.curlyBracketOpenToken),
589 						op);
590 		operations.add(operation);
591 		
592 		final Model expected = Model.create(group1IdentifierToken);
593 		expected.addGroup(group1);
594 		
595 		this.parser = Parser.create(output);
596 		final Model actual = this.parser.parse();
597 		
598 		assertEquals(0, this.parser.getExceptions().size());
599 		assertEquals(expected, actual);
600 	}
601 	
602 	/**
603 	 * Group1:group=[A:class={op:[[(s:String)->{}]];();};]; Parser macht wieder Reihenfolge: Konstruktor, Operation.
604 	 * 
605 	 * @throws Exception
606 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
607 	 */
608 	@Test
609 	public void testFirstOperationThanConstructor() throws Exception {
610 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={op:[[(s:String)->{}]];();};];");
611 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
612 		final Scanner scanner = ModelDslScanner.create();
613 		scanner.scan(input, output);
614 		
615 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
616 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
617 		final IdentifierToken sParameterIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
618 		final IdentifierToken op = IdentifierToken.create("op", Position.create("", 1, 1, 0));
619 		
620 		final Vector<GroupElement> group1Vector = new Vector<>();
621 		final Vector<Constructor> constructors = new Vector<>();
622 		final Vector<Operation> operations = new Vector<>();
623 		
624 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
625 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
626 		
627 		final Name aName = group1Name.addName(aIdentifierToken);
628 		final ClassType aClass =
629 				RegularClassType.create(
630 						aName,
631 						new Vector<ClassModifier>(),
632 						new Vector<Attribute>(),
633 						new Vector<Type>(),
634 						operations,
635 						constructors,
636 						aIdentifierToken,
637 						
638 						new Vector<ClassType>());
639 		group1Vector.add(aClass);
640 		
641 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
642 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
643 		
644 		final ByNameState stringName = ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
645 		final TypeProxy stringTypeProxy = TypeProxy.create(this.stringIdentifier, stringName);
646 		
647 		sProduct.addElement(ProductElementType.create("s", stringTypeProxy, sParameterIdentifierToken));
648 		
649 		final Operation operation =
650 				Operation.create(
651 						"op",
652 						new Vector<OperationModifier>(),
653 						sProduct,
654 						aClass,
655 						SumType.create(this.curlyBracketOpenToken),
656 						op);
657 		operations.add(operation);
658 		
659 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
660 		
661 		final Model expected = Model.create(group1IdentifierToken);
662 		expected.addGroup(group1);
663 		
664 		this.parser = Parser.create(output);
665 		final Model actual = this.parser.parse();
666 		
667 		assertEquals(0, this.parser.getExceptions().size());
668 		assertEquals(expected, actual);
669 	}
670 	
671 	/**
672 	 * Group1:group=[A:class={op1:[[(s:String)->{}]];();op2:[[(i:Integer)->{}]];};];.
673 	 * 
674 	 * @throws Exception
675 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
676 	 */
677 	@Test
678 	public void testConstructorBetweenOperation() throws Exception {
679 		final SimpleScannerInput input =
680 				new SimpleScannerInput("Group1:group=[A:class={op1:[[(s:String)->{}]];();op2:[[(i:Integer)->{}]];};];");
681 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
682 		final Scanner scanner = ModelDslScanner.create();
683 		scanner.scan(input, output);
684 		
685 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
686 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
687 		final IdentifierToken sParameterIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
688 		final IdentifierToken iParameterIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 1));
689 		
690 		final IdentifierToken op1 = IdentifierToken.create("op1", Position.create("", 1, 1, 0));
691 		final IdentifierToken op2 = IdentifierToken.create("op2", Position.create("", 1, 1, 0));
692 		
693 		final Vector<GroupElement> group1Vector = new Vector<>();
694 		final Vector<Constructor> constructors = new Vector<>();
695 		final Vector<Operation> operations = new Vector<>();
696 		
697 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
698 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
699 		
700 		final Name aName = group1Name.addName(aIdentifierToken);
701 		final ClassType aClass =
702 				RegularClassType.create(
703 						aName,
704 						new Vector<ClassModifier>(),
705 						new Vector<Attribute>(),
706 						new Vector<Type>(),
707 						operations,
708 						constructors,
709 						aIdentifierToken,
710 						
711 						new Vector<ClassType>());
712 		group1Vector.add(aClass);
713 		
714 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
715 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
716 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
717 		
718 		final ByNameState stringName = ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
719 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
720 		
721 		final TypeProxy stringTypeProxy = TypeProxy.create(this.stringIdentifier, stringName);
722 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
723 		
724 		sProduct.addElement(ProductElementType.create("s", stringTypeProxy, sParameterIdentifierToken));
725 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iParameterIdentifierToken));
726 		
727 		final SumType sum = SumType.create(this.curlyBracketOpenToken);
728 		
729 		operations.add(Operation.create("op1", new Vector<OperationModifier>(), sProduct, aClass, sum, op1));
730 		operations.add(Operation.create("op2", new Vector<OperationModifier>(), iProduct, aClass, sum, op2));
731 		
732 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
733 		
734 		final Model expected = Model.create(group1IdentifierToken);
735 		expected.addGroup(group1);
736 		
737 		this.parser = Parser.create(output);
738 		final Model actual = this.parser.parse();
739 		
740 		assertEquals(0, this.parser.getExceptions().size());
741 		assertEquals(expected, actual);
742 	}
743 	
744 	/**
745 	 * Group1:group=[A:class={op1:[[(s:String)->{}]];();(i:Integer);(s:String);(x:String,s:String);op2:[[(i:Integer)->{}
746 	 * ]];};];.
747 	 * 
748 	 * @throws Exception
749 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
750 	 */
751 	@Test
752 	public void testManyConstructorBetweenOperation() throws Exception {
753 		final SimpleScannerInput input =
754 				new SimpleScannerInput("Group1:group=[A:class={op1:[[(s:String)->{}]];();(i:Integer);"
755 						+ "(s:String);(x:String,s:String);op2:[[(i:Integer)->{}]];};];");
756 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
757 		final Scanner scanner = ModelDslScanner.create();
758 		scanner.scan(input, output);
759 		
760 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
761 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
762 		final IdentifierToken sParameterIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
763 		final IdentifierToken iParameterIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 28, 15));
764 		
765 		final IdentifierToken op1 = IdentifierToken.create("op1", Position.create("", 1, 1, 0));
766 		final IdentifierToken op2 = IdentifierToken.create("op2", Position.create("", 1, 1, 0));
767 		
768 		final Vector<GroupElement> group1Vector = new Vector<>();
769 		final Vector<Constructor> constructors = new Vector<>();
770 		final Vector<Operation> operations = new Vector<>();
771 		
772 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
773 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
774 		
775 		final Name aName = group1Name.addName(aIdentifierToken);
776 		final ClassType aClass =
777 				RegularClassType.create(
778 						aName,
779 						new Vector<ClassModifier>(),
780 						new Vector<Attribute>(),
781 						new Vector<Type>(),
782 						operations,
783 						constructors,
784 						aIdentifierToken,
785 						
786 						new Vector<ClassType>());
787 		group1Vector.add(aClass);
788 		
789 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
790 		final ProductType xProduct = ProductType.create(this.bracketOpenToken);
791 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
792 		final ProductType xsProduct = ProductType.create(this.bracketOpenToken);
793 		
794 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
795 		final ByNameState stringName = ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
796 		
797 		final TypeProxy stringTypeProxy = TypeProxy.create(this.stringIdentifier, stringName);
798 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
799 		
800 		final ProductElementType stringElement1 =
801 				ProductElementType.create("s", stringTypeProxy, sParameterIdentifierToken);
802 		final ProductElementType integerElement =
803 				ProductElementType.create("i", integerTypeProxy, iParameterIdentifierToken);
804 		sProduct.addElement(stringElement1);
805 		xProduct.addElement(integerElement);
806 		xsProduct.addElement(ProductElementType.create("x", stringTypeProxy, sParameterIdentifierToken));
807 		xsProduct.addElement(stringElement1);
808 		
809 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
810 		constructors.add(Constructor.create(
811 				xProduct,
812 				aClass,
813 				new Vector<ConstructorReference>(),
814 				iParameterIdentifierToken));
815 		constructors.add(Constructor.create(
816 				sProduct,
817 				aClass,
818 				new Vector<ConstructorReference>(),
819 				sParameterIdentifierToken));
820 		constructors.add(Constructor.create(
821 				xsProduct,
822 				aClass,
823 				new Vector<ConstructorReference>(),
824 				iParameterIdentifierToken));
825 		
826 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
827 		iProduct.addElement(integerElement);
828 		
829 		final SumType sum = SumType.create(this.curlyBracketOpenToken);
830 		
831 		operations.add(Operation.create("op1", new Vector<OperationModifier>(), sProduct, aClass, sum, op1));
832 		operations.add(Operation.create("op2", new Vector<OperationModifier>(), iProduct, aClass, sum, op2));
833 		
834 		final Model expected = Model.create(group1IdentifierToken);
835 		expected.addGroup(group1);
836 		
837 		this.parser = Parser.create(output);
838 		final Model actual = this.parser.parse();
839 		
840 		assertEquals(0, this.parser.getExceptions().size());
841 		assertEquals(expected, actual);
842 		
843 	}
844 	
845 	/**
846 	 * Group1:group=[A:class={s:String;();};];.
847 	 * 
848 	 * @throws Exception
849 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
850 	 */
851 	@Test
852 	public void testFirstVariableThanConstructor() throws Exception {
853 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={s:String;();};];");
854 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
855 		final Scanner scanner = ModelDslScanner.create();
856 		scanner.scan(input, output);
857 		
858 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
859 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
860 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 0));
861 		
862 		final Vector<GroupElement> group1Vector = new Vector<>();
863 		final Vector<Constructor> constructors = new Vector<>();
864 		final Vector<Attribute> attributes = new Vector<>();
865 		
866 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
867 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
868 		
869 		final Name aName = group1Name.addName(aIdentifierToken);
870 		final ClassType aClass =
871 				RegularClassType.create(
872 						aName,
873 						new Vector<ClassModifier>(),
874 						attributes,
875 						new Vector<Type>(),
876 						new Vector<Operation>(),
877 						constructors,
878 						aIdentifierToken,
879 						
880 						new Vector<ClassType>());
881 		group1Vector.add(aClass);
882 		
883 		final ByNameState attributeStringReferenceState =
884 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
885 		
886 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
887 		
888 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
889 		
890 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
891 		
892 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
893 		
894 		final Model expected = Model.create(group1IdentifierToken);
895 		expected.addGroup(group1);
896 		
897 		this.parser = Parser.create(output);
898 		final Model actual = this.parser.parse();
899 		
900 		assertEquals(0, this.parser.getExceptions().size());
901 		assertEquals(expected, actual);
902 	}
903 	
904 	/**
905 	 * Group1:group=[A:class={();s:String;};];.
906 	 * 
907 	 * @throws Exception
908 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
909 	 */
910 	@Test
911 	public void testFirstConstructorThanVariable() throws Exception {
912 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={();s:String;};];");
913 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
914 		final Scanner scanner = ModelDslScanner.create();
915 		scanner.scan(input, output);
916 		
917 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
918 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
919 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 0));
920 		
921 		final Vector<GroupElement> group1Vector = new Vector<>();
922 		final Vector<Constructor> constructors = new Vector<>();
923 		final Vector<Attribute> attributes = new Vector<>();
924 		
925 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
926 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
927 		
928 		final Name aName = group1Name.addName(aIdentifierToken);
929 		final ClassType aClass =
930 				RegularClassType.create(
931 						aName,
932 						new Vector<ClassModifier>(),
933 						attributes,
934 						new Vector<Type>(),
935 						new Vector<Operation>(),
936 						constructors,
937 						aIdentifierToken,
938 						
939 						new Vector<ClassType>());
940 		group1Vector.add(aClass);
941 		
942 		final ByNameState attributeStringReferenceState =
943 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
944 		
945 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
946 		
947 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
948 		
949 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
950 		
951 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
952 		
953 		final Model expected = Model.create(group1IdentifierToken);
954 		expected.addGroup(group1);
955 		
956 		this.parser = Parser.create(output);
957 		final Model actual = this.parser.parse();
958 		
959 		assertEquals(0, this.parser.getExceptions().size());
960 		assertEquals(expected, actual);
961 	}
962 	
963 	/**
964 	 * Group1:group=[A:class={s:String;();i:Integer;};];.
965 	 * 
966 	 * @throws Exception
967 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
968 	 */
969 	@Test
970 	public void testConstructorBetweenVariable() throws Exception {
971 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={s:String;();i:Integer;};];");
972 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
973 		final Scanner scanner = ModelDslScanner.create();
974 		scanner.scan(input, output);
975 		
976 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
977 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
978 		final IdentifierToken iParameterIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 1));
979 		final IdentifierToken nameIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 0));
980 		
981 		final Vector<GroupElement> group1Vector = new Vector<>();
982 		final Vector<Constructor> constructors = new Vector<>();
983 		final Vector<Attribute> attributes = new Vector<>();
984 		
985 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
986 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
987 		
988 		final Name aName = group1Name.addName(aIdentifierToken);
989 		final ClassType aClass =
990 				RegularClassType.create(
991 						aName,
992 						new Vector<ClassModifier>(),
993 						attributes,
994 						new Vector<Type>(),
995 						new Vector<Operation>(),
996 						constructors,
997 						aIdentifierToken,
998 						
999 						new Vector<ClassType>());
1000 		group1Vector.add(aClass);
1001 		
1002 		final ByNameState attributeStringReferenceState =
1003 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
1004 		final ByNameState attributeIntegerReferenceState =
1005 				ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1006 		
1007 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
1008 		final TypeProxy integerType = TypeProxy.create(this.integerIdentifier, attributeIntegerReferenceState);
1009 		
1010 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1011 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1012 		
1013 		iProduct.addElement(ProductElementType.create("i", integerType, iParameterIdentifierToken));
1014 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), nameIdentifierToken));
1015 		attributes.add(Attribute.create("i", integerType, new Vector<AttributeModifier>(), iParameterIdentifierToken));
1016 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1017 		
1018 		final Model expected = Model.create(group1IdentifierToken);
1019 		expected.addGroup(group1);
1020 		
1021 		this.parser = Parser.create(output);
1022 		final Model actual = this.parser.parse();
1023 		
1024 		assertEquals(0, this.parser.getExceptions().size());
1025 		assertEquals(expected, actual);
1026 	}
1027 	
1028 	/**
1029 	 * Group1:group=[A:class={s:String;();(i:Integer);i:Integer;};];.
1030 	 * 
1031 	 * @throws Exception
1032 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1033 	 */
1034 	@Test
1035 	public void testManyConstructorBetweenVariable() throws Exception {
1036 		final SimpleScannerInput input =
1037 				new SimpleScannerInput("Group1:group=[A:class={s:String;();(i:Integer);i:Integer;};];");
1038 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1039 		final Scanner scanner = ModelDslScanner.create();
1040 		scanner.scan(input, output);
1041 		
1042 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1043 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1044 		final IdentifierToken iParameterIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 1));
1045 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 0));
1046 		
1047 		final Vector<GroupElement> group1Vector = new Vector<>();
1048 		final Vector<Constructor> constructors = new Vector<>();
1049 		final Vector<Attribute> attributes = new Vector<>();
1050 		
1051 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1052 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1053 		
1054 		final Name aName = group1Name.addName(aIdentifierToken);
1055 		final ClassType aClass =
1056 				RegularClassType.create(
1057 						aName,
1058 						new Vector<ClassModifier>(),
1059 						attributes,
1060 						new Vector<Type>(),
1061 						new Vector<Operation>(),
1062 						constructors,
1063 						aIdentifierToken,
1064 						
1065 						new Vector<ClassType>());
1066 		group1Vector.add(aClass);
1067 		
1068 		final ByNameState attributeStringReferenceState =
1069 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
1070 		final ByNameState attributeIntegerReferenceState =
1071 				ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1072 		
1073 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
1074 		final TypeProxy integerType = TypeProxy.create(this.integerIdentifier, attributeIntegerReferenceState);
1075 		
1076 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
1077 		attributes.add(Attribute.create("i", integerType, new Vector<AttributeModifier>(), iParameterIdentifierToken));
1078 		
1079 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1080 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1081 		
1082 		iProduct.addElement(ProductElementType.create("i", integerType, iParameterIdentifierToken));
1083 		
1084 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1085 		constructors.add(Constructor.create(iProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1086 		
1087 		final Model expected = Model.create(group1IdentifierToken);
1088 		expected.addGroup(group1);
1089 		
1090 		this.parser = Parser.create(output);
1091 		final Model actual = this.parser.parse();
1092 		
1093 		assertEquals(0, this.parser.getExceptions().size());
1094 		assertEquals(expected, actual);
1095 	}
1096 	
1097 	/**
1098 	 * Group1:group=[A:class={op:[[(s:String)->{}]];s:String;();};];.
1099 	 * 
1100 	 * @throws Exception
1101 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1102 	 */
1103 	@Test
1104 	public void testFirstOperationThanVariableThanConstructor() throws Exception {
1105 		final SimpleScannerInput input =
1106 				new SimpleScannerInput("Group1:group=[A:class={op:[[(s:String)->{}]];s:String;();};];");
1107 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1108 		final Scanner scanner = ModelDslScanner.create();
1109 		scanner.scan(input, output);
1110 		
1111 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1112 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1113 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
1114 		final IdentifierToken op = IdentifierToken.create("op", Position.create("", 1, 1, 0));
1115 		
1116 		final Vector<GroupElement> group1Vector = new Vector<>();
1117 		final Vector<Constructor> constructors = new Vector<>();
1118 		final Vector<Operation> operations = new Vector<>();
1119 		final Vector<Attribute> attributes = new Vector<>();
1120 		
1121 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1122 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1123 		
1124 		final Name aName = group1Name.addName(aIdentifierToken);
1125 		final ClassType aClass =
1126 				RegularClassType.create(
1127 						aName,
1128 						new Vector<ClassModifier>(),
1129 						attributes,
1130 						new Vector<Type>(),
1131 						operations,
1132 						constructors,
1133 						aIdentifierToken,
1134 						
1135 						new Vector<ClassType>());
1136 		group1Vector.add(aClass);
1137 		
1138 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1139 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
1140 		
1141 		final TypeProxy stringType =
1142 				TypeProxy.create(
1143 						this.stringIdentifier,
1144 						ByNameState.create(UnqualifiedName.create(this.stringIdentifier)));
1145 		
1146 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
1147 		sProduct.addElement(ProductElementType.create("s", stringType, sIdentifierToken));
1148 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1149 		
1150 		final Operation operation =
1151 				Operation.create(
1152 						"op",
1153 						new Vector<OperationModifier>(),
1154 						sProduct,
1155 						aClass,
1156 						SumType.create(this.curlyBracketOpenToken),
1157 						op);
1158 		operations.add(operation);
1159 		
1160 		final Model expected = Model.create(group1IdentifierToken);
1161 		expected.addGroup(group1);
1162 		
1163 		this.parser = Parser.create(output);
1164 		final Model actual = this.parser.parse();
1165 		
1166 		assertEquals(0, this.parser.getExceptions().size());
1167 		assertEquals(expected, actual);
1168 		
1169 	}
1170 	
1171 	/**
1172 	 * Group1:group=[A:class={op:[[(s:String)->{}]];();s:String;};];.
1173 	 * 
1174 	 * 
1175 	 * @throws Exception
1176 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1177 	 */
1178 	@Test
1179 	public void testFirstOperationThanConstructorThanVariale() throws Exception {
1180 		final SimpleScannerInput input =
1181 				new SimpleScannerInput("Group1:group=[A:class={op:[[(s:String)->{}]];();s:String;};];");
1182 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1183 		final Scanner scanner = ModelDslScanner.create();
1184 		scanner.scan(input, output);
1185 		
1186 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1187 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1188 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
1189 		final IdentifierToken op = IdentifierToken.create("op", Position.create("", 1, 1, 0));
1190 		
1191 		final Vector<GroupElement> group1Vector = new Vector<>();
1192 		final Vector<Constructor> constructors = new Vector<>();
1193 		final Vector<Operation> operations = new Vector<>();
1194 		final Vector<Attribute> attributes = new Vector<>();
1195 		
1196 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1197 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1198 		
1199 		final Name aName = group1Name.addName(aIdentifierToken);
1200 		final ClassType aClass =
1201 				RegularClassType.create(
1202 						aName,
1203 						new Vector<ClassModifier>(),
1204 						attributes,
1205 						new Vector<Type>(),
1206 						operations,
1207 						constructors,
1208 						aIdentifierToken,
1209 						
1210 						new Vector<ClassType>());
1211 		group1Vector.add(aClass);
1212 		
1213 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1214 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
1215 		
1216 		final ByNameState attributeStringReferenceState =
1217 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
1218 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
1219 		
1220 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
1221 		sProduct.addElement(ProductElementType.create("s", stringType, sIdentifierToken));
1222 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1223 		
1224 		final Operation operation1 =
1225 				Operation.create(
1226 						"op",
1227 						new Vector<OperationModifier>(),
1228 						sProduct,
1229 						aClass,
1230 						SumType.create(this.curlyBracketOpenToken),
1231 						op);
1232 		operations.add(operation1);
1233 		
1234 		final Model expected = Model.create(group1IdentifierToken);
1235 		expected.addGroup(group1);
1236 		
1237 		this.parser = Parser.create(output);
1238 		final Model actual = this.parser.parse();
1239 		
1240 		assertEquals(0, this.parser.getExceptions().size());
1241 		assertEquals(expected, actual);
1242 	}
1243 	
1244 	/**
1245 	 * Group1:group=[A:class={();op:[[(s:String)->{}]];s:String;};];.
1246 	 * 
1247 	 * @throws Exception
1248 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1249 	 */
1250 	@Test
1251 	public void testFirstConstructorThanOperationThanVariable() throws Exception {
1252 		final SimpleScannerInput input =
1253 				new SimpleScannerInput("Group1:group=[A:class={();op:[[(s:String)->{}]];s:String;};];");
1254 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1255 		final Scanner scanner = ModelDslScanner.create();
1256 		scanner.scan(input, output);
1257 		
1258 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1259 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1260 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
1261 		final IdentifierToken op = IdentifierToken.create("op", Position.create("", 1, 1, 0));
1262 		
1263 		final Vector<GroupElement> group1Vector = new Vector<>();
1264 		final Vector<Constructor> constructors = new Vector<>();
1265 		final Vector<Operation> operations = new Vector<>();
1266 		final Vector<Attribute> attributes = new Vector<>();
1267 		
1268 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1269 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1270 		
1271 		final Name aName = group1Name.addName(aIdentifierToken);
1272 		final ClassType aClass =
1273 				RegularClassType.create(
1274 						aName,
1275 						new Vector<ClassModifier>(),
1276 						attributes,
1277 						new Vector<Type>(),
1278 						operations,
1279 						constructors,
1280 						aIdentifierToken,
1281 						
1282 						new Vector<ClassType>());
1283 		group1Vector.add(aClass);
1284 		
1285 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1286 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
1287 		
1288 		final ByNameState attributeStringReferenceState =
1289 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
1290 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
1291 		
1292 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
1293 		sProduct.addElement(ProductElementType.create("s", stringType, sIdentifierToken));
1294 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1295 		
1296 		final Operation operation =
1297 				Operation.create(
1298 						"op",
1299 						new Vector<OperationModifier>(),
1300 						sProduct,
1301 						aClass,
1302 						SumType.create(this.curlyBracketOpenToken),
1303 						op);
1304 		operations.add(operation);
1305 		
1306 		final Model expected = Model.create(group1IdentifierToken);
1307 		expected.addGroup(group1);
1308 		
1309 		this.parser = Parser.create(output);
1310 		final Model actual = this.parser.parse();
1311 		
1312 		assertEquals(0, this.parser.getExceptions().size());
1313 		assertEquals(expected, actual);
1314 	}
1315 	
1316 	/**
1317 	 * Group1:group=[SA:class={};A:class=SA+{();op:[[(s:String)->{}]];s:String;};];.
1318 	 * 
1319 	 * @throws Exception
1320 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1321 	 */
1322 	@Test
1323 	public void testConstructorWithoutParameterAndSuperclassWithoutParameter() throws Exception {
1324 		final SimpleScannerInput input =
1325 				new SimpleScannerInput("Group1:group=[SA:class={};A:class=SA+{();op:[[(s:String)->{}]];s:String;};];");
1326 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1327 		final Scanner scanner = ModelDslScanner.create();
1328 		scanner.scan(input, output);
1329 		
1330 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1331 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1332 		final IdentifierToken saIdentifierToken = IdentifierToken.create("SA", Position.create("", 1, 1, 0));
1333 		final IdentifierToken sIdentifierToken = IdentifierToken.create("s", Position.create("", 1, 1, 1));
1334 		final IdentifierToken op = IdentifierToken.create("op", Position.create("", 1, 1, 0));
1335 		
1336 		final Vector<GroupElement> group1Vector = new Vector<>();
1337 		final Vector<Constructor> constructors = new Vector<>();
1338 		final Vector<Operation> operations = new Vector<>();
1339 		final Vector<Attribute> attributes = new Vector<>();
1340 		
1341 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1342 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1343 		
1344 		final Name aName = group1Name.addName(aIdentifierToken);
1345 		final Name saName = group1Name.addName(saIdentifierToken);
1346 		
1347 		final ClassType saClass =
1348 				RegularClassType.create(
1349 						saName,
1350 						new Vector<ClassModifier>(),
1351 						new Vector<Attribute>(),
1352 						new Vector<Type>(),
1353 						new Vector<Operation>(),
1354 						new Vector<Constructor>(),
1355 						saIdentifierToken,
1356 						
1357 						new Vector<ClassType>());
1358 		group1Vector.add(saClass);
1359 		
1360 		final TypeProxy supertype =
1361 				TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(saIdentifierToken)));
1362 		final Vector<Type> supertypes = new Vector<>();
1363 		supertypes.add(supertype);
1364 		
1365 		final ClassType aClass =
1366 				RegularClassType.create(
1367 						aName,
1368 						new Vector<ClassModifier>(),
1369 						attributes,
1370 						supertypes,
1371 						operations,
1372 						constructors,
1373 						aIdentifierToken,
1374 						
1375 						new Vector<ClassType>());
1376 		group1Vector.add(aClass);
1377 		
1378 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1379 		final ProductType sProduct = ProductType.create(this.bracketOpenToken);
1380 		
1381 		final ByNameState attributeStringReferenceState =
1382 				ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
1383 		final TypeProxy stringType = TypeProxy.create(this.stringIdentifier, attributeStringReferenceState);
1384 		
1385 		attributes.add(Attribute.create("s", stringType, new Vector<AttributeModifier>(), sIdentifierToken));
1386 		sProduct.addElement(ProductElementType.create("s", stringType, sIdentifierToken));
1387 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1388 		
1389 		final Operation operation =
1390 				Operation.create(
1391 						"op",
1392 						new Vector<OperationModifier>(),
1393 						sProduct,
1394 						aClass,
1395 						SumType.create(this.curlyBracketOpenToken),
1396 						op);
1397 		operations.add(operation);
1398 		
1399 		final Model expected = Model.create(group1IdentifierToken);
1400 		expected.addGroup(group1);
1401 		
1402 		this.parser = Parser.create(output);
1403 		final Model actual = this.parser.parse();
1404 		
1405 		assertEquals(0, this.parser.getExceptions().size());
1406 		assertEquals(expected, actual);
1407 		
1408 	}
1409 	
1410 	/**
1411 	 * Group1:group=[SA:class={};A:class=SA+{(i:Integer);};];.
1412 	 * 
1413 	 * @throws Exception
1414 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1415 	 */
1416 	@Test
1417 	public void testConstructorWithParameterAndSuperclassWithoutParameter() throws Exception {
1418 		final SimpleScannerInput input =
1419 				new SimpleScannerInput("Group1:group=[SA:class={};A:class=SA+{(i:Integer);};];");
1420 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1421 		final Scanner scanner = ModelDslScanner.create();
1422 		scanner.scan(input, output);
1423 		
1424 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1425 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1426 		final IdentifierToken saIdentifierToken = IdentifierToken.create("SA", Position.create("", 1, 1, 0));
1427 		final IdentifierToken iParameterIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 1));
1428 		
1429 		final Vector<GroupElement> group1Vector = new Vector<>();
1430 		final Vector<Constructor> constructors = new Vector<>();
1431 		
1432 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1433 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1434 		
1435 		final Name aName = group1Name.addName(aIdentifierToken);
1436 		final Name saName = group1Name.addName(saIdentifierToken);
1437 		
1438 		final Vector<Type> supertypes = new Vector<>();
1439 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(saIdentifierToken))));
1440 		
1441 		final ClassType saClass =
1442 				RegularClassType.create(
1443 						saName,
1444 						new Vector<ClassModifier>(),
1445 						new Vector<Attribute>(),
1446 						new Vector<Type>(),
1447 						new Vector<Operation>(),
1448 						new Vector<Constructor>(),
1449 						saIdentifierToken,
1450 						
1451 						new Vector<ClassType>());
1452 		
1453 		final ClassType aClass =
1454 				RegularClassType.create(
1455 						aName,
1456 						new Vector<ClassModifier>(),
1457 						new Vector<Attribute>(),
1458 						supertypes,
1459 						new Vector<Operation>(),
1460 						constructors,
1461 						aIdentifierToken,
1462 						
1463 						new Vector<ClassType>());
1464 		group1Vector.add(saClass);
1465 		group1Vector.add(aClass);
1466 		
1467 		// constructors
1468 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1469 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
1470 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1471 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iParameterIdentifierToken));
1472 		constructors.add(Constructor.create(iProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1473 		
1474 		// equals
1475 		final Model expected = Model.create(group1IdentifierToken);
1476 		expected.addGroup(group1);
1477 		
1478 		this.parser = Parser.create(output);
1479 		final Model actual = this.parser.parse();
1480 		
1481 		assertEquals(0, this.parser.getExceptions().size());
1482 		assertEquals(expected, actual);
1483 		
1484 	}
1485 	
1486 	/**
1487 	 * Group1:group=[S1A:class={};S2A:class={};A:class=S1A+S2A+{();};];.
1488 	 * 
1489 	 * @throws Exception
1490 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1491 	 */
1492 	@Test
1493 	public void testConstructorWithoutParameterAndManySuperclassesWithoutParameter() throws Exception {
1494 		final SimpleScannerInput input =
1495 				new SimpleScannerInput("Group1:group=[S1A:class={};S2A:class={};A:class=S1A+S2A+{();};];");
1496 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1497 		final Scanner scanner = ModelDslScanner.create();
1498 		scanner.scan(input, output);
1499 		
1500 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1501 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1502 		final IdentifierToken s1aIdentifierToken = IdentifierToken.create("S1A", Position.create("", 1, 1, 0));
1503 		final IdentifierToken s2aIdentifierToken = IdentifierToken.create("S2A", Position.create("", 1, 1, 0));
1504 		
1505 		final Vector<GroupElement> group1Vector = new Vector<>();
1506 		final Vector<Constructor> constructors = new Vector<>();
1507 		
1508 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1509 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1510 		
1511 		final Name aName = group1Name.addName(aIdentifierToken);
1512 		final Name s1aName = group1Name.addName(s1aIdentifierToken);
1513 		final Name s2aName = group1Name.addName(s2aIdentifierToken);
1514 		
1515 		final Vector<Type> supertypes = new Vector<>();
1516 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(s1aIdentifierToken))));
1517 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(s2aIdentifierToken))));
1518 		
1519 		final ClassType s1aClass =
1520 				RegularClassType.create(
1521 						s1aName,
1522 						new Vector<ClassModifier>(),
1523 						new Vector<Attribute>(),
1524 						new Vector<Type>(),
1525 						new Vector<Operation>(),
1526 						new Vector<Constructor>(),
1527 						s1aIdentifierToken,
1528 						
1529 						new Vector<ClassType>());
1530 		
1531 		final ClassType s2aClass =
1532 				RegularClassType.create(
1533 						s2aName,
1534 						new Vector<ClassModifier>(),
1535 						new Vector<Attribute>(),
1536 						new Vector<Type>(),
1537 						new Vector<Operation>(),
1538 						new Vector<Constructor>(),
1539 						s2aIdentifierToken,
1540 						
1541 						new Vector<ClassType>());
1542 		
1543 		final ClassType aClass =
1544 				RegularClassType.create(
1545 						aName,
1546 						new Vector<ClassModifier>(),
1547 						new Vector<Attribute>(),
1548 						supertypes,
1549 						new Vector<Operation>(),
1550 						constructors,
1551 						aIdentifierToken,
1552 						
1553 						new Vector<ClassType>());
1554 		group1Vector.add(s1aClass);
1555 		group1Vector.add(s2aClass);
1556 		group1Vector.add(aClass);
1557 		
1558 		final ProductType aProduct = ProductType.create(this.bracketOpenToken);
1559 		constructors.add(Constructor.create(aProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1560 		
1561 		// equals
1562 		final Model expected = Model.create(group1IdentifierToken);
1563 		expected.addGroup(group1);
1564 		
1565 		this.parser = Parser.create(output);
1566 		final Model actual = this.parser.parse();
1567 		
1568 		assertEquals(0, this.parser.getExceptions().size());
1569 		assertEquals(expected, actual);
1570 	}
1571 	
1572 	/**
1573 	 * Group1:group=[S1A:class={};S2A:class={};A:class=S1A+S2A+{(i:Integer);};];.
1574 	 * 
1575 	 * @throws Exception
1576 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1577 	 */
1578 	@Test
1579 	public void testConstructorWithParameterAndManySuperclassesWithoutParameter() throws Exception {
1580 		final SimpleScannerInput input =
1581 				new SimpleScannerInput("Group1:group=[S1A:class={};S2A:class={};A:class=S1A+S2A+{(i:Integer);};];");
1582 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1583 		final Scanner scanner = ModelDslScanner.create();
1584 		scanner.scan(input, output);
1585 		
1586 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1587 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1588 		final IdentifierToken s1aIdentifierToken = IdentifierToken.create("S1A", Position.create("", 1, 1, 0));
1589 		final IdentifierToken s2aIdentifierToken = IdentifierToken.create("S2A", Position.create("", 1, 1, 0));
1590 		final IdentifierToken iIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 0));
1591 		
1592 		final Vector<GroupElement> group1Vector = new Vector<>();
1593 		final Vector<Constructor> constructors = new Vector<>();
1594 		
1595 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1596 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1597 		
1598 		final Name aName = group1Name.addName(aIdentifierToken);
1599 		final Name s1aName = group1Name.addName(s1aIdentifierToken);
1600 		final Name s2aName = group1Name.addName(s2aIdentifierToken);
1601 		
1602 		final Vector<Type> supertypes = new Vector<>();
1603 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(s1aIdentifierToken))));
1604 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(s2aIdentifierToken))));
1605 		
1606 		final ClassType s1aClass =
1607 				RegularClassType.create(
1608 						s1aName,
1609 						new Vector<ClassModifier>(),
1610 						new Vector<Attribute>(),
1611 						new Vector<Type>(),
1612 						new Vector<Operation>(),
1613 						new Vector<Constructor>(),
1614 						s1aIdentifierToken,
1615 						
1616 						new Vector<ClassType>());
1617 		
1618 		final ClassType s2aClass =
1619 				RegularClassType.create(
1620 						s2aName,
1621 						new Vector<ClassModifier>(),
1622 						new Vector<Attribute>(),
1623 						new Vector<Type>(),
1624 						new Vector<Operation>(),
1625 						new Vector<Constructor>(),
1626 						s2aIdentifierToken,
1627 						
1628 						new Vector<ClassType>());
1629 		
1630 		final ClassType aClass =
1631 				RegularClassType.create(
1632 						aName,
1633 						new Vector<ClassModifier>(),
1634 						new Vector<Attribute>(),
1635 						supertypes,
1636 						new Vector<Operation>(),
1637 						constructors,
1638 						aIdentifierToken,
1639 						
1640 						new Vector<ClassType>());
1641 		group1Vector.add(s1aClass);
1642 		group1Vector.add(s2aClass);
1643 		group1Vector.add(aClass);
1644 		
1645 		// constructors
1646 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1647 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
1648 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1649 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iIdentifierToken));
1650 		constructors.add(Constructor.create(iProduct, aClass, new Vector<ConstructorReference>(), aIdentifierToken));
1651 		// equals
1652 		final Model expected = Model.create(group1IdentifierToken);
1653 		expected.addGroup(group1);
1654 		
1655 		this.parser = Parser.create(output);
1656 		final Model actual = this.parser.parse();
1657 		
1658 		assertEquals(0, this.parser.getExceptions().size());
1659 		assertEquals(expected, actual);
1660 		
1661 	}
1662 	
1663 	/**
1664 	 * Group1:group=[SA:class={(i:Integer);};A:class=SA+{();};];.
1665 	 * 
1666 	 * @throws Exception
1667 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1668 	 */
1669 	@Test
1670 	public void testConstructorWithoutParameterAndSuperclassWithParameter() throws Exception {
1671 		final SimpleScannerInput input =
1672 				new SimpleScannerInput("Group1:group=[SA:class={(i:Integer);};A:class=SA+{};];");
1673 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1674 		final Scanner scanner = ModelDslScanner.create();
1675 		scanner.scan(input, output);
1676 		
1677 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1678 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1679 		final IdentifierToken saIdentifierToken = IdentifierToken.create("SA", Position.create("", 1, 1, 0));
1680 		final IdentifierToken iIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 0));
1681 		
1682 		final Vector<GroupElement> group1Vector = new Vector<>();
1683 		final Vector<Constructor> constructors = new Vector<>();
1684 		
1685 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1686 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1687 		
1688 		final Name aName = group1Name.addName(aIdentifierToken);
1689 		final Name saName = group1Name.addName(saIdentifierToken);
1690 		
1691 		final Vector<Type> supertypes = new Vector<>();
1692 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(saIdentifierToken))));
1693 		
1694 		final ClassType saClass =
1695 				RegularClassType.create(
1696 						saName,
1697 						new Vector<ClassModifier>(),
1698 						new Vector<Attribute>(),
1699 						new Vector<Type>(),
1700 						new Vector<Operation>(),
1701 						constructors,
1702 						saIdentifierToken,
1703 						
1704 						new Vector<ClassType>());
1705 		
1706 		final ClassType aClass =
1707 				RegularClassType.create(
1708 						aName,
1709 						new Vector<ClassModifier>(),
1710 						new Vector<Attribute>(),
1711 						supertypes,
1712 						new Vector<Operation>(),
1713 						new Vector<Constructor>(),
1714 						aIdentifierToken,
1715 						
1716 						new Vector<ClassType>());
1717 		group1Vector.add(saClass);
1718 		group1Vector.add(aClass);
1719 		
1720 		// constructors
1721 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1722 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
1723 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1724 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iIdentifierToken));
1725 		constructors.add(Constructor.create(iProduct, saClass, new Vector<ConstructorReference>(), saIdentifierToken));
1726 		// equals
1727 		final Model expected = Model.create(group1IdentifierToken);
1728 		expected.addGroup(group1);
1729 		
1730 		this.parser = Parser.create(output);
1731 		
1732 		assertEquals(0, this.parser.getExceptions().size());
1733 		
1734 		final Model actual = this.parser.parse();
1735 		
1736 		assertEquals(0, this.parser.getExceptions().size());
1737 		assertEquals(expected, actual);
1738 		
1739 	}
1740 	
1741 	/**
1742 	 * Group1:group=[SA1:class={(i:Integer);};SA2:class={(i:Integer);};A:class=SA1+SA2+{(i:Integer)=SA1(Integer)+SA2(
1743 	 * Integer);};];.
1744 	 * 
1745 	 * @throws Exception
1746 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1747 	 */
1748 	@Test
1749 	public void testConstructorWithParameterDelegatesParameterToManySuperclassesWithParameter() throws Exception {
1750 		final SimpleScannerInput input =
1751 				new SimpleScannerInput("Group1:group=[SA1:class={(i:Integer);};SA2:class={(i:Integer);};"
1752 						+ "A:class=SA1+SA2+{(i:Integer)=SA1(Integer)+SA2(Integer);};];");
1753 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1754 		final Scanner scanner = ModelDslScanner.create();
1755 		scanner.scan(input, output);
1756 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1757 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1758 		final IdentifierToken iIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 0));
1759 		final IdentifierToken sa1IdentifierToken = IdentifierToken.create("SA1", Position.create("", 1, 1, 0));
1760 		final IdentifierToken sa2IdentifierToken = IdentifierToken.create("SA2", Position.create("", 1, 1, 0));
1761 		
1762 		final Vector<GroupElement> group1Vector = new Vector<>();
1763 		final Vector<Constructor> constructors1 = new Vector<>();
1764 		final Vector<Constructor> constructors2 = new Vector<>();
1765 		
1766 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1767 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1768 		final Name aName = group1Name.addName(aIdentifierToken);
1769 		
1770 		final Name sa1Name = group1Name.addName(sa1IdentifierToken);
1771 		final Name sa2Name = group1Name.addName(sa2IdentifierToken);
1772 		
1773 		final Vector<Type> supertypes = new Vector<>();
1774 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(sa1IdentifierToken))));
1775 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(sa2IdentifierToken))));
1776 		
1777 		final ClassType sa1Class =
1778 				RegularClassType.create(
1779 						sa1Name,
1780 						new Vector<ClassModifier>(),
1781 						new Vector<Attribute>(),
1782 						new Vector<Type>(),
1783 						new Vector<Operation>(),
1784 						constructors1,
1785 						sa1IdentifierToken,
1786 						
1787 						new Vector<ClassType>());
1788 		final ClassType sa2Class =
1789 				RegularClassType.create(
1790 						sa2Name,
1791 						new Vector<ClassModifier>(),
1792 						new Vector<Attribute>(),
1793 						new Vector<Type>(),
1794 						new Vector<Operation>(),
1795 						constructors1,
1796 						sa2IdentifierToken,
1797 						
1798 						new Vector<ClassType>());
1799 		
1800 		final ClassType aClass =
1801 				RegularClassType.create(
1802 						aName,
1803 						new Vector<ClassModifier>(),
1804 						new Vector<Attribute>(),
1805 						supertypes,
1806 						new Vector<Operation>(),
1807 						constructors2,
1808 						aIdentifierToken,
1809 						
1810 						new Vector<ClassType>());
1811 		group1Vector.add(sa1Class);
1812 		group1Vector.add(sa2Class);
1813 		
1814 		group1Vector.add(aClass);
1815 		
1816 		final List<ConstructorReference> references = new Vector<>();
1817 		final List<Type> paramTypes = new Vector<>();
1818 		
1819 		final ByNameState sa1ClassName = ByNameState.create(UnqualifiedName.create(sa1IdentifierToken));
1820 		final ByNameState sa2ClassName = ByNameState.create(UnqualifiedName.create(sa2IdentifierToken));
1821 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1822 		
1823 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
1824 		final TypeProxy sa1ClassTypeProxy = TypeProxy.create(sa1IdentifierToken, sa1ClassName);
1825 		final TypeProxy sa2ClassTypeProxy = TypeProxy.create(sa2IdentifierToken, sa2ClassName);
1826 		
1827 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1828 		constructors1.add(Constructor.create(
1829 				iProduct,
1830 				sa2Class,
1831 				new Vector<ConstructorReference>(),
1832 				this.bracketOpenToken));
1833 		constructors2.add(Constructor.create(iProduct, aClass, references, this.bracketOpenToken));
1834 		
1835 		references.add(ConstructorReference.create(ConstructorByTypeAndSignatureState.create(
1836 				sa1ClassTypeProxy,
1837 				paramTypes)));
1838 		references.add(ConstructorReference.create(ConstructorByTypeAndSignatureState.create(
1839 				sa2ClassTypeProxy,
1840 				paramTypes)));
1841 		paramTypes.add(integerTypeProxy);
1842 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iIdentifierToken));
1843 		
1844 		final Model expected = Model.create(group1IdentifierToken);
1845 		expected.addGroup(group1);
1846 		
1847 		this.parser = Parser.create(output);
1848 		final Model actual = this.parser.parse();
1849 		
1850 		assertEquals(0, this.parser.getExceptions().size());
1851 		assertEquals(expected, actual);
1852 		
1853 	}
1854 	
1855 	/**
1856 	 * Group1:group=[SA1:class={(i:Integer);};A:class=SA1+{(i:Integer)=SA1(Integer);};];.
1857 	 * 
1858 	 * @throws Exception
1859 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1860 	 * 
1861 	 */
1862 	@Test
1863 	public void testConstructorWithParameterDelegatesParameterToOneSuperclassWithParameter() throws Exception {
1864 		final SimpleScannerInput input =
1865 				new SimpleScannerInput(
1866 						"Group1:group=[SA1:class={(i:Integer);};A:class=SA1+{(i:Integer)=SA1(Integer);};];");
1867 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1868 		final Scanner scanner = ModelDslScanner.create();
1869 		scanner.scan(input, output);
1870 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1871 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1872 		final IdentifierToken iIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 0));
1873 		final IdentifierToken sa1IdentifierToken = IdentifierToken.create("SA1", Position.create("", 1, 1, 0));
1874 		
1875 		final Vector<GroupElement> group1Vector = new Vector<>();
1876 		final Vector<Constructor> constructors1 = new Vector<>();
1877 		final Vector<Constructor> constructors2 = new Vector<>();
1878 		
1879 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1880 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1881 		final Name aName = group1Name.addName(aIdentifierToken);
1882 		
1883 		final Name sa1Name = group1Name.addName(sa1IdentifierToken);
1884 		
1885 		final Vector<Type> supertypes = new Vector<>();
1886 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(sa1IdentifierToken))));
1887 		
1888 		final ClassType sa1Class =
1889 				RegularClassType.create(
1890 						sa1Name,
1891 						new Vector<ClassModifier>(),
1892 						new Vector<Attribute>(),
1893 						new Vector<Type>(),
1894 						new Vector<Operation>(),
1895 						constructors1,
1896 						sa1IdentifierToken,
1897 						
1898 						new Vector<ClassType>());
1899 		
1900 		final ClassType aClass =
1901 				RegularClassType.create(
1902 						aName,
1903 						new Vector<ClassModifier>(),
1904 						new Vector<Attribute>(),
1905 						supertypes,
1906 						new Vector<Operation>(),
1907 						constructors2,
1908 						aIdentifierToken,
1909 						
1910 						new Vector<ClassType>());
1911 		group1Vector.add(sa1Class);
1912 		group1Vector.add(aClass);
1913 		
1914 		final List<ConstructorReference> references = new Vector<>();
1915 		final List<Type> paramTypes = new Vector<>();
1916 		
1917 		final ByNameState sa1ClassName = ByNameState.create(UnqualifiedName.create(sa1IdentifierToken));
1918 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1919 		
1920 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
1921 		final TypeProxy sa1ClassTypeProxy = TypeProxy.create(sa1IdentifierToken, sa1ClassName);
1922 		
1923 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1924 		constructors1.add(Constructor.create(
1925 				iProduct,
1926 				sa1Class,
1927 				new Vector<ConstructorReference>(),
1928 				this.bracketOpenToken));
1929 		constructors2.add(Constructor.create(iProduct, aClass, references, this.bracketOpenToken));
1930 		
1931 		references.add(ConstructorReference.create(ConstructorByTypeAndSignatureState.create(
1932 				sa1ClassTypeProxy,
1933 				paramTypes)));
1934 		paramTypes.add(integerTypeProxy);
1935 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iIdentifierToken));
1936 		
1937 		final Model expected = Model.create(group1IdentifierToken);
1938 		expected.addGroup(group1);
1939 		
1940 		this.parser = Parser.create(output);
1941 		final Model actual = this.parser.parse();
1942 		
1943 		assertEquals(0, this.parser.getExceptions().size());
1944 		assertEquals(expected, actual);
1945 	}
1946 	
1947 	/**
1948 	 * Group1:group=[A:class=SA+{(i:Integer)=SA(Integer);};];.
1949 	 * 
1950 	 * @throws Exception
1951 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
1952 	 */
1953 	@Test
1954 	public void testConstructorWithoutParameterCallEmptySuperConstructorsWhichNotExist() throws Exception {
1955 		final SimpleScannerInput input =
1956 				new SimpleScannerInput("Group1:group=[A:class=SA+{(i:Integer)=SA(Integer);};];");
1957 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
1958 		final Scanner scanner = ModelDslScanner.create();
1959 		scanner.scan(input, output);
1960 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
1961 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
1962 		final IdentifierToken iIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 0));
1963 		final IdentifierToken saIdentifierToken = IdentifierToken.create("SA", Position.create("", 1, 1, 0));
1964 		
1965 		final Vector<GroupElement> group1Vector = new Vector<>();
1966 		final Vector<Constructor> constructors = new Vector<>();
1967 		
1968 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
1969 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
1970 		final Name aName = group1Name.addName(aIdentifierToken);
1971 		final Vector<Type> supertypes = new Vector<>();
1972 		supertypes.add(TypeProxy.create(null, ByNameState.create(UnqualifiedName.create(saIdentifierToken))));
1973 		final ClassType aClass =
1974 				RegularClassType.create(
1975 						aName,
1976 						new Vector<ClassModifier>(),
1977 						new Vector<Attribute>(),
1978 						supertypes,
1979 						new Vector<Operation>(),
1980 						constructors,
1981 						aIdentifierToken,
1982 						
1983 						new Vector<ClassType>());
1984 		group1Vector.add(aClass);
1985 		
1986 		final List<ConstructorReference> references = new Vector<>();
1987 		final List<Type> paramTypes = new Vector<>();
1988 		
1989 		final ByNameState saClassName = ByNameState.create(UnqualifiedName.create(saIdentifierToken));
1990 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
1991 		
1992 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
1993 		final TypeProxy saClassTypeProxy = TypeProxy.create(saIdentifierToken, saClassName);
1994 		
1995 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
1996 		constructors.add(Constructor.create(iProduct, aClass, references, this.bracketOpenToken));
1997 		references.add(ConstructorReference.create(ConstructorByTypeAndSignatureState.create(
1998 				saClassTypeProxy,
1999 				paramTypes)));
2000 		paramTypes.add(integerTypeProxy);
2001 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iIdentifierToken));
2002 		
2003 		final Model expected = Model.create(group1IdentifierToken);
2004 		expected.addGroup(group1);
2005 		
2006 		this.parser = Parser.create(output);
2007 		final Model actual = this.parser.parse();
2008 		
2009 		assertEquals(0, this.parser.getExceptions().size());
2010 		assertEquals(expected, actual);
2011 	}
2012 	
2013 	/**
2014 	 * Group1:group=[A:class={(i:Integer)=A(String);};];.
2015 	 * 
2016 	 * @throws Exception
2017 	 *             {@link de.fhdw.wtf.common.exception.parser.NoValidTokenStreamException}
2018 	 */
2019 	@Test
2020 	public void testConstructorCallsConstructorWhichNotExist() throws Exception {
2021 		final SimpleScannerInput input = new SimpleScannerInput("Group1:group=[A:class={(i:Integer)=A(String);};];");
2022 		final VerboseTokenStream output = new VerboseTokenStream(SimpleTokenStream.create());
2023 		final Scanner scanner = ModelDslScanner.create();
2024 		scanner.scan(input, output);
2025 		final IdentifierToken group1IdentifierToken = IdentifierToken.create("Group1", Position.create("", 1, 1, 0));
2026 		final IdentifierToken aIdentifierToken = IdentifierToken.create("A", Position.create("", 1, 1, 0));
2027 		final IdentifierToken iIdentifierToken = IdentifierToken.create("i", Position.create("", 1, 1, 0));
2028 		
2029 		final Vector<GroupElement> group1Vector = new Vector<>();
2030 		final Vector<Constructor> constructors = new Vector<>();
2031 		
2032 		final Name group1Name = UnqualifiedName.create(group1IdentifierToken);
2033 		final Group group1 = Group.create(group1Name, group1Vector, group1IdentifierToken);
2034 		final Name aName = group1Name.addName(aIdentifierToken);
2035 		
2036 		final ClassType aClass =
2037 				RegularClassType.create(
2038 						aName,
2039 						new Vector<ClassModifier>(),
2040 						new Vector<Attribute>(),
2041 						new Vector<Type>(),
2042 						new Vector<Operation>(),
2043 						constructors,
2044 						aIdentifierToken,
2045 						
2046 						new Vector<ClassType>());
2047 		group1Vector.add(aClass);
2048 		
2049 		final List<ConstructorReference> references = new Vector<>();
2050 		final List<Type> paramTypes = new Vector<>();
2051 		
2052 		final ByNameState integerName = ByNameState.create(UnqualifiedName.create(this.integerIdentifier));
2053 		final ByNameState stringNameState = ByNameState.create(UnqualifiedName.create(this.stringIdentifier));
2054 		final ByNameState aNameState = ByNameState.create(UnqualifiedName.create(aIdentifierToken));
2055 		
2056 		final TypeProxy aTypeProxy = TypeProxy.create(aIdentifierToken, aNameState);
2057 		final TypeProxy integerTypeProxy = TypeProxy.create(this.integerIdentifier, integerName);
2058 		final TypeProxy stringTypeProxy = TypeProxy.create(this.stringIdentifier, stringNameState);
2059 		
2060 		final ProductType iProduct = ProductType.create(this.bracketOpenToken);
2061 		constructors.add(Constructor.create(iProduct, aClass, references, this.bracketOpenToken));
2062 		
2063 		references.add(ConstructorReference.create(ConstructorByTypeAndSignatureState.create(aTypeProxy, paramTypes)));
2064 		paramTypes.add(stringTypeProxy);
2065 		
2066 		iProduct.addElement(ProductElementType.create("i", integerTypeProxy, iIdentifierToken));
2067 		
2068 		final Model expected = Model.create(group1IdentifierToken);
2069 		expected.addGroup(group1);
2070 		
2071 		this.parser = Parser.create(output);
2072 		final Model actual = this.parser.parse();
2073 		
2074 		assertEquals(0, this.parser.getExceptions().size());
2075 		assertEquals(expected, actual);
2076 	}
2077 }