예제 #1
0
        public void setDelimiters(char openDelimiter, char closeDelimiter)
        {
            TemplateLexerATNSimulator interpreter = Interpreter;

            if (interpreter.OpenDelimiter == openDelimiter && interpreter.CloseDelimiter == closeDelimiter)
            {
                return;
            }

            _interp = getSimulatorForDelimiters(openDelimiter, closeDelimiter);
            Interpreter.CopyState(interpreter);
        }
예제 #2
0
        private TemplateLexerATNSimulator getSimulatorForDelimiters(char openDelimiter, char closeDelimiter)
        {
            ATN atn = getATNForDelimiters(openDelimiter, closeDelimiter);

            lock (atnToSimulator)
            {
                TemplateLexerATNSimulator simulator;
                if (!atnToSimulator.TryGetValue(atn, out simulator))
                {
                    simulator           = new TemplateLexerATNSimulator(this, atn, openDelimiter, closeDelimiter);
                    atnToSimulator[atn] = simulator;
                }

                return(simulator);
            }
        }