pub trait OperatorBindings<DA>where
DA: DatumAllocator,{
type OR: Deref<Target = OpFn<DA, Self::CE>>;
type AR: Deref<Target = ApFn<DA, Self::CE>>;
type CE;
// Required method
fn lookup(
&self,
operator: &Datum<DA::TT, DA::ET, DA::DR>,
) -> Option<&Combiner<Self::OR, Self::AR>>;
}
Expand description
Environment of bindings of operator sub-forms to macro functions that
substitute forms in a Parser
’s returned AST.
Enables different applications to use different sets or none at all.
Required Associated Types§
Sourcetype OR: Deref<Target = OpFn<DA, Self::CE>>
type OR: Deref<Target = OpFn<DA, Self::CE>>
The type of references to
Operative
macro functions.
Sourcetype AR: Deref<Target = ApFn<DA, Self::CE>>
type AR: Deref<Target = ApFn<DA, Self::CE>>
The type of references to
Applicative
macro functions.
Sourcetype CE
type CE
The combiner error extension type.
Required Methods§
Sourcefn lookup(
&self,
operator: &Datum<DA::TT, DA::ET, DA::DR>,
) -> Option<&Combiner<Self::OR, Self::AR>>
fn lookup( &self, operator: &Datum<DA::TT, DA::ET, DA::DR>, ) -> Option<&Combiner<Self::OR, Self::AR>>
Look-up any binding we might have associated with the given datum,
referenced by the operator
argument, which was found in operator
(first, “head”) position of a nested form. If we do have a binding for
it, return the “combiner” function that determines the semantics of the
entire form and further parses and processes it in possibly arbitrary
ways. Else if we do not have a binding, return None
to indicate that
the form should not be handled according to the operator and that the
operands should simply be recursively parsed.