- with open( filename ) as file:
- data = file.read()
-
- tokenSequence = tokenize( data )
- print ( pformat( tokenSequence ) ) # Display tokenization
- tree = parse( tokenSequence )
- #print ( tree )
- print ( variable_dict )
- print ( capabilities_dict )
-
- # TODO Move
- #macros_map.usbCodeToCapability( backend.usbCodeCapability() )
- backend.process( capabilities_dict )
+ processKLLFile( filename )
+ # Apply assignment cache, see 5.1.2 USB Codes for why this is necessary
+ macros_map.replayCachedAssignments()
+
+ # Iterate through additional layers
+ for partial in partialFileSets:
+ # Increment layer for each -p option
+ macros_map.addLayer()
+ # Iterate and process each of the file in the layer
+ for filename in partial:
+ processKLLFile( filename )
+ # Apply assignment cache, see 5.1.2 USB Codes for why this is necessary
+ macros_map.replayCachedAssignments()
+ # Remove un-marked keys to complete the partial layer
+ macros_map.removeUnmarked()
+
+ # Do macro correlation and transformation
+ macros_map.generate()
+
+ # Process needed templating variables using backend
+ backend.process( capabilities_dict, macros_map )
+
+ # Generate output file using template and backend
+ backend.generate( output )