public static Tree InterpretChain(IEnumerable <LayerWrapper> layers, Tree start) { Tree.BatchTransform updater = new Tree.BatchTransform(start); Tree tree = start; LayerWrapper currLayer = null; try { foreach (LayerWrapper wrapper in layers) { currLayer = wrapper; InterpretArgs args = new InterpretArgs(tree, updater, wrapper.Intent); wrapper.Layer.Interpret(args); tree = updater.GetUpdatedTree(); wrapper.Layer.AfterInterpret(tree); } } catch (Exception e) { Tree.BatchTransform newupdater = new Tree.BatchTransform(tree); LayerException exception = new LayerException(currLayer, e); newupdater.Tag(tree, "interpretation_exception", exception); tree = newupdater.GetUpdatedTree(); } return(tree); }
private static Tree InterpretSubchain(List <LayerWrapper> layers, int startInclusive, int endInclusive, Tree tree) { LayerWrapper currLayer = null; try { for (int i = startInclusive; i <= endInclusive; i++) { currLayer = layers[i]; Tree.BatchTransform updater = new Tree.BatchTransform(tree); InterpretArgs args = new InterpretArgs(tree, updater, currLayer.Intent); currLayer.Layer.Interpret(args); tree = updater.GetUpdatedTree(); currLayer.Layer.AfterInterpret(tree); } } catch (Exception e) { Tree.BatchTransform newupdater = new Tree.BatchTransform(tree); LayerException exception = new LayerException(currLayer, e); newupdater.Tag(tree, "interpretation_exception", exception); tree = newupdater.GetUpdatedTree(); } return(tree); }
public static Tree InterpretChain(IEnumerable<LayerWrapper> layers, Tree start){ Tree.BatchTransform updater = new Tree.BatchTransform(start); Tree tree = start; LayerWrapper currLayer = null; try { foreach (LayerWrapper wrapper in layers) { currLayer = wrapper; InterpretArgs args = new InterpretArgs(tree, updater, wrapper.Intent); wrapper.Layer.Interpret(args); tree = updater.GetUpdatedTree(); wrapper.Layer.AfterInterpret(tree); } } catch(Exception e) { Tree.BatchTransform newupdater = new Tree.BatchTransform(tree); LayerException exception = new LayerException(currLayer, e); newupdater.Tag(tree, "interpretation_exception", exception); tree = newupdater.GetUpdatedTree(); } return tree; }
public InterpretArgs (Tree tree, Tree.BatchTransform updater, IRuntimeStorage runtimeStorage) { this._updater = updater; Tree = tree; RuntimeStorage = runtimeStorage; }
private static Tree InterpretSubchain(List<LayerWrapper> layers, int startInclusive, int endInclusive, Tree tree){ LayerWrapper currLayer = null; try { for (int i = startInclusive; i <= endInclusive; i++) { currLayer = layers[i]; Tree.BatchTransform updater = new Tree.BatchTransform(tree); InterpretArgs args = new InterpretArgs(tree, updater, currLayer.Intent); currLayer.Layer.Interpret(args); tree = updater.GetUpdatedTree(); currLayer.Layer.AfterInterpret(tree); } } catch (Exception e) { Tree.BatchTransform newupdater = new Tree.BatchTransform(tree); LayerException exception = new LayerException(currLayer, e); newupdater.Tag(tree, "interpretation_exception", exception); tree = newupdater.GetUpdatedTree(); } return tree; }
public InterpretArgs(Tree tree, Tree.BatchTransform updater, IRuntimeStorage runtimeStorage) { this._updater = updater; Tree = tree; RuntimeStorage = runtimeStorage; }