Commit f0b1d3ff authored by Eckhart Arnold's avatar Eckhart Arnold

- prepared for packaging

parent 2b66993d
......@@ -17,4 +17,5 @@ DEBUG*
LOGS/
external_resources/
tmp/
build/
dist/
DHParser Version 0.6.0 (23.4.2017)
..................................
first public release
......@@ -18,9 +18,14 @@ implied. See the License for the specific language governing
permissions and limitations under the License.
"""
import os
# Flat namespace for the DHParser Package. Is this a good idea...?
from .toolkit import *
from .syntaxtree import *
from .parsers import *
from .ebnf import *
from .dsl import *
from .versionnumber import __version__
__version__ = '0.5.4' + '_dev' + str(os.stat(__file__).st_mtime)
__all__ = ['toolkit', 'syntaxtree', 'parsercombinators', 'EBNFcompiler', 'DSLsupport']
__author__ = "Eckhart Arnold <eckhart.arnold@posteo.de>"
__author__ = "Eckhart Arnold <arnold@badw.de>"
__copyright__ = "http://www.apache.org/licenses/LICENSE-2.0"
__all__ = ['toolkit', 'syntaxtree', 'parsers', 'ebnf', 'dsl']
#!/usr/bin/python3
"""dsl.py - Support for domain specific notations for DHParser
Copyright 2016 by Eckhart Arnold (arnold@badw.de)
......
#!/usr/bin/python3
"""ebnf.py - EBNF -> Python-Parser compilation for DHParser
Copyright 2016 by Eckhart Arnold (arnold@badw.de)
......@@ -26,7 +24,6 @@ try:
except ImportError:
import re
from .__init__ import __version__
from .toolkit import load_if_file, escape_re, md5, sane_parser_name
from .parsers import GrammarBase, mixin_comment, Forward, RE, NegativeLookahead, \
Alternative, Sequence, Optional, Required, OneOrMore, ZeroOrMore, Token, CompilerBase, \
......@@ -34,6 +31,7 @@ from .parsers import GrammarBase, mixin_comment, Forward, RE, NegativeLookahead,
from .syntaxtree import Node, traverse, remove_enclosing_delimiters, reduce_single_child, \
replace_by_single_child, TOKEN_KEYWORD, remove_expendables, remove_tokens, flatten, \
forbid, assert_content, WHITESPACE_KEYWORD
from .versionnumber import __version__
__all__ = ['EBNFGrammar',
......
#!/usr/bin/python3
"""parsers.py - parser combinators for for DHParser
Copyright 2016 by Eckhart Arnold (arnold@badw.de)
......
#!/usr/bin/python3
"""syntaxtree.py - syntax tree classes and transformation functions for
converting the concrete into the abstract syntax tree for DHParser
......
#!/usr/bin/python3
"""toolkit.py - utility functions for DHParser
Copyright 2016 by Eckhart Arnold (arnold@badw.de)
......
"""_versionnumber.py - contains the verison number of DHParser
Copyright 2016 by Eckhart Arnold (arnold@badw.de)
Bavarian Academy of Sciences an Humanities (badw.de)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
"""
import os
__version__ = '0.6.0' + '_dev' + str(os.stat(__file__).st_mtime)
include *.py
include *.txt
include *.md
include LICENSE.*
include MANIFEST.*
include *.sh
include *.cfg
include test/run.py
include examples/EBNF/EBNF.ebnf
#!/bin/sh
python setup.py sdist bdist
# EBNF-Grammar in EBNF
@ comment = /#.*(?:\n|$)/ # comments start with '#' and eat all chars up to and including '\n'
@ whitespace = /\s*/ # whitespace includes linefeed
@ literalws = right # trailing whitespace of literals will be ignored tacitly
syntax = [~//] { definition | directive } §EOF
definition = symbol §"=" expression
directive = "@" §symbol §"=" ( regexp | literal | list_ )
expression = term { "|" term }
term = { factor }+
factor = [flowmarker] [retrieveop] symbol !"=" # negative lookahead to be sure it's not a definition
| [flowmarker] literal
| [flowmarker] regexp
| [flowmarker] group
| [flowmarker] regexchain
| [flowmarker] oneormore
| repetition
| option
flowmarker = "!" | "&" | "§" | # '!' negative lookahead, '&' positive lookahead, '§' required
"-!" | "-&" # '-' negative lookbehind, '-&' positive lookbehind
retrieveop = "::" | ":" # '::' pop, ':' retrieve
group = "(" expression §")"
regexchain = ">" expression §"<" # compiles "expression" into a singular regular expression
oneormore = "{" expression "}+"
repetition = "{" expression §"}"
option = "[" expression §"]"
link = regexp | symbol | literal # semantic restriction: symbol must evaluate to a regexp or chain
symbol = /(?!\d)\w+/~ # e.g. expression, factor, parameter_list
literal = /"(?:[^"]|\\")*?"/~ # e.g. "(", '+', 'while'
| /'(?:[^']|\\')*?'/~ # whitespace following literals will be ignored tacitly.
regexp = /~?\/(?:[^\/]|(?<=\\)\/)*\/~?/~ # e.g. /\w+/, ~/#.*(?:\n|$)/~
# '~' is a whitespace-marker, if present leading or trailing
# whitespace of a regular expression will be ignored tacitly.
list_ = /\w+/~ { "," /\w+/~ } # comma separated list of symbols, e.g. BEGIN_LIST, END_LIST,
# BEGIN_QUOTE, END_QUOTE ; see CommonMark/markdown.py for an exmaple
EOF = !/./
This diff is collapsed.
[bdist_wheel]
universal = 1
from distutils.core import setup
with open('README.md', encoding='utf-8') as f:
read_me = f.read()
setup(
name='DHParser',
version='0.6.0',
packages=['DHParser'],
url='https://gitlab.lrz.de/badw-it/DHParser',
license='APACHE 2.0 (http://www.apache.org/licenses/LICENSE-2.0)',
author='Eckhart Arnold',
author_email='arnold@badw.de',
description='DHParser - Domain specific language support for the Digital Humanities',
long_description = read_me,
keywords='Digital Humanities, domain specific languages, parser combinators, EBNF',
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Environment :: Console',
'License :: OSI Approved :: Apache Software License',
'Topic :: Text Processing :: Markup',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: Stackless'
]
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment