Semantic Variable management focuses on the generation and assignment of different Variable id
s.
A Semantic Variable namespace is just a id
generator. Parrot ensures that Variable id
s will not have duplicate names within the same namespace. Overall, there are two kinds of namespaces in the Semantic Variable manager:
- Global namespace, a.k.a. the namespace for Constant Prefix variables.
- Local namespace of each
Session
.
The Semantic Variable manager is responsible for assigning a Semantic Variable to each node in a RequestChain
(See Graph). The manager has different treatments for different node types:
ConstantFill
: To ensure consistency in management, we have also assigned Semantic Variables to constant text (not just to input/output fields). Theid
of this type of nodes is generated by hashing the text content itself, so that text chunks with the same content can reuse the Semantic Variable.PlaceholderFill
: This type of nodes must be already bound to an existing variable!PlaceholderGen
: We randomly generate a uniqueid
(Hash by the givenvar_name
).