43. AST type ussage collection
The ast_used module implements type collecting infrasturcture. It allows to determine, if enumeration and structure types are used in the code.
All functions and symbols are in “ast_used” module, use require to get access to it.
require daslib/ast_used
43.1. Structures
- OnlyUsedTypes
Collection of all structure and enumeration types that are used in the AST.
- Fields
st : table< Structure ?;void> - all structure types used
en : table< Enumeration ?;void> - all enumeration types used
43.2. Collecting type information
- collect_used_types(vfun: array<Function?>; vvar: array<Variable?>; blk: block<(usedTypes:OnlyUsedTypes):void>)
Goes through list of functions vfun and variables vvar and collects list of which enumeration and structure types are used in them. Calls blk with said list.
- Arguments
vfun : array< Function ?>
vvar : array< Variable ?>
blk : block<(usedTypes: OnlyUsedTypes ):void>