public void prolog(ASTNode n) {
		if(n instanceof VarDeclList || n instanceof StmtList){
			return;
		}
		//create a unique id for each node
		String unique = "\"" + n.toString() +i+"\"";
		try {
			File file = null;
			name = name.replace(".e","");
			if(index != -1) {
				file = new File("./" + name + index + ".dot");
			}else {
				file = new File("./" + name + ".dot");
			}
			FileWriter fw = null; 
			BufferedWriter bw = null;
			boolean exists = false;
			
			//file already exists and we are at the beginning -> overwrites the existing file
			if(file.exists() && n.getClassName().compareTo("Program")==0) {
				fw = new FileWriter(file.getAbsoluteFile());
				bw = new BufferedWriter(fw);
				String begin = "digraph ast { \n";
				bw.append(begin);
				bw.flush();
			}
			// if file doesn't exist, then create it
			if (!(file.exists())) {
				exists = true;
				file.createNewFile();
				fw = new FileWriter(file.getAbsoluteFile(),true);
				bw = new BufferedWriter(fw);
				String begin = "digraph ast { \n";
				bw.append(begin);
				bw.flush();
			}
			if(!exists){
				fw = new FileWriter(file.getAbsoluteFile(),true);
				bw = new BufferedWriter(fw);
			}
			bw.append(unique + "[label=\""+n.toString()+"\"]; \n");
			if(n.getClassName().compareTo("Program")!=0){
			int size = list.size();
			bw.append(list.get(size-1)+"->"+unique+"; \n");
			}
			bw.flush();
			list.add(unique);
			i++;
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}