public void toMatchCode(){
		boolean debugPHP = false;
		int numOfTabs = 0;

			Set<State> states = this.getStates();
			Set<State> acceptStates = this.getAcceptStates();
			printCodeLine(numOfTabs, "<?php");
			numOfTabs++;
			printCodeLine(numOfTabs, "function stranger_match($str){");
			numOfTabs++;
			printCodeLine(numOfTabs, "$i = 0; $state = "+this.initial.id+";");
			printCodeLine(numOfTabs, "$char_buff = preg_split('//', $str, -1);");
			printCodeLine(numOfTabs, "while ($i < (sizeof($char_buff))){");
			numOfTabs++;
			if (debugPHP)
				printCodeLine(numOfTabs, "echo \"in state  =  \".$state.\"         char =  \".$char_buff[$i].\"<br>\";");
			printCodeLine(numOfTabs, "switch ($state){");
			numOfTabs++;
			for (State state : states){
				if (state.accept)
					acceptStates.add(state);
				printCodeLine(numOfTabs, "case "+state.id +":");
				numOfTabs++;
				boolean first = true;
				String ifStmt;
				for (Transition tr: state.transitions){
					if (first){
						first = false;
						ifStmt =  "if ";
					}else{
						ifStmt =  "} elseif ";
					}
					printCodeLine(numOfTabs, ifStmt + "($char_buff[$i] <= chr("+ ((int)tr.max) +") && $char_buff[$i] >= chr(" + ((int)tr.min) + ") ){ ");
					numOfTabs++;
					printCodeLine(numOfTabs, "$state = " + tr.to.id +";");
					numOfTabs--;
				}
				printCodeLine(numOfTabs, "}");
				printCodeLine(numOfTabs, "$i++;");
				printCodeLine(numOfTabs, "break;");
				numOfTabs--;
			}
			// end of switch
			numOfTabs--;
			printCodeLine(numOfTabs, "}");
			if (debugPHP)
				printCodeLine(numOfTabs, "echo \"out state  =  \".$state.\"<br>\";");
			// end of while
			numOfTabs--;
			printCodeLine(numOfTabs, "}");
			// building accept states array
			String temp = "$accept = array(";
			boolean first = true;
			for (State s: acceptStates){
				if(first)
					first = false;
				else
					temp += ", ";
				temp += s.id;
			}
			printCodeLine(numOfTabs, temp + ");");
			printCodeLine(numOfTabs, "return in_array($state, $accept);");
			numOfTabs--;
			// end of function
			printCodeLine(numOfTabs, "}");
			numOfTabs--;
			printCodeLine(numOfTabs, "?>");		
	}