Changeset 526a993 in buchla-68k for misc/gen-x.py
- Timestamp:
- 07/10/2017 07:25:34 PM (7 years ago)
- Branches:
- master
- Children:
- 2340de6
- Parents:
- e877e55
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/gen-x.py
re877e55 r526a993 149 149 dest[decl.name] = alig + " ".join(toks) + ";" 150 150 151 if len(vars) == 0 and len(funs) == 0: 152 continue 153 151 154 file = path.split("/")[-1] 152 155 glob = [] 153 156 157 glob.append("/*") 158 glob.append(" =============================================================================") 159 glob.append("\t" + file + " -- external declarations") 160 glob.append(" =============================================================================") 161 glob.append("*/") 162 glob.append("") 163 164 glob.append("#pragma once") 165 glob.append("") 166 167 if len(incs) > 0: 168 for inc in sorted(incs): 169 glob.append("#include \"{}\"".format(inc)) 170 171 glob.append("") 172 154 173 if len(vars) > 0: 155 174 glob.append("/*") 156 175 glob.append(" =============================================================================") 157 glob.append("\t " + file + " -- global variables")176 glob.append("\texternal variables") 158 177 glob.append(" =============================================================================") 159 178 glob.append("*/") … … 168 187 glob.append("/*") 169 188 glob.append(" =============================================================================") 170 glob.append("\t " + file + " -- global functions")189 glob.append("\texternal functions") 171 190 glob.append(" =============================================================================") 172 191 glob.append("*/") … … 178 197 glob.append("") 179 198 180 if len(glob) == 0:181 continue182 183 head = []184 head.append("#pragma once")185 head.append("")186 187 if len(incs) > 0:188 for inc in sorted(incs):189 head.append("#include \"{}\"".format(inc))190 191 head.append("")192 193 glob = head + glob194 195 199 with open(path[:-2] + ".x", "w") as f: 196 200 f.write("\n".join(glob))
Note:
See TracChangeset
for help on using the changeset viewer.