Skip to content

Resolving Templates

Andrei Tumbar edited this page Sep 24, 2026 · 1 revision

For implementation, see ResolveTemplates.scala.

This algorithm enters the symbols of a source model and expands its template expansion specifiers. Each tool runs it on the translation units produced by resolving include specifiers, and then runs semantic checking on the result.

Input

  1. An analysis data structure a.

  2. A list tul of translation units.

Output

  1. An updated analysis data structure a with symbols entered, the use-def map filled in for template names, and the template expansion map filled in.

  2. A list tul' of translation units with state enums added and templates expanded.

  3. Otherwise an error and no output.

Procedure

  1. Add state enums for tul, yielding a new list of translation units tul in which each state machine definition that has a body has a state enum definition.

  2. Enter symbols for a and tul.

  3. Check template uses for a and tul.

  4. Expand templates for a and tul, yielding a new list of translation units tul in which each template expansion specifier carries the members that it expands.

  5. Enter template symbols for a and tul.

Clone this wiki locally