Commit 9447d26f authored by eckhart's avatar eckhart
Browse files

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