private static Structure parseHeader(CallParser parser) {
		ParseError.validate(parser.size() > 2, parser.firstCall().lineN, "Malformed callable header");
		ParseError.validate(parser.get(0).qualifiesAsKeyword(), parser.firstCall().lineN, "Malformed callable header");
		ParseError.validate(parser.get(1).qualifiesAsKeyword(), parser.firstCall().lineN, "Malformed callable header");
		
		ExecutionMode em = null;
		
		if (parser.get(0).callName.equals("instantiated")) { // TODO switch block
			em = ExecutionMode.INSTANTIATED;
		} else if (parser.get(0).callName.equals("static")) {
			em = ExecutionMode.STATIC;
		} else if (parser.get(0).callName.equals("inline")) {
			em = ExecutionMode.INLINE;
		}
		
		ParseError.validate(em != null, parser.firstCall().lineN, "Malformed callable header (no ExecutionMode indicated)");
		
		RunMode rm = null;
		
		if (parser.get(1).callName.equals("parallel")) {
			rm = RunMode.PARALLEL;
		} else if (parser.get(1).callName.equals("sequence")) {
			rm = RunMode.SEQUENTIAL;
		}
		
		ParseError.validate(rm != null, parser.firstCall().lineN, "Malformed callable header (no RunMode indicated)");
		
		ParsedCall call = parser.get(2);
		parser.removeFirstN(3); // Remove the two keywords and the declaration
		
		StructInput[] inputNodes = new StructInput[call.inParams.length];
		StructOutput[] outputNodes = new StructOutput[call.outParams.length];
		for (int i = 0; i < call.inParams.length; i++) {
			inputNodes[i] = new StructInput(call.inParams[i], inputNodes, call.lineN);
		}
		for (int i = 0; i < call.outParams.length; i++) {
			outputNodes[i] = new StructOutput(call.outParams[i], inputNodes, call.lineN);
		}
		return new Structure(em, rm, inputNodes, outputNodes, call.callName, call.lineN);
	}