Skip to content

Instantly share code, notes, and snippets.

@spoenemann
Created May 24, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spoenemann/29f42642c83d9e5dea1a0e964054bc37 to your computer and use it in GitHub Desktop.
Save spoenemann/29f42642c83d9e5dea1a0e964054bc37 to your computer and use it in GitHub Desktop.
Entry method of the example code generator with tracing
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
val model = resource.contents.head as Model
val baseName = resource.baseName
fsa.generateTracedFile(baseName + '.h', model, '''
/********************************
* Header file for «resource.URI.lastSegment»
*/
#ifndef «baseName.toUpperCase»_H
#define «baseName.toUpperCase»_H
«FOR c : model.types»
«generateHeader(c)»
«ENDFOR»
#endif
''')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment