Metadata-Version: 1.1
Name: PPark
Version: 1.0.0
Summary: Advanced Lexer
Home-page: https://github.com/aabbfive/PPark
Author: aabbfive
Author-email: diffyheart@gmail.com
License: MIT
Download-URL: https://github.com/aabbfive/PPark/releases
Description-Content-Type: UNKNOWN
Description: <h1 align="center">
          <br>
          <a href="https://github.com/aabbfive/PPark">
            <img src="PPark.svg" alt="PPark" width="200">
          </a>
          <br>
          PPark
          <br>
          <br>
        </h1>
        
        <h4 align="center">The best lexing library available any python version confused (2.x, 3.x, PyPy...)</h4>
        
        ## &#x1F4BE; Install
        
        Download the latest version of PPark from
        the [GitHub releases](https://github.com/aabbfive/PPark/releases) page.
        
        
        ## &#x1F4AC; How to Contribute
        
        ### Get the code
        
        ```
        $ git clone https://github.com/aabbfive/PPark.git
        $ cd PPark
        ```
        
        ### Install the library
        
        ```
        $ pip install PPark
        ```
        
        #### Or
        
        ```
        $ pip install git+https://github.com/aabbfive/PPark
        ```
        
        ### Examples
        
        ```
        from PPark import Lexer
        from PPark.constant import Keyword, Keywords
        
        lexer = Lexer()
        lexer.addRule('INTEGER', r'([0-9]+)')
        lexer.addRule('OP', Keywords([
        	Keyword('}'), 
        	Keyword('{'),
        	Keyword('^'),
        	Keyword(']'),
        	Keyword('['),
        	Keyword('>'),
        	Keyword('<'),
        	Keyword('='),
        	Keyword('.'),
        	Keyword('-'),
        	Keyword(','),
        	Keyword('+'),
        	Keyword('**'),
        	Keyword('*'),
        	Keyword('/'),
        	Keyword('//'),
        	Keyword('%'),
        	Keyword(')'),
        	Keyword('(')
        	]))
        @lexer.on_match(r'"([^"\n]|(\\"))*"')
        def STRING(token):
        	token.value = token.value[1:][:-1]
        @lexer.on_match(r'[a-zA-Z_$]\w*')
        def IDENTIFIER(token):
        	if keywords.contains(token.value):
        		token.type = token.value.upper()
        		return token
        lexer.input("""
        t = 12*2
        """)
        for token in lexer:
        	print(token)
        ```
        
        ## &#x00A9;&#xFE0F; License
        
        MIT. Copyright (c) [Aabbfive](https://github.com/aabbfive).
        
Keywords: lexer,ast,compiler
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Text Processing
