Exemple #1
0
        public InheritedAttribute(
            Action <SynthesizedAttributeContext <T> > action)
        {
            var ctx = new SynthesizedAttributeContext <T>();

            action(ctx);

            Productions = ctx.Productions;
        }
Exemple #2
0
        public SynthesizedAttribute(
            Action <SynthesizedAttributeContext <T> > action,
            Func <T, T, T> aggregationFunction)
        {
            var ctx = new SynthesizedAttributeContext <T>();

            action(ctx);

            Productions         = ctx.Productions;
            AggregationFunction = aggregationFunction ?? ((a, b) => a);
        }