@@ -0,0 +1,1535 @@
+/*%0A * Copyright 2016 Bahman Movaqar%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.ojlang.runtime.sysio.impls;%0A%0Aimport lombok.val;%0Aimport org.ojlang.exceptions.SysIoException;%0Aimport org.ojlang.runtime.sysio.StdIn;%0Aimport org.ojlang.runtime.sysio.StdInProducer;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0A%0A/**%0A * Console StdIn producer.%0A *%0A * @author Bahman Movaqar %5BBahman AT BahmanM.com%5D%0A */%0Apublic class ConsoleStdInProducer implements StdInProducer %7B%0A%0A  private StdIn stdin;%0A%0A  @Override%0A  public StdInProducer setStdIn(StdIn stdin) %7B%0A    this.stdin = stdin;%0A    return this;%0A  %7D%0A%0A  @Override%0A  public void run() %7B%0A    if (stdin == null)%0A      throw new RuntimeException(%22Invalid StdIn.%22);%0A    else %7B%0A      val reader = new BufferedReader(new InputStreamReader(System.in));%0A      while (true) %7B%0A        try %7B%0A          stdin.put(reader.readLine());%0A        %7D catch (IOException e) %7B%0A          throw new SysIoException(e);%0A        %7D%0A      %7D%0A    %7D%0A  %7D%0A%0A%7D%0A

add console stdin producer