/// <summary> /// Create a new binary argument node. /// </summary> /// <param name="parent">Parent message node that defines this message argument node.</param> protected internal BinaryArgumentNode(BinaryMessageNode parent) { #if DEBUG if (parent == null) throw new ArgumentNullException("parent"); #endif this.Parent = parent; }
/// <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(BinaryMessageNode message, BinaryMessageSequenceNode nextMessage) { if (message == null) { throw new ArgumentNullException("message"); } this.Message = message; this.NextMessage = nextMessage; // Null is OK. }
/// <summary> /// Create a new binary argument node. /// </summary> /// <param name="parent">Parent message node that defines this message argument node.</param> protected internal BinaryArgumentNode(BinaryMessageNode parent) { #if DEBUG if (parent == null) { throw new ArgumentNullException("parent"); } #endif this.Parent = parent; }
/// <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(BinaryMessageNode message, BinaryKeywordOrKeywordMessageSequenceNode nextMessage) { if (message == null) throw new ArgumentNullException("message"); this.Message = message; this.NextMessage = nextMessage; // null is OK }
protected virtual BinaryMessageNode ParseBinaryMessage(MessageSequenceBase parent, BinarySelectorToken selector) { // PARSE: <binary message> ::= binarySelector <binary argument> BinaryMessageNode result = new BinaryMessageNode(parent, selector); Token token = this.GetNextTokenxx(Preference.NegativeSign); // Parse the binary argument ... ParseBinaryArgument() does not fail and reports errors self. BinaryArgumentNode argument = this.ParseBinaryArgument(result, token); if (argument != null) result.SetContents(argument); return result; }
protected virtual BinaryArgumentNode ParseBinaryArgument(BinaryMessageNode parent, Token token) { // PARSE: <binary argument> ::= <primary> <unary message>* BinaryArgumentNode result = new BinaryArgumentNode(parent); IPrimaryNode primary = this.ParsePrimary(result, token); if (primary == null) { this.ReportParserError(result, SemanticErrors.MissingPrimary, token); return result; } token = this.GetNextTokenxx(Preference.Default); UnaryMessageSequenceNode messages = null; if (token is IdentifierToken) // <unary message>* messages = this.ParseUnaryMessageSequence(result, (IdentifierToken)token); else this.ResidueToken = token; result.SetContents(primary, messages); return result; }