Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
f16c582e
Commit
f16c582e
authored
Mar 02, 2017
by
di68kap
Browse files
- Fehlerkorrekturen in ParserCombinators... zur Zeit nicht lauffähig :-(
parent
fd01fd31
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
f16c582e
...
...
@@ -15,3 +15,4 @@ testdata/*.pdf
*.old
DEBUG*
external_resources/
tmp/
ParserCombinators.py
View file @
f16c582e
This diff is collapsed.
Click to expand it.
examples/EBNF/EBNF.ebnf
View file @
f16c582e
...
...
@@ -34,7 +34,7 @@ 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+\s*(?:,\s*\w+\s*)*/~ # comma separated list of symbols, e.g. BEGIN_LIST, END_LIST,
# BEGIN_QUOTE, END_QUOTE ; see markdown.py for an exmaple
# BEGIN_QUOTE, END_QUOTE ; see
CommonMark/
markdown.py for an exmaple
EOF = !/./
examples/MLW/compile_MLW-grammar.py
View file @
f16c582e
...
...
@@ -23,4 +23,8 @@ import os
import
sys
sys
.
path
.
append
(
os
.
path
.
abspath
(
'../'
))
from
ParserCombinators
import
run_compiler
run_compiler
(
"MLW.ebnf"
)
errors
=
run_compiler
(
"MLW.ebnf"
)
if
errors
:
print
(
errors
)
sys
.
exit
(
1
)
examples/MLW/samples/compile_MLW-entry.py
View file @
f16c582e
...
...
@@ -23,4 +23,7 @@ import os
import
sys
sys
.
path
.
append
(
os
.
path
.
abspath
(
'../'
))
from
ParserCombinators
import
run_compiler
run_compiler
(
"fascitergula.mlw"
,
os
.
path
.
join
(
'..'
,
'MLW_compiler.py'
),
".xml"
)
errors
=
run_compiler
(
"fascitergula.mlw"
,
os
.
path
.
join
(
'..'
,
'MLW_compiler.py'
),
".xml"
)
if
errors
:
print
(
errors
)
sys
.
exit
(
1
)
tests/PopRetrieveTest.txt
deleted
100644 → 0
View file @
fd01fd31
Anfang ```code block `` <- keine Ende-Zeichen ! ``` Ebde
tests/PopRetrieve.ebnf
→
tests/no_unit_
tests/PopRetrieve.ebnf
View file @
f16c582e
File moved
tests/no_unit_tests/PopRetrieveTest.txt
0 → 100644
View file @
f16c582e
Anfang ```code block `` <- keine Ende-Zeichen ! ``` Ende
tests/PopRetrieve
2
Test.txt
→
tests/no_unit_
tests/PopRetrieveTest
2
.txt
View file @
f16c582e
File moved
tests/no_unit_tests/compile_PopRetrieve_EBNF.py
0 → 100644
View file @
f16c582e
#!/usr/bin/python3
"""compile_MLW.py - simple utility script for compiling MLW.ebnf
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2017 Bavarian Academy of Sciences and Humanities
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
import
sys
sys
.
path
.
append
(
os
.
path
.
abspath
(
'../../'
))
from
ParserCombinators
import
run_compiler
,
has_source_changed
if
(
not
os
.
path
.
exists
(
'PopRetrieve_compiler.py'
)
or
has_source_changed
(
'PopRetrieve.ebnf'
,
'PopRetrieve_compiler.py'
)):
errors
=
run_compiler
(
"PopRetrieve.ebnf"
)
if
errors
:
print
(
errors
)
sys
.
exit
(
1
)
errors
=
run_compiler
(
"PopRetrieveTest.txt"
,
'PopRetrieve_compiler.py'
)
if
errors
:
print
(
errors
)
sys
.
exit
(
1
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment