public StmtWordSpan AddWord( StmtWordListCursor InCursor, MonoCaseString InExpectedWordText) { if (InCursor.Position != RelativePosition.At) { throw new ApplicationException("StmtWord cursor is not positioned at a word"); } AddWord(InCursor.Node.Value, InExpectedWordText); return(this); }
/// <summary> /// advance the StmtWord cursor to the next word. Then test that it contains the /// expected word value. Finally, add that StmtWord to the WordSpan string. /// </summary> /// <param name="InCursor"></param> /// <param name="InExpectedWordText"></param> /// <returns></returns> public StmtWordListCursor AddNextWord( StmtWordListCursor InCursor, MonoCaseString InExpectedWordText) { StmtWordListCursor c1 = InCursor.Next(); if (c1.Position != RelativePosition.At) { throw new ApplicationException("Next StmtWord cursor is not positioned at a word"); } AddWord(c1.Node.Value, InExpectedWordText); return(c1); }
/// <summary> /// Add word to the span. Throw an error if the word value is not the expected /// value. /// </summary> /// <param name="InWord"></param> /// <param name="InExpectedWordText"></param> /// <returns></returns> public StmtWordSpan AddWord(StmtWord InWord, MonoCaseString InExpectedWordText) { if (InExpectedWordText != InWord.WordText) { throw new ApplicationException( "Expecting value " + InExpectedWordText.ToString() + ". Actual value is " + InWord.WordText); } this.Add(InWord); return(this); }