Example #1
0
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="messages">Message or a sequence of messages sent to the primary of the expression.</param>
 /// <param name="nextCascade">Optional cascade messages following this cascade message.</param>
 protected internal void SetContents(MessageSequenceNode messages, CascadeMessageSequenceNode nextCascade)
 {
     if (messages == null)
     {
         throw new ArgumentNullException("messages");
     }
     this.Messages    = messages;
     this.NextCascade = nextCascade; // OK with null
 }
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="primary">The primary, or the receiver of the basic expression.</param>
 /// <param name="messages">Optional message or a sequence of messages sent to the primary of the expression.</param>
 /// <param name="cascadeMessages">Optional cascade messages sent to the primary of the expression.</param>
 protected internal void SetContents(IPrimaryNode primary, MessageSequenceNode messages, CascadeMessageSequenceNode cascadeMessages)
 {
     if (primary == null)
     {
         throw new ArgumentNullException("primary");
     }
     this.Primary         = primary;
     this.Messages        = messages;        // OK with null
     this.CascadeMessages = cascadeMessages; // OK with null
 }
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="primary">The primary, or the receiver of the basic expression.</param>
 /// <param name="messages">Optional message or a sequence of messages sent to the primary of the expression.</param>
 /// <param name="cascadeMessages">Optional cascade messages sent to the primary of the expression.</param>
 protected internal void SetContents(IPrimaryNode primary, MessageSequenceNode messages, CascadeMessageSequenceNode cascadeMessages)
 {
     if (primary == null)
         throw new ArgumentNullException("primary");
     this.Primary = primary;
     this.Messages = messages; // OK with null
     this.CascadeMessages = cascadeMessages; // OK with null
 }
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="messages">Message or a sequence of messages sent to the primary of the expression.</param>
 /// <param name="nextCascade">Optional cascade messages following this cascade message.</param>
 protected internal void SetContents(MessageSequenceNode messages, CascadeMessageSequenceNode nextCascade)
 {
     if (messages == null)
         throw new ArgumentNullException("messages");
     this.Messages = messages;
     this.NextCascade = nextCascade; // OK with null
 }
Example #5
0
        protected virtual CascadeMessageSequenceNode ParseCascadeMessageSequenceNode(ICascadeMessageSequenceParentNode parent, Token semicolon)
        {
            // PARSE: <cascaded messages> ::= (';' <messages>)*
            if (!Parser.IsCascadeDelimiter(semicolon))
            {
                this.ResidueToken = semicolon;
                return null; // Not a cascade message ... return null.
            }
            CascadeMessageSequenceNode result = new CascadeMessageSequenceNode(parent, (SpecialCharacterToken)semicolon);

            Token token = this.GetNextTokenxx(Preference.Default);
            MessageSequenceNode messages = this.ParseMessages(result, token);

            if (messages == null)
            {
                this.ReportParserError(result, SemanticErrors.MissingMessagePattern, token);
                return result;
            }

            token = this.GetNextTokenxx(Preference.Default);

            CascadeMessageSequenceNode nextCascade = null;
            if (Parser.IsCascadeDelimiter(token))
                nextCascade = this.ParseCascadeMessageSequenceNode(result, (SpecialCharacterToken)token);
            else
                this.ResidueToken = token;

            result.SetContents(messages, nextCascade);
            return result;
        }