Exemplo n.º 1
0
        private void ProcessCharacter(char aCharacter)
        {
            int count = iWorkers.Count;

            //
            for (int i = 0; i < count; i++)
            {
                SymLexerWorker worker   = (SymLexerWorker)iWorkers[i];
                bool           consumed = worker.ProcessCharacter(aCharacter);
                //
                if (consumed)
                {
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public void HandleEndOfLineDetected(SymTextPosition aEOLPosition)
        {
            // Report to children
            int count = iWorkers.Count;

            for (int i = 0; i < count; i++)
            {
                SymLexerWorker worker = (SymLexerWorker)iWorkers[i];
                worker.StartedNewLine(aEOLPosition);
            }

            // Add a token for the new line - do this after reporting the
            // event to the children so that they can flush any data
            // they have before we append the new line.
            SymToken token = new SymToken("", SymToken.TClass.EClassNewLine, aEOLPosition);

            FlushToken(token);

            // Report new line event
            ReportEvent(TEvent.EEventLexingNewLine, token);
        }
Exemplo n.º 3
0
 internal void RegisterWorker(SymLexerWorker aWorker)
 {
     iWorkers.Add(aWorker);
 }