protected virtual UnaryBinaryMessageSequenceNode ParseUnaryBinaryMessageSequence(IMessageSequenceParentNode parent, IdentifierToken selector) { // PARSE: <unary message>* <binary message>* UnaryBinaryMessageSequenceNode result = new UnaryBinaryMessageSequenceNode(parent); // NB: ParseUnaryMessage() cannot fail, so we don't check result UnaryMessageNode message = this.ParseUnaryMessage(result, selector); Token token = this.GetNextTokenxx(Preference.Default); BinaryOrBinaryUnaryMessageSequenceNode nextMessage = null; if (token is IdentifierToken) { // <unary message>* nextMessage = this.ParseUnaryBinaryMessageSequence(result, (IdentifierToken)token); } else if (token is BinarySelectorToken) { // <binary message>* nextMessage = this.ParseBinaryMessageSequence(result, (BinarySelectorToken)token); } else { this.ResidueToken = token; } result.SetContents(message, nextMessage); return(result); }
/// <summary> /// Visits the Unary Message node. /// </summary> /// <param name="node">The node to visit.</param> public override bool VisitUnaryMessage(UnaryMessageNode node) { if (node.Parent == null) { return(false); } if (node.SelectorToken == null) { return(false); } return(true); }
protected virtual UnaryBinaryKeywordMessageSequenceNode ParseUnaryBinaryKeywordMessageSequence(IMessageSequenceParentNode parent, IdentifierToken selector) { // PARSE: // <unary message>+ <binary message>* [<keyword message>] UnaryBinaryKeywordMessageSequenceNode result = new UnaryBinaryKeywordMessageSequenceNode(parent); // NB: ParseUnaryMessage() cannot fail, so we don't check result UnaryMessageNode message = this.ParseUnaryMessage(result, selector); Token token = this.GetNextTokenxx(Preference.Default); MessageSequenceNode nextMessage = this.ParseMessages(result, token, MessageType.All); result.SetContents(message, nextMessage); return(result); }
/// <summary> /// Visits the Unary Message node. /// </summary> /// <param name="node">The node to visit.</param> public virtual TResult VisitUnaryMessage(UnaryMessageNode node) { throw new NotImplementedException(); }
/// <summary> /// Visits the Unary Message node. /// </summary> /// <param name="node">The node to visit.</param> public virtual TResult VisitUnaryMessage(UnaryMessageNode node) { return(default(TResult)); // The default naive implementation }