Esempio n. 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="message">The first (current) message in the message sequence.</param>
 /// <param name="nextMessage">Optional sequence of messages that may follow this message.</param>
 protected internal void SetContents(UnaryMessageNode message, MessageSequenceNode nextMessage)
 {
     if (message == null)
     {
         throw new ArgumentNullException("message");
     }
     this.Message     = message;
     this.NextMessage = nextMessage; // null is OK
 }
 /// <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
 }
Esempio n. 4
0
 /// <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
 }
Esempio n. 5
0
 /// <summary>
 /// Create a new keyword message node.
 /// </summary>
 /// <param name="parent">The parent message sequence node that defines this message node.</param>
 protected internal KeywordMessageNode(MessageSequenceNode parent)
     : base(parent)
 {
     this.SelectorTokens = new List<KeywordToken>();
     this.Arguments = new List<KeywordArgumentNode>();
 }
 /// <summary>
 /// Initializes the node after being parsed by the parser.
 /// </summary>
 /// <param name="message">The first (current) message in the message sequence.</param>
 /// <param name="nextMessage">Optional sequence of messages that may follow this message.</param>
 protected internal void SetContents(UnaryMessageNode message, MessageSequenceNode nextMessage)
 {
     if (message == null)
         throw new ArgumentNullException("message");
     this.Message = message;
     this.NextMessage = nextMessage; // null is OK
 }
Esempio n. 7
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
 }
Esempio n. 8
0
        protected virtual KeywordMessageNode ParseKeywordMessage(MessageSequenceNode parent, KeywordToken selector)
        {
            // PARSE: <keyword message> ::= (keyword <keyword argument> )+
            KeywordMessageNode result = new KeywordMessageNode(parent);

            List<KeywordToken> selectorTokens = new List<KeywordToken>();
            List<KeywordArgumentNode> arguments = new List<KeywordArgumentNode>();

            Token token = this.GetNextTokenxx(Preference.NegativeSign);
            selectorTokens.Add(selector);
            arguments.Add(this.ParseKeywordArgument(result, token)); // NB: ParseKeywordArgument() may not fail.

            token = this.GetNextTokenxx(Preference.Default);

            while (token is KeywordToken)
            {
                selectorTokens.Add((KeywordToken)token);
                token = this.GetNextTokenxx(Preference.NegativeSign);
                arguments.Add(this.ParseKeywordArgument(result, token)); // NB: ParseKeywordArgument() may not fail.

                token = this.GetNextTokenxx(Preference.Default);
            }

            result.SetContents(selectorTokens, arguments);
            this.ResidueToken = token;
            return result;
        }
Esempio n. 9
0
 /// <summary>
 /// Create a new keyword message node.
 /// </summary>
 /// <param name="parent">The parent message sequence node that defines this message node.</param>
 protected internal KeywordMessageNode(MessageSequenceNode parent)
     : base(parent)
 {
     this.SelectorTokens = new List <KeywordToken>();
     this.Arguments      = new List <KeywordArgumentNode>();
 }