Exemplo n.º 1
0
        protected virtual Expression ReadContainerExp(ExpCombinator combinator)
        {
            string name = reader.Name;

            if (ReadStartElement())
            {
                return(ReadChildExps(combinator));
            }
            // no children. error
            ReportError(ERR_EXPRESSION_EXPECTED, name);
            return(Expression.NotAllowed);
        }
 protected virtual Expression ReadContainerExp( ExpCombinator combinator )
 {
     string name = reader.Name;
     if(ReadStartElement())
     return ReadChildExps( combinator );
     // no children. error
     ReportError( ERR_EXPRESSION_EXPECTED, name );
     return Expression.NotAllowed;
 }
        // reads child expressions and combines them by using the specified
        // combinator.
        protected virtual Expression ReadChildExps( ExpCombinator comb )
        {
            Expression exp = null;

            while(SkipForeignElements()) {
            Expression child=ReadExp();
            if(exp==null)	exp=child;
            else
                exp = comb( exp, child );
            }
            ReadEndElement();
            if(exp==null) {
            // error: no children
            ReportError( ERR_EXPRESSION_EXPECTED );
            exp = Expression.NotAllowed;	// recovery.
            }
            return exp;
        }