@Override
	public CodeLineList generateCode(Code relatedClass, Method relatedMethod,
			boolean forCodeGeneration) {
		if (this.getNumberOfChildren() == 1) {
			return this.getChild(0).generateCode(relatedClass, relatedMethod,
					true);
		}
		passNodeFieldsToTheParentNode();
		Token token = this.firstToken;
		switch (token.kind) {
		case PseuCoParser.INT:
			HashSet<Integer> set = new HashSet<Integer>();
			set.add(token.beginLine);
			set.add(token.endLine);
			return new CodeLineList(new CodeLine("int", set));
		case PseuCoParser.STRING:
			set = new HashSet<Integer>();
			set.add(token.beginLine);
			set.add(token.endLine);
			return new CodeLineList(new CodeLine("String", set));
		case PseuCoParser.BOOL:
			set = new HashSet<Integer>();
			set.add(token.beginLine);
			set.add(token.endLine);
			return new CodeLineList(new CodeLine("boolean", set));
		case PseuCoParser.LOCK:
			relatedClass.addImport(new CodeLine(
					"java.util.concurrent.locks.ReentrantLock", -2));
			set = new HashSet<Integer>();
			set.add(token.beginLine);
			set.add(token.endLine);
			return new CodeLineList(new CodeLine("ReentrantLock", set));
		case PseuCoParser.AGENT:
			set = new HashSet<Integer>();
			set.add(token.beginLine);
			set.add(token.endLine);
			return new CodeLineList(new CodeLine("PseuCoThread", set));
		case PseuCoParser.IDENTIFIER: // structType or monitorType
			String firstL = this.firstToken.image.substring(0, 1);
			String structType = this.firstToken.image.replaceFirst(firstL,
					firstL.toUpperCase());
			MainCodeGen.throwNoASCII(structType, this.firstToken.beginLine);
			set = new HashSet<Integer>();
			set.add(token.beginLine);
			set.add(token.endLine);
			return new CodeLineList(new CodeLine(structType, set));
		default:
			return null;
		}
	}