a
    Ö¶îa‡#  ã                   @   s  d Z ddlmZ G dd„ deƒZedddddƒZdZejZeZd	Zd
dl	T d
dl
T d
dlT d
dlmZmZ d
dlT d
dlT d
dlmZ d
dlT d
dlmZ d
dlmZmZmZ d
dlmZ d
dlmZmZ deƒ vrØeZdeƒ vræeZdeƒ vrôeZeee 7 Zg d¢ZdS )a  
pyparsing module - Classes and methods to define and execute parsing grammars
=============================================================================

The pyparsing module is an alternative approach to creating and
executing simple grammars, vs. the traditional lex/yacc approach, or the
use of regular expressions.  With pyparsing, you don't need to learn
a new syntax for defining grammars or matching expressions - the parsing
module provides a library of classes that you use to construct the
grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form
``"<salutation>, <addressee>!"``), built up using :class:`Word`,
:class:`Literal`, and :class:`And` elements
(the :meth:`'+'<ParserElement.__add__>` operators create :class:`And` expressions,
and the strings are auto-converted to :class:`Literal` expressions)::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print(hello, "->", greet.parse_string(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the
self-explanatory class names, and the use of :class:`'+'<And>`,
:class:`'|'<MatchFirst>`, :class:`'^'<Or>` and :class:`'&'<Each>` operators.

The :class:`ParseResults` object returned from
:class:`ParserElement.parseString` can be
accessed as a nested list, a dictionary, or an object with named
attributes.

The pyparsing module handles some of the problems that are typically
vexing when writing text parsers:

  - extra or missing whitespace (the above program will also handle
    "Hello,World!", "Hello  ,  World  !", etc.)
  - quoted strings
  - embedded comments


Getting Started -
-----------------
Visit the classes :class:`ParserElement` and :class:`ParseResults` to
see the base classes that most other pyparsing
classes inherit from. Use the docstrings for examples of how to:

 - construct literal match expressions from :class:`Literal` and
   :class:`CaselessLiteral` classes
 - construct character word-group expressions using the :class:`Word`
   class
 - see how to create repetitive expressions using :class:`ZeroOrMore`
   and :class:`OneOrMore` classes
 - use :class:`'+'<And>`, :class:`'|'<MatchFirst>`, :class:`'^'<Or>`,
   and :class:`'&'<Each>` operators to combine simple expressions into
   more complex ones
 - associate names with your parsed results using
   :class:`ParserElement.setResultsName`
 - access the parsed data, which is returned as a :class:`ParseResults`
   object
 - find some helpful expression short-cuts like :class:`delimitedList`
   and :class:`oneOf`
 - find more useful common expressions in the :class:`pyparsing_common`
   namespace class
é    )Ú
NamedTuplec                   @   sR   e Zd ZU eed< eed< eed< eed< eed< edd„ ƒZdd	„ Zd
d„ Z	dS )Úversion_infoÚmajorÚminorÚmicroÚreleaselevelÚserialc                 C   sJ   d  | j| j| j¡d  | jd dkr(dnd| jd | j¡df| jdk  S )Nz{}.{}.{}z{}{}{}r   ÚcÚrÚ Úfinal)Úformatr   r   r   r   r   ©Úself© r   úb/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/pyparsing/__init__.pyÚ__version__j   s    ýúùzversion_info.__version__c                 C   s   d  t| jt¡S )Nz
{} {} / {})r   Ú__name__r   Ú__version_time__r   r   r   r   Ú__str__u   s    zversion_info.__str__c              
   C   s,   d  tt| ƒjd dd„ t| j| ƒD ƒ¡¡S )Nz	{}.{}({})z, c                 s   s   | ]}d j |Ž V  qdS )z{}={!r}N)r   )Ú.0Únvr   r   r   Ú	<genexpr>|   ó    z(version_info.__repr__.<locals>.<genexpr>)r   r   ÚtypeÚjoinÚzipÚ_fieldsr   r   r   r   Ú__repr__x   s
    ýzversion_info.__repr__N)
r   Ú
__module__Ú__qualname__ÚintÚ__annotations__ÚstrÚpropertyr   r   r   r   r   r   r   r   c   s   


r   é   é   r   z15 Jan 2022 04:10 UTCz+Paul McGuire <ptmcg.gm+pyparsing@gmail.com>é   )Ú*)Ú__diag__Ú
__compat__)Ú_builtin_exprs)Úunicode_setÚUnicodeRangeListÚpyparsing_unicode)Úpyparsing_test)Úpyparsing_commonr+   r.   r0   r/   )¤r   r   Ú
__author__r*   r)   ÚAndZAtLineStartZAtStringStartÚCaselessKeywordÚCaselessLiteralÚ
CharsNotInÚCombineÚDictÚEachÚEmptyÚ
FollowedByÚForwardÚ
GoToColumnÚGroupZIndentedBlockÚKeywordÚLineEndÚ	LineStartÚLiteralZLocatedÚ
PrecededByÚ
MatchFirstÚNoMatchÚNotAnyÚ	OneOrMoreÚOnlyOnceZOpAssocZOptÚOptionalÚOrÚParseBaseExceptionÚParseElementEnhanceÚParseExceptionÚParseExpressionÚParseFatalExceptionÚParseResultsÚParseSyntaxExceptionÚParserElementZPositionTokenÚQuotedStringÚRecursiveGrammarExceptionÚRegexÚSkipToÚ	StringEndÚStringStartÚSuppressÚTokenÚTokenConverterÚWhiteÚWordÚWordEndÚ	WordStartÚ
ZeroOrMoreÚCharÚ	alphanumsÚalphasÚ
alphas8bitZany_close_tagZany_open_tagZc_style_commentÚcolZcommon_html_entityZcounted_arrayZcpp_style_commentZdbl_quoted_stringZdbl_slash_commentZdelimited_listZdict_ofÚemptyÚhexnumsZhtml_commentZ
identcharsZidentbodycharsZjava_style_commentÚlineZline_endZ
line_startÚlinenoZmake_html_tagsZmake_xml_tagsZmatch_only_at_colZmatch_previous_exprZmatch_previous_literalZnested_exprZnull_debug_actionÚnumsZone_ofÚ
printablesÚpunc8bitZpython_style_commentZquoted_stringZremove_quotesZreplace_withZreplace_html_entityZrest_of_lineZsgl_quoted_stringÚsrangeZ
string_endZstring_startZtrace_parse_actionZunicode_stringZwith_attributeÚindentedBlockZoriginal_text_forÚungroupZinfix_notationÚlocatedExprZ
with_classÚ
CloseMatchZ	token_mapr0   r.   r,   Zcondition_as_parse_actionr/   Ú__versionTime__ÚanyCloseTagÚ
anyOpenTagÚcStyleCommentÚcommonHTMLEntityÚcountedArrayÚcppStyleCommentÚdblQuotedStringÚdblSlashCommentÚdelimitedListÚdictOfÚhtmlCommentÚjavaStyleCommentÚlineEndÚ	lineStartÚmakeHTMLTagsÚmakeXMLTagsÚmatchOnlyAtColÚmatchPreviousExprÚmatchPreviousLiteralÚ
nestedExprÚnullDebugActionÚoneOfÚopAssocÚpythonStyleCommentÚquotedStringÚremoveQuotesÚreplaceHTMLEntityÚreplaceWithÚ
restOfLineÚsglQuotedStringÚ	stringEndÚstringStartÚtraceParseActionÚunicodeStringÚwithAttributerm   ÚoriginalTextForÚinfixNotationro   Ú	withClassÚtokenMapÚconditionAsParseActionZautoname_elementsN)Ú__doc__Útypingr   r   Ú__version_info__r   r   rq   r1   ÚutilÚ
exceptionsZactionsÚcorer)   r*   Úresultsr+   Zcore_builtin_exprsZhelpersZhelper_builtin_exprsÚunicoder,   r-   r.   Ztestingr/   Úcommonr0   Zcommon_builtin_exprsÚglobalsÚ__all__r   r   r   r   Ú<module>   s6   G


