예제 #1
0
def main():
	utils.out_code(INITIAL_CODE)

	if len(argv) <= 1:
		utils.error("Not enougth argument")

	for i in range(1, len(argv)):
		start_gen(argv[i])

	utils.out_code(END_CODE)
	stdout.flush()
예제 #2
0
def start_gen(file_name):
	try:
		f = open(file_name, "r")
	except:
		utils.error("Cannot open %s" % file_name)
	utils.out_code(SET_OUT_CODE % file_name)
	for l in f:
		start_index = l.find(COMMENT_START)
		if start_index >= 0:
			if start_index > 0:
				utils.out_text(l[:start_index])
			l = _exec_comment(f, _parse_comment(f, l[start_index:]), 0)
		utils.out_text(l)
예제 #3
0
def _code_generator(code):
	for c in code:
		utils.out_code(c)