private static void Check( Parser parser, ParseTreeNode ptn, IEnumerable <string> allowedCommands, bool moduleManifest) { RestrictedLanguageModeChecker languageModeChecker = new RestrictedLanguageModeChecker(parser, allowedCommands, moduleManifest); ptn.Accept((ParseTreeVisitor)languageModeChecker); }
internal object Execute(ParseTreeNode ptn, Array input) { object obj = (object)AutomationNull.Value; ActivationRecordBuilder activationRecordBuilder = new ActivationRecordBuilder(); ptn.Accept((ParseTreeVisitor)activationRecordBuilder); ActivationRecord activationRecord = this._context.EngineSessionState.CurrentActivationRecord; try { this._context.EngineSessionState.CurrentActivationRecord = new ActivationRecord(activationRecordBuilder.PipelineSlots, activationRecordBuilder.VariableSlots, this._context.EngineSessionState.CurrentScope); obj = ptn.Execute(input, this._context); } catch (FlowControlException ex) { } finally { this._context.EngineSessionState.CurrentActivationRecord = activationRecord; } return(obj); }