Task

Reverse the order of all tokens in each of a number of strings and display the result;   the order of characters within a token should not be modified.



Example

Hey you, Bub!    would be shown reversed as:    Bub! you, Hey 



Tokens are any non-space characters separated by spaces (formally, white-space);   the visible punctuation form part of the word within which it is located and should not be modified.

You may assume that there are no significant non-visible characters in the input.   Multiple or superfluous spaces may be compressed into a single space.

Some strings have no tokens, so an empty string   (or one just containing spaces)   would be the result.

Display the strings in order   (1st, 2nd, 3rd, ···),   and one string per line.

(You can consider the ten strings as ten lines, and the tokens as words.)



Input data
             (ten lines within the box)
 line
     ╔════════════════════════════════════════╗
   1 ║  ---------- Ice and Fire ------------  ║
   2 ║                                        ║  ◄─── a blank line here.
   3 ║  fire, in end will world the say Some  ║
   4 ║  ice. in say Some                      ║
   5 ║  desire of tasted I've what From       ║
   6 ║  fire. favor who those with hold I     ║
   7 ║                                        ║  ◄─── a blank line here.
   8 ║  ... elided paragraph last ...         ║
   9 ║                                        ║  ◄─── a blank line here.
  10 ║  Frost Robert -----------------------  ║
     ╚════════════════════════════════════════╝

Cf.
 Phrase reversals


# returns original phrase with the order of the words reversed #
# a word is a sequence of non-blank characters                 #
PROC reverse word order = ( STRING original phrase )STRING:
     BEGIN
        STRING words reversed := "";
        STRING separator      := "";
        INT    start pos      := LWB original phrase;
        WHILE
            # skip leading spaces #
            WHILE IF start pos <= UPB original phrase
                  THEN original phrase[ start pos ] = " "
                  ELSE FALSE
                  FI
            DO start pos +:= 1
            OD;
            start pos <= UPB original phrase
        DO
            # have another word, find it #
            INT end pos := start pos;
            WHILE IF end pos <= UPB original phrase
                  THEN original phrase[ end pos ] /= " "
                  ELSE FALSE
                  FI
            DO end pos +:= 1
            OD;
            ( original phrase[ start pos : end pos - 1 ] + separator ) +=: words reversed;
            separator := " ";
            start pos := end pos + 1
        OD;
        words reversed
     END # reverse word order # ;
 
# reverse the words in the lines as per the task #
print( ( reverse word order ( "--------- Ice and Fire ------------ " ), newline ) );
print( ( reverse word order ( "                                    " ), newline ) );
print( ( reverse word order ( "fire, in end will world the say Some" ), newline ) );
print( ( reverse word order ( "ice. in say Some                    " ), newline ) );
print( ( reverse word order ( "desire of tasted I've what From     " ), newline ) );
print( ( reverse word order ( "fire. favor who those with hold I   " ), newline ) );
print( ( reverse word order ( "                                    " ), newline ) );
print( ( reverse word order ( "... elided paragraph last ...       " ), newline ) );
print( ( reverse word order ( "                                    " ), newline ) );
print( ( reverse word order ( "Frost Robert -----------------------" ), newline ) )
 