SetAction() private method

private SetAction ( Action action ) : void
action Action
return void
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(frame.State == Initialized);

            Action?action;

            if (this.mode != null)
            {
                action = importsOf == null
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node !, this.mode)
                    : importsOf.FindTemplateImports(processor, frame.Node !, this.mode);
            }
            else
            {
                action = importsOf == null
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node !)
                    : importsOf.FindTemplateImports(processor, frame.Node !);
            }

            // Built-int template rules
            action ??= BuiltInTemplate(frame.Node !);

            // Jump
            if (action != null)
            {
                frame.SetAction(action);
            }
            else
            {
                frame.Finished();
            }
        }
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(frame.State == Initialized);

            Action action = null;

            if (this.mode != null) {
                action = importsOf == null 
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node, this.mode)
                    : importsOf.FindTemplateImports(processor, frame.Node, this.mode);
            }
            else {
                action = importsOf == null 
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node)
                    : importsOf.FindTemplateImports(processor, frame.Node);
            }

            // Built-int template rules
            if (action == null) {
                action = BuiltInTemplate(frame.Node);
            }

            // Jump
            if (action != null) {
                frame.SetAction(action);
            }
            else {
                frame.Finished();
            }
        }
Beispiel #3
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(frame.State == Initialized);
            Debug.Assert(processor.Debugger != null);

            Action?action = null;

            if (this.mode == Compiler.BuiltInMode)
            {
                // mode="*" -- use one from debuggerStack
                this.mode = processor.GetPreviousMode();
                Debug.Assert(this.mode != Compiler.BuiltInMode);
            }
            processor.SetCurrentMode(this.mode);

            if (this.mode != null)
            {
                action = importsOf == null
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node !, this.mode)
                    : importsOf.FindTemplateImports(processor, frame.Node !, this.mode);
            }
            else
            {
                action = importsOf == null
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node !)
                    : importsOf.FindTemplateImports(processor, frame.Node !);
            }

            // Built-int template rules
            if (action == null && processor.RootAction !.builtInSheet != null)
            {
                action = processor.RootAction.builtInSheet.FindTemplate(processor, frame.Node !, Compiler.BuiltInMode);
            }
            if (action == null)
            {
                action = BuiltInTemplate(frame.Node !);
            }

            // Jump
            if (action != null)
            {
                frame.SetAction(action);
            }
            else
            {
                frame.Finished();
            }
        }
        internal override void Execute(Processor processor, ActionFrame frame) {
            Debug.Assert(processor != null && frame != null);
            Debug.Assert(frame.State == Initialized);
            Debug.Assert(processor.Debugger != null);

            Action action = null;

            if (this.mode == Compiler.BuiltInMode) {
                // mode="*" -- use one from debuggerStack
                this.mode = processor.GetPrevioseMode();
                Debug.Assert(this.mode != Compiler.BuiltInMode);
            }
            processor.SetCurrentMode(this.mode);

            if (this.mode != null) {
                action = importsOf == null 
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node, this.mode)
                    : importsOf.FindTemplateImports(processor, frame.Node, this.mode);
            }
            else {
                action = importsOf == null 
                    ? processor.Stylesheet.FindTemplate(processor, frame.Node)
                    : importsOf.FindTemplateImports(processor, frame.Node);
            }

            // Built-int template rules
            if (action == null && processor.RootAction.builtInSheet != null) {
                action = processor.RootAction.builtInSheet.FindTemplate(processor, frame.Node, Compiler.BuiltInMode);
            }
            if (action == null) {
                action = BuiltInTemplate(frame.Node);
            }

            // Jump
            if (action != null) {
                frame.SetAction(action);
            }
            else {
                frame.Finished();
            }
        }