예제 #1
0
				writer.writeFunction(par.arg_1(),par.arg_2())

			elif if_type in cType:
				writer.writeIf(par.arg_1())

			elif goto_type in cType:
				writer.writeGoto(par.arg_1())

			elif lable_type in cType:
				writer.writeLabel(par.arg_1())

			elif call_type in cType:
				writer.writeCall(par.arg_1(),par.arg_2())

			elif ret_type in cType:
				writer.writeReturn()

	writer.Close()

#This is for a single file
else:
	writer = CodeWriter(out_file)
	writer.writeInit()
	writer.setFileName(out_file)


	par = Parser(in_file)
	while par.hasMoreCommands():
		par.advance()
		cType = par.commandType()