aboutsummaryrefslogtreecommitdiff
path: root/gen_c_scheme.py
blob: 58c2dcc6d39dd8aae451c0c5e53a89d15b0abdaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

import sys,string

file=open(sys.argv[1],"r")

while 1:
    line=""
    while line=="" or line=="\n" or line[0:1]==";":
        line=file.readline()
        if line=="":
            file.close()
            sys.exit(0)
    line=string.replace(line[:-1],'\\','\\\\')
    sys.stdout.write('"'+string.replace(line,'"','\\"')+'\\n"\n')