Ejemplo n.º 1
0
        public bool Offer(string aLine, long aLineNumber, DExcExtractorList aList, DExcExtractor aInterpreter)
        {
            Match m = iExpression.Match(aLine);

            //
            if (m.Success)
            {
                if (Type == TType.ETypeMatchAndTransition || Type == TType.ETypeMatchSaveAndTransition)
                {
                    aInterpreter.State = iNewState;
                }
                if (Type == TType.ETypeMatchAndSave)
                {
                    aList.Add(m.Value);
                }
                else if (Type == TType.ETypeMatchSaveAndTransition)
                {
                    // We have just transitioned state and we must add the line
                    // to the new state's list
                    if (aInterpreter.CurrentList != null)
                    {
                        aInterpreter.CurrentList.Add(m.Value);
                    }
                }
            }
            //
            return(m.Success);
        }
Ejemplo n.º 2
0
        public virtual bool Offer(string aLine, long aLineNumber, DExcExtractor aInterpreter)
        {
            bool handled = false;

            //
            foreach (DExcExtractorEntry interpreter in iEntries)
            {
                handled = interpreter.Offer(aLine, aLineNumber, this, aInterpreter);
                if (handled)
                {
                    break;
                }
            }
            //
            return(handled);
        }