-í
WÔj<c       s;     d  Z  " $ d k Z d k Z & d f  d „  ƒ  YZ d S(   sˆ   Output stream

Class:

  Stream -- output stream which outputs templates, performing
            key/value substitution and indentation.Ns   Streamc      se   & d  Z  L O d d „ Z T e i d ƒ Z V d „  Z W d „  Z Y h  d „ Z g h  d „ Z RS(   sô  IDL Compiler output stream class

The output stream takes a template string containing keys enclosed in
'@' characters and replaces the keys with their associated values. It
also provides counted indentation levels.

  eg. Given the template string:

    template = """\
class @id@ {
public:
  @id@(@type@ a) : a_(a) {}

private:
  @type@ a_;
};"""

  Calling s.out(template, id="foo", type="int") results in:

    class foo {
    public:
      foo(int a) : a_(a) {}

    private:
      int a_;
    };


Functions:

  __init__(file, indent_size)   -- Initialise the stream with the
                                   given file and indent size.
  inc_indent()                  -- Increment the indent level.
  dec_indent()                  -- Decrement the indent level.
  out(template, key=val, ...)   -- Output the given template with
                                   key/value substitution and
                                   indenting.
  niout(template, key=val, ...) -- As out(), but with no indenting.i   c    s/   O P d |  _ Q | |  _ R d | |  _ d  S(   Ni    s    (   s   selfs   indents   files   indent_sizes   istring(   s   selfs   files   indent_size(    (    s   ./omniidl/output.pys   __init__O s   s	   @([^@]*)@c    s   V V |  i d |  _ d  S(   Ni   (   s   selfs   indent(   s   self(    (    s   ./omniidl/output.pys
   inc_indentV s    c    s   W W |  i d |  _ d  S(   Ni   (   s   selfs   indent(   s   self(    (    s   ./omniidl/output.pys
   dec_indentW s    c    sž   Y Z \ | i | ƒ ^ | d „ } b xo t i |  i i | | ƒ d ƒ Db ]I } c |  i i |  i |  i ƒ d |  i i | ƒ e |  i i d ƒ qJ Wd S(   s@   Output a multi-line string with indentation and @@ substitution.c    sJ   ^ _ |  i d ƒ d j o _ d Sn ` t |  i d ƒ t ƒ  | ƒ Sd  S(   Ni   s    s   @(   s   matchs   groups   evals   globalss   dict(   s   matchs   dict(    (    s   ./omniidl/output.pys   replace^ s    s   
N(   s   dicts   updates   ldicts   replaces   strings   splits   selfs   regexs   subs   texts   ls   files   writes   istrings   indent(   s   selfs   texts   ldicts   dicts   ls   replace(    (    s   ./omniidl/output.pys   outY s   % 	c    s   g h j | i | ƒ l | d „ } p xR t i |  i i | | ƒ d ƒ Dp ], } q |  i i | ƒ r |  i i d ƒ qJ Wd S(   s/   Output a multi-line string without indentation.c    sJ   l m |  i d ƒ d j o m d Sn n t |  i d ƒ t ƒ  | ƒ Sd  S(   Ni   s    s   @(   s   matchs   groups   evals   globalss   dict(   s   matchs   dict(    (    s   ./omniidl/output.pys   replacel s    s   
N(   s   dicts   updates   ldicts   replaces   strings   splits   selfs   regexs   subs   texts   ls   files   write(   s   selfs   texts   ldicts   dicts   ls   replace(    (    s   ./omniidl/output.pys   nioutg s   % 	(	   s   __doc__s   __init__s   res   compiles   regexs
   inc_indents
   dec_indents   outs   niout(    (    (    s   ./omniidl/output.pys   Stream& s   	&(   s   __doc__s   res   strings   Stream(   s   res   strings   Stream(    (    s   ./omniidl/output.pys   ?" s   