public String compile(String text) {

		vars = new HashMap<String, Variable>();
		Variable.reset();

		String code = text;
		code = code.replaceAll("(?m)//(.*?)$", "");
		code = code.replaceAll("(?m)\\n", ";");
		code = code.replaceAll("(?m)\\r", "");
		code = code.replaceAll("/\\*(.*?)\\*/", "");
		code = code.replaceAll("(?m)\\s+", " ");
		code = code.replaceAll(";+", ";");

		//code = code.replaceAll("(?m);\\s(.*?)", ";");
		//code = code.replaceAll("(?m)^(int|boolean|long)\\s+?(([a-zA-Z]+?)[a-zA-Z0-9]*?);$", "$1,$2;");

		String[] commands = code.split(";");
		ArrayList<String> opcode = new ArrayList<String>();
		for (String part : commands) {
			ArrayList<String> linecode = new ArrayList<String>();
			Pattern patternDeclare = Pattern.compile("^(int|boolean|long)\\s+?(" + REGEX_VAR + ")$");
			Matcher matcherDeclare = patternDeclare.matcher(part);
			Pattern patternAssignment = Pattern.compile("^(" + REGEX_VAR + ")\\s*?=\\s*?(" + REGEX_VARORVALUE + ")$");
			Matcher matcherAssignment = patternAssignment.matcher(part);
			Pattern patternDecAndAss = Pattern.compile("^(int|boolean|long)\\s+?(" + REGEX_VAR + ")\\s*?=\\s*?(" + REGEX_VALUE + ")$");
			Matcher matcherDecAndAss = patternDecAndAss.matcher(part);
			try {
				if (matcherDeclare.matches()) {
					linecode = compileDeclaration(matcherDeclare.group(1), matcherDeclare.group(2));
				} else if (matcherAssignment.matches()) {
					linecode = compileAssignment(matcherAssignment.group(1), matcherAssignment.group(2));
				} else if (matcherDecAndAss.matches()) {
					linecode = compileDeclaration(matcherDecAndAss.group(1), matcherDecAndAss.group(2));
					linecode = compileAssignment(matcherDecAndAss.group(2), matcherDecAndAss.group(3));
				} else {
					System.out.println("Syntaxfehler: " + part + ";");
					//throw new MCCSyntaxException();
				}
			} catch (Exception e) {
				e.printStackTrace();
				System.out.println("Fehler beim kompilieren.");
			}
			if (linecode != null) for (String s : linecode) {
				opcode.add(s);
			}
		}
		System.out.println("---------- opcode ----------");
		System.out.println(opcode.toString());
		System.out.println("---------- fertig ----------");

		return code;
	}