Exemplo n.º 1
0
        private void InitContext()
        {
            var rootContext = cursor.RootContext;

            if (rootContext != null)
            {
                ServicesInitializer.SetServiceProperties(
                    rootContext.GetType(),
                    rootContext,
                    typeof(IScanning),
                    this);
            }
        }
Exemplo n.º 2
0
        public IProducer<Msg> CreateActionProducer(object context)
        {
            var result = new ActionProducer(runtimeGrammar, context, grammarAction, this.merge);

            if (context != null)
            {
                ServicesInitializer.SetServiceProperties(
                    context.GetType(),
                    context,
                    typeof(IParsing),
                    result);
            }

            return result;
        }
Exemplo n.º 3
0
        public IScanner CreateScanner(object context, TextReader input, string document, ILogging logging)
        {
            if (logging == null)
            {
                logging = ExceptionLogging.Instance;
            }

            if (context != null)
            {
                ServicesInitializer.SetServiceProperties(
                    context.GetType(),
                    context,
                    typeof(ILanguageRuntime),
                    this);

                ServicesInitializer.SetServiceProperties(
                    context.GetType(),
                    context,
                    typeof(ILogging),
                    logging);
            }

            return new Scanner(scan1, input, document, context, scanAction, maxActionCount, logging);
        }