title: Parsing from standard input
body: <p>How do I parse the standard input (without buffering)? If I understand correctly, <code>phrase/2</code> needs a list, and <code>phrase_from_file/2</code> from <code>library(pure_input)</code> needs a file.</p>
  
  <p>I solved my problem using normal predicates (not DCG) and using built-ins like <code>get_char/2</code> and <code>read_line_to_codes/2</code>, but at the end the implementation looks suspiciously similar to the solution I would have written in C.</p>
  
  <p>And if I can sneak a very much related question: what is standard input in SWI-Prolog? <code>read_line_to_codes</code> (<code>library(readutil)</code>) needs an input stream (unlike <code>get/1</code>, for example). I get it with the following predicate:</p>
  
  <pre><code>input_stream(Stream) :-
      current_stream(Object, read, Stream),
      integer(Object).
  </code></pre>
  
  <p>. . . which of course works, but feels a bit hacked. Is it possible to have more than one open input stream? How am I going to know which one is the standard input of the operating system (Linux in my case)?</p>