コード例 #1
0
        /// <summary>
        /// Process the interchange elements (chunks) provided by the given interchange format processor.
        /// </summary>
        /// <param name="processor">Interchange format processor that can provide interchange chunks for processing.</param>
        protected internal virtual void ProcessInterchangeElements(InterchangeFormatProcessor processor)
        {
            InterchangeChunk chunk = this.GetNextChunk(processor);

            if (chunk == null)
            {
                // Must have at least ONE interchange unit.
                this.ReportError(processor, InterchangeFormatErrors.ExpectedInterchangeUnit);
                return;
            }
            InterchangeUnitNode node = null;

            while (chunk != null)
            {
                node  = this.ProcessInterchangeElement(processor, node, chunk);
                chunk = this.GetNextChunk(processor);
            }
        }
コード例 #2
0
        /// <summary>
        /// Process a given interchange element (chunk).
        /// </summary>
        /// <param name="processor"></param>
        /// <param name="node">Last node that was parsed. This is used for annotations.</param>
        /// <param name="chunk">Interchange chunk to be processed.</param>
        /// <returns>Returns the new interchange parse node (or null in case of error).</returns>
        protected virtual InterchangeUnitNode ProcessInterchangeElement(InterchangeFormatProcessor processor, InterchangeUnitNode node, InterchangeChunk chunk)
        {
            InterchangeFormatParser parser            = this.GetInterchangeParser(chunk);
            InterchangeElementNode  nodeForAnnotation = (node == null) ? null : node.GetAnnotatedNode();

            node = parser.ParseInterchangeElement(nodeForAnnotation);
            if (node == null)
            {
                return(null);
            }
            return(node.FileIn(processor, chunk, chunk));
        }