The DCT
kind of grammar component
is used at run time to represent dictionaries (i.e. environments) inside the Pico
evaluator. Each DCT
-like grammar component has 3 children: a name,
its associated value and a link to another dictionary. The latter can e.g. be
the lexical scope. Hence, these dictionary components are actually linked lists
of (name,value)-pairs. In other words, the Pico environment system can be thought
of as a system of association lists. Given a dictionary dd
, then
its name field is accessed by the expression dd[DCT_NAM_idx]
. Its
associated value by the expression dd[DCT_VAL_idx]
, and the 'next-link'
to the parent dictionary by the dd[DCT_DCT_idx]
expression.