� ,�Re�#��^�dZddlmZGd�de��Zeddddd��ZdZejZeZd Zd d l Td d l Td d l Td d l m Z mZd d lTd d l Td d l mZd d lTd d lmZd dlmZmZmZd dlmZd dlmZmZde��vreZde��vreZde��vreZeeezz Zgd�ZdS)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 ``", !"``), built up using :class:`Word`, :class:`Literal`, and :class:`And` elements (the :meth:`'+'` 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:`'+'`, :class:`'|'`, :class:`'^'` and :class:`'&'` 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:`'+'`, :class:`'|'`, :class:`'^'`, and :class:`'&'` 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�d�eZdZUeed<eed<eed<eed<eed<ed���Zd�Zd�Z d S) � version_info�major�minor�micro� releaselevel�serialc���d�|j|j|j��d�|jddkrdnd|jd|j��df|jdkzS)Nz{}.{}.{}z{}{}{}r�c�r��final)�formatrrrr r ��selfs ��/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/__init__.py� __version__zversion_info.__version__js�� � � �d�j�$�*�d�j� A� A�����,�Q�/�3�6�6�C�C�B��%�a�(��K��� � ���7�*�,� ,� �c�N�d�t|jt��S)Nz {} {} / {})r�__name__r�__version_time__rs r�__str__zversion_info.__str__xs���"�"�8�T�-=�?O�P�P�Prc ��d�tt|��jd�d�t |j|��D������S)Nz {}.{}({})z, c3�*K�|]}dj|�V��dS)z{}={!r}N)r)�.0�nvs r� z(version_info.__repr__..s-����N�N��&�i�&��+�N�N�N�N�N�Nr)rr�type�join�zip�_fieldsrs r�__repr__zversion_info.__repr__{sS���!�!� � ��J�J� � �I�I�N�N�c�$�,��6M�6M�N�N�N� N� N� � � rN) r� __module__� __qualname__�int�__annotations__�str�propertyrrr#�rrrrcs�������� �J�J�J� �J�J�J� �J�J�J����� �K�K�K� �  �  ��X�  �Q�Q�Q� � � � � rr�� rz05 May 2022 07:02 UTCz+Paul McGuire �)�*)�__diag__� __compat__)�_builtin_exprs)� unicode_set�UnicodeRangeList�pyparsing_unicode)�pyparsing_test)�pyparsing_commonr1r4r6r5)�rr� __author__r0r/�And� AtLineStart� AtStringStart�CaselessKeyword�CaselessLiteral� CharsNotIn�Combine�Dict�Each�Empty� FollowedBy�Forward� GoToColumn�Group� IndentedBlock�Keyword�LineEnd� LineStart�Literal�Located� PrecededBy� MatchFirst�NoMatch�NotAny� OneOrMore�OnlyOnce�OpAssoc�Opt�Optional�Or�ParseBaseException�ParseElementEnhance�ParseException�ParseExpression�ParseFatalException� ParseResults�ParseSyntaxException� ParserElement� PositionToken� QuotedString�RecursiveGrammarException�Regex�SkipTo� StringEnd� StringStart�Suppress�Token�TokenConverter�White�Word�WordEnd� WordStart� ZeroOrMore�Char� alphanums�alphas� alphas8bit� any_close_tag� any_open_tag�c_style_comment�col�common_html_entity� counted_array�cpp_style_comment�dbl_quoted_string�dbl_slash_comment�delimited_list�dict_of�empty�hexnums� html_comment� identchars�identbodychars�java_style_comment�line�line_end� line_start�lineno�make_html_tags� make_xml_tags�match_only_at_col�match_previous_expr�match_previous_literal� nested_expr�null_debug_action�nums�one_of� printables�punc8bit�python_style_comment� quoted_string� remove_quotes� replace_with�replace_html_entity� rest_of_line�sgl_quoted_string�srange� string_end� string_start�trace_parse_action�unicode_string�with_attribute� indentedBlock�original_text_for�ungroup�infix_notation� locatedExpr� with_class� CloseMatch� token_mapr6r4r2�condition_as_parse_actionr5�__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� withAttributer��originalTextFor� infixNotationr�� withClass�tokenMap�conditionAsParseAction�autoname_elementsN)�__doc__�typingrr�__version_info__rrr�r7�util� exceptions�actions�corer/r0�resultsr1�core_builtin_exprs�helpers�helper_builtin_exprs�unicoder2r3r4�testingr5�commonr6�common_builtin_exprs�globals�__all__r*rr�r�s���2F ��N������ � � � � �:� � � �@ �<��1�a��!�4�4��*���*� �"�� :� �������������&�&�&�&�&�&�&�&���������6�6�6�6�6�6�����;�;�;�;�;�;�P�P�P�P�P�P�P�P�P�P�.�.�.�.�.�.��������� �g�g�i�i�'�'����W�W�Y�Y�&�&����7�7�9�9�$�$��N��*�-A�A�A��f �f �f ���r