[][src]Trait kul_core::parser::OperatorBindings

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; fn lookup(
        &self,
        operator: &Datum<DA::TT, DA::ET, DA::DR>
    ) -> Option<&Combiner<Self::OR, Self::AR>>; }

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.

Associated Types

type OR: Deref<Target = OpFn<DA, Self::CE>>

The type of references to Operative macro functions.

type AR: Deref<Target = ApFn<DA, Self::CE>>

The type of references to Applicative macro functions.

type CE

Loading content...

Required methods

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.

Loading content...

Implementors

impl<DA> OperatorBindings<DA> for EmptyOperatorBindings where
    DA: DatumAllocator
[src]

type OR = DummyOperativeRef<DA, Self::CE>

type AR = DummyApplicativeRef<DA, Self::CE>

type CE = ()

impl<P, DA, OR, AR, CE> OperatorBindings<DA> for PairOperatorBindings<P, DA, OR, AR, CE> where
    P: Borrow<[(Datum<DA::TT, DA::ET, DA::DR>, Combiner<OR, AR>)]>,
    DA: DatumAllocator,
    Datum<DA::TT, DA::ET, DA::DR>: PartialEq,
    OR: Deref<Target = OpFn<DA, CE>>,
    AR: Deref<Target = ApFn<DA, CE>>, 
[src]

type OR = OR

type AR = AR

type CE = CE

Loading content...