uniblab

processing words

Dec 4th, 2020 (edited)
774
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var line = System.Console.In.ReadLine().TrimToNull();
  2. while ( !System.String.IsNullOrEmpty( line ) ) {
  3.     foreach ( var word in ReadWord( line ) ) {
  4.         var operator = FindWord( word );
  5.         if ( null == operator ) {
  6.             var wordNotFound = new System.InvalidOperationException( "word not found: " + word );
  7.             wordNotFound.Data.Add( "word", word );
  8.             throw wordNotFound;
  9.         }
  10.         stack = operator.Execute( stack );
  11.     }
  12.     line = System.Console.In.ReadLine().TrimToNull();
  13. }
RAW Paste Data