
l[Tc           @   s  d  Z  d d l Z d d l m Z m Z m Z m Z m Z d d l m	 Z	 m
 Z
 m Z m Z m Z m Z m Z m Z d d l m Z d d l m Z d d d	 d
 g Z d e f d     YZ d e f d     YZ d	 e f d     YZ d
 e f d     YZ d S(   s   
    pygments.lexers.modeling
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for modeling languages.

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iN(   t
   RegexLexert   includet   bygroupst   usingt   default(   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Numbert   Punctuation(   t	   HtmlLexer(   t   _stan_builtinst   ModelicaLexert	   BugsLexert	   JagsLexert	   StanLexerc           B   s  e  Z d  Z d Z d g Z d g Z d g Z e j e j	 BZ
 d Z i d e f d e j f d e j f g d	 6e d	  d
 e j d f d e f d e f d e j f d e j f d e j f d e j f d e j f d e j d f d e j f d e j d f e e f g d 6e d	  d e j f d e j d f e e j d f e d  g d 6e d	  e e j  d f e d  g d 6d
 e j d f d e j! f d e" e#  f d e j f g d 6Z$ RS(   s\   
    For `Modelica <http://www.modelica.org/>`_ source code.

    .. versionadded:: 1.1
    t   Modelicat   modelicas   *.mos   text/x-modelicas"   (?:'(?:[^\\']|\\.)+'|[a-zA-Z_]\w*)u   [\s﻿]+s   //[^\n]*\n?s	   /\*.*?\*/t
   whitespacet   "t   strings   [()\[\]{},;]+s   \.?[*^/+-]|\.|<>|[<>:=]=?s   \d+(\.?\d*[eE][-+]?\d+|\.\d*)s   \d+sl  (abs|acos|actualStream|array|asin|assert|AssertionLevel|atan|atan2|backSample|Boolean|cardinality|cat|ceil|change|Clock|Connections|cos|cosh|cross|delay|diagonal|div|edge|exp|ExternalObject|fill|floor|getInstanceName|hold|homotopy|identity|inStream|integer|Integer|interval|inverse|isPresent|linspace|log|log10|matrix|max|min|mod|ndims|noClock|noEvent|ones|outerProduct|pre|previous|product|Real|reinit|rem|rooted|sample|scalar|semiLinear|shiftSample|sign|sin|sinh|size|skew|smooth|spatialDistribution|sqrt|StateSelect|String|subSample|sum|superSample|symmetric|tan|tanh|terminal|terminate|time|transpose|vector|zeros)\bsX  (algorithm|annotation|break|connect|constant|constrainedby|der|discrete|each|else|elseif|elsewhen|encapsulated|enumeration|equation|exit|expandable|extends|external|final|flow|for|if|import|impure|in|initial|inner|input|loop|nondiscrete|outer|output|parameter|partial|protected|public|pure|redeclare|replaceable|return|stream|then|when|while)\bs   (and|not|or)\bsI   (block|class|connector|end|function|model|operator|package|record|type)\bt   classs   (false|true)\bs   within\bs   package-prefixt   roots   (function|record)\bs   (if|for|when|while)\bs   #pops   \\[\'"?\\abfnrtv]s6   (?i)<\s*html\s*>([^\\"]|\\.)+?(<\s*/\s*html\s*>|(?="))s   <|\\?[^"\\<]+(%   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypest   ret   DOTALLt	   MULTILINEt   flagst   _nameR   R   t   Singlet	   MultilineR   R
   t   DoubleR   R   R   t   Floatt   IntegerR	   t   BuiltinR   t   Reservedt   Wordt   Constantt   ClassR   t	   Namespacet   EscapeR   R   t   tokens(    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyR      sP   							
				c        >   B   s   e  Z d  Z d Z d d d g Z d g Z dq Z dr Z i da e f g db 6dc e	 j
 f g dd 6e dd  e db  de e e j e e  f df e j f dg dh j e e  e j f di e f dj e f dk e f dl e f dm e f dn e f g do 6Z dp   Z RS(s   sv   
    Pygments Lexer for `OpenBugs <http://www.openbugs.net/>`_ and WinBugs
    models.

    .. versionadded:: 1.6
    t   BUGSt   bugst   winbugst   openbugss   *.bugt   abst   arccost   arccosht   arcsint   arcsinht   arctant   arctanht   cloglogt   cost   cosht
   cumulativet   cutt   densityt   deviancet   equalst   exprt   gammapt   ilogitt   icloglogt   integralt   logt   logfactt   loggamt   logitt   maxt   mint   phis   post.p.valuet   pows   prior.p.valuet   probits   replicate.posts   replicate.priort   roundt   sint   sinht   solutiont   sqrtt   stept   tant   tanht   trunct   inprods
   interp.lint   inverset   logdett   means
   eigen.valst   odet   prods   p.valueMt   rankt   rankeds   replicate.postMt   sdt   sortt   sumt   Dt   It   Ft   Tt   Ct   dbernt   dbint   dcatt   dnegbint   dpoist   dhypert   dbetat   dchisqrt   ddexpt   dexpt   dflatt   dgammat   dgevt   dft   dggammat   dgpart   dloglikt   dlnormt   dlogist   dnormt   dpart   dtt   dunift   dweibt   dmultit   ddircht   dmnormt   dmtt   dwishs   \s+R   s   #.*$t   commentss   (model)(\s+)(\{)s   (for|in)(?![\w.])s   (%s)(?=\s*\()t   |s   [A-Za-z][\w.]*s&   [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?s   \[|\]|\(|\)|:|,|;s   <-|~s	   \+|-|\*|/s   [{}]R   c         C   s$   t  j d |  t  j  r d Sd Sd  S(   Ns   ^\s*model\s*{gffffff?g        (   R!   t   searcht   M(   t   text(    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyt   analyse_text   s    (>   s   absR8   R9   R:   R;   R<   R=   R>   R?   R@   RA   RB   RC   RD   RE   RF   RG   RH   RI   RJ   s   logRL   RM   RN   s   maxs   minRQ   s   post.p.values   pows   prior.p.valueRS   s   replicate.posts   replicate.priors   roundRU   RV   RW   RX   s   stepRZ   R[   R\   R]   s
   interp.linR^   R_   R`   s
   eigen.valsRa   Rb   s   p.valueMRc   Rd   s   replicate.postMRe   s   sorts   sumRh   Ri   Rj   Rk   Rl   (   Rm   Rn   Ro   Rp   Rq   Rr   Rs   Rt   Ru   Rv   Rw   Rx   Ry   Rz   R{   R|   R}   R~   R   R   R   R   R   R   R   R   R   R   R   (   R   R   R   R   R   R   t
   _FUNCTIONSt   _DISTRIBUTIONSR   R   R&   R   R   R   R0   R   R,   t   joinR	   R+   R   R   R2   R   (    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyR   c   sN   	               								c        2   B   s9  e  Z d  Z d Z d g Z d d g Z dl Z e d7   dm D  Z dn Z	 i dY e
 f g dZ 6d[ e f g d\ 6d] e j f d^ e j f g d_ 6e d_  e dZ  d` e e j e
 e  f da e j f db e j f dc dd j e e e	  e j f e d\  de e f df e f dg e f dh e f di e f g dj 6Z dk   Z RS(o   s=   
    Pygments Lexer for JAGS.

    .. versionadded:: 1.6
    t   JAGSt   jagss   *.jags   *.bugR7   R8   R9   R:   R;   R<   R=   R?   R@   R>   RE   t   expRI   t   ifelseRH   RK   RL   RM   RN   RQ   RR   RS   RT   RU   RV   RX   RY   RZ   R[   R\   R]   s
   interp.linR_   RO   R`   RP   Rb   Rg   Re   R^   Rc   Rf   t   tt   acost   acosht   asint   asinht   atanRk   Ri   c         c   s   |  ] } d  | Vq d S(   s   [dpq]%sN(    (   t   .0t   x(    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pys	   <genexpr>   s    t   bernt   betat   dchiqsqrRu   Rv   Rz   t   gammas	   gen.gammat   logist   lnormt   negbint   nchisqrt   normt   part   poist   weibR   R   t   dbetabinRm   Rn   Ro   Rr   R   R   R   R   R   t   dbinomt   dchisqt   dnbinomt   dweibullt   ddirichs   \s+R   s   [a-zA-Z][\w.]*\bt   namess   (?s)/\*.*?\*/s   #.*$R   s   (model|data)(\s+)(\{)s   var(?![\w.])s   (for|in)(?![\w.])s   (%s)(?=\s*\()R   s&   [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?s   \[|\]|\(|\)|:|,|;s   <-|~s&   \+|-|\*|\/|\|\|[&]{2}|[<>=]=?|\^|%.*?%s   [{}]R   c         C   s_   t  j d |  t  j  rW t  j d |  t  j  r4 d St  j d |  t  j  rP d Sd Sn d Sd  S(   Ns   ^\s*model\s*\{s   ^\s*data\s*\{g?s   ^\s*varg333333?i    (   R!   R   R   (   R   (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyR     s    (2   s   abss   arccoss   arccoshs   arcsins   arcsinhs   arctans   arctanhs   coss   coshs   cloglogs   equalsR   s   icloglogR   s   ilogits   logs   logfacts   loggams   logits   phis   pows   probits   rounds   sins   sinhs   sqrts   steps   tans   tanhs   truncs   inprods
   interp.lins   logdets   maxs   means   mins   prods   sums   sds   inverses   ranks   sortR   R   R   R   R   R   Rk   Ri   (   R   R   R   s   ddexps   dexps   dfR   s	   gen.gammaR   R   R   R   R   R   R   R   (   s   dts   dunifR   s   dberns   dbins   dcats   dhypers   ddirchs   dmnorms   dwishs   dmts   dmultiR   R   R   R   R   (   R   R   R   R   R   R   R   t   tupleR   t   _OTHER_DISTRIBUTIONSR   R	   R   R'   R&   R   R   R   R0   R   t   DeclarationR,   R   R+   R   R   R2   R   (    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyR      sP   	       	    									c           B   s  e  Z d  Z d Z d g Z d g Z i d e f g d 6d e j f d e j	 f g d 6d	 e
 f e d  e d  d
 d j d!  e e j e e  f d d j e j  e f d e f d d j e j  e j f d e f d d j e j e j  e j f d e j j f d d j e j  e j f d e f d e j f d e j f d e j f d e f d e f d e f g d 6Z  d    Z! RS("   s  Pygments Lexer for Stan models.

    The Stan modeling language is specified in the *Stan Modeling Language
    User's Guide and Reference Manual, v2.4.0*,
    `pdf <https://github.com/stan-dev/stan/releases/download/v2.4.0/stan-reference-2.4.0.pdf>`__.

    .. versionadded:: 1.6
    t   Stant   stans   *.stans   \s+R   s   (?s)/\*.*?\*/s	   (//|#).*$R   s   "[^"]*"s   (%s)(\s*)(\{)R   t	   functionst   datas   transformed\s+?datat
   parameterss   transformed\s+parameterst   models   generated\s+quantitiess   (%s)\bs
   T(?=\s*\[)s   [;:,\[\]()]s   (%s)(?=\s*\()s   [A-Za-z]\w*__\bs   [A-Za-z]\w*\bs   -?[0-9]+(\.[0-9]+)?[eE]-?[0-9]+s   -?[0-9]*\.[0-9]*s   -?[0-9]+s   <-|~s/   \+|-|\.?\*|\.?/|\\|'|\^|==?|!=?|<=?|>=?|\|\||&&s   [{}]R   c         C   s$   t  j d |  t  j  r d Sd Sd  S(   Ns   ^\s*parameters\s*\{g      ?g        (   R!   R   R   (   R   (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyR   `  s    (   R   s   datas   transformed\s+?dataR   s   transformed\s+parametersR   s   generated\s+quantities("   R   R   R   R   R   R   R   R   R'   R&   R
   R   R   R   R   R0   R   R   t   KEYWORDSt   TYPESt   Typet	   FUNCTIONSt   DISTRIBUTIONSR	   R+   t   Pseudot   RESERVEDR,   R   R)   R*   R   R2   R   (    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyR     sD   					 						(   R   R!   t   pygments.lexerR    R   R   R   R   t   pygments.tokenR   R   R   R   R	   R
   R   R   t   pygments.lexers.htmlR   t   pygments.lexersR   t   __all__R   R   R   R   (    (    (    s<   /usr/lib/python2.7/dist-packages/pygments/lexers/modeling.pyt   <module>
   s   (:K`X