Commit 9447d26f authored by eckhart's avatar eckhart

- parser.py renamed to parsers.py to avoid name conflicts with python stock parser module

parent 66927bcd
......@@ -22,7 +22,7 @@ permissions and limitations under the License.
from .error import *
from .dsl import *
from .ebnf import *
from .parser import *
from .parsers import *
from .stringview import *
from .syntaxtree import *
from .toolkit import *
......
......@@ -25,7 +25,7 @@ from DHParser.ebnf import EBNFCompiler, grammar_changed, \
get_ebnf_preprocessor, get_ebnf_grammar, get_ebnf_transformer, get_ebnf_compiler, \
PreprocessorFactoryFunc, ParserFactoryFunc, TransformerFactoryFunc, CompilerFactoryFunc
from DHParser.error import Error, is_error, has_errors, only_errors
from DHParser.parser import Grammar, Compiler, compile_source, nil_preprocessor, PreprocessorFunc
from DHParser.parsers import Grammar, Compiler, compile_source, nil_preprocessor, PreprocessorFunc
from DHParser.syntaxtree import Node, TransformationFunc
from DHParser.toolkit import logging, load_if_file, is_python_code, compile_python_object, \
re, typing
......
......@@ -21,7 +21,7 @@ from collections import OrderedDict
from functools import partial
from DHParser.error import Error
from DHParser.parser import Grammar, mixin_comment, nil_preprocessor, Forward, RegExp, RE, \
from DHParser.parsers import Grammar, mixin_comment, nil_preprocessor, Forward, RegExp, RE, \
NegativeLookahead, Alternative, Series, Option, OneOrMore, ZeroOrMore, Token, \
Compiler, PreprocessorFunc
from DHParser.syntaxtree import Node, TransformationFunc, WHITESPACE_PTYPE, TOKEN_PTYPE
......
This diff is collapsed.
......@@ -81,7 +81,7 @@ def real_indices(begin: Optional[int],
class StringView(collections.abc.Sized):
"""
A rudimentary StringView class, just enough for the use cases
in parser.py. The difference between a StringView and the python
in parsers.py. The difference between a StringView and the python
builtin strings is that StringView-objects do slicing without
copying, i.e. slices are just a view on a section of the sliced
string.
......
......@@ -23,7 +23,7 @@ sys.path.append('../')
from DHParser import toolkit
from DHParser import syntaxtree
from DHParser import parser
from DHParser import parsers
from DHParser import transform
from DHParser import ebnf
from DHParser import dsl
......@@ -33,7 +33,7 @@ from DHParser import versionnumber
symbols_table = {
'toolkit': list(toolkit.__all__),
'syntaxtree': list(syntaxtree.__all__),
'parser': list(parser.__all__),
'parser': list(parsers.__all__),
'transform': list(transform.__all__),
'ebnf': list(ebnf.__all__),
'dsl': list(dsl.__all__),
......
......@@ -33,7 +33,7 @@ except ImportError:
from DHParser import toolkit
from DHParser import syntaxtree
from DHParser import parser
from DHParser import parsers
from DHParser import transform
from DHParser import ebnf
from DHParser import dsl
......
......@@ -25,7 +25,7 @@ import sys
from DHParser.dsl import compileDSL, compile_on_disk
from DHParser.ebnf import get_ebnf_grammar, get_ebnf_transformer, get_ebnf_compiler
from DHParser.parser import compile_source
from DHParser.parsers import compile_source
from DHParser.toolkit import logging
EBNF_TEMPLATE = r"""-grammar
......
......@@ -14,7 +14,7 @@ try:
import regex as re
except ImportError:
import re
from DHParser.parser import Grammar, Compiler, Alternative, Required, Token, \
from DHParser.parsers import Grammar, Compiler, Alternative, Required, Token, \
Option, OneOrMore, Series, RE, ZeroOrMore, NegativeLookahead, mixin_comment, compile_source
from DHParser.syntaxtree import traverse, reduce_single_child, replace_by_single_child, no_transformation, \
remove_expendables, remove_tokens, flatten, \
......
......@@ -7,7 +7,7 @@ import sys
sys.path.extend(['../../', '../', './'])
from DHParser.toolkit import logging
from DHParser.parser import compile_source
from DHParser.parsers import compile_source
from DHParser.dsl import recompile_grammar
if not recompile_grammar('MLW.ebnf', force=False): # recompiles Grammar only if it has changed
......
......@@ -18,7 +18,7 @@ try:
except ImportError:
import re
from DHParser.toolkit import logging, is_filename
from DHParser.parser import Grammar, Compiler, Required, Token, \
from DHParser.parsers import Grammar, Compiler, Required, Token, \
Option, OneOrMore, Series, RE, ZeroOrMore, NegativeLookahead, mixin_comment, compile_source, \
PreprocessorFunc, Synonym
from DHParser.syntaxtree import Node, traverse, remove_last, \
......
......@@ -24,7 +24,7 @@ import os
import sys
sys.path.extend(['../', './'])
from DHParser.parser import Grammar, Compiler
from DHParser.parsers import Grammar, Compiler
from DHParser.error import is_error
from DHParser.dsl import compile_on_disk, run_compiler, compileEBNF, grammar_provider, \
load_compiler_suite
......
......@@ -26,7 +26,7 @@ from multiprocessing import Pool
sys.path.extend(['../', './'])
from DHParser.toolkit import compile_python_object, re
from DHParser.parser import compile_source, nil_preprocessor
from DHParser.parsers import compile_source, nil_preprocessor
from DHParser.error import has_errors
from DHParser.syntaxtree import WHITESPACE_PTYPE
from DHParser.ebnf import get_ebnf_grammar, get_ebnf_transformer, EBNFTransform, get_ebnf_compiler
......
......@@ -28,7 +28,7 @@ from DHParser.toolkit import is_logging, logging, compile_python_object
from DHParser.stringview import StringView
from DHParser.error import Error
from DHParser.syntaxtree import mock_syntax_tree
from DHParser.parser import compile_source, Retrieve, Grammar, Forward, Token, ZeroOrMore, RE, \
from DHParser.parsers import compile_source, Retrieve, Grammar, Forward, Token, ZeroOrMore, RE, \
RegExp, Lookbehind, NegativeLookahead, OneOrMore, Series, Alternative, AllOf, SomeOf, Compiler
from DHParser.ebnf import get_ebnf_grammar, get_ebnf_transformer, get_ebnf_compiler
from DHParser.dsl import grammar_provider, DHPARSER_IMPORTS
......
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