Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
DHParser
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
badw-it
DHParser
Commits
8ec9ed34
Commit
8ec9ed34
authored
Jul 20, 2017
by
di68kap
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- MLW: EytmologiePosition neu
parent
89148145
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
examples/MLW/MLW.ebnf
examples/MLW/MLW.ebnf
+11
-3
examples/MLW/tst_MLW_grammar.py
examples/MLW/tst_MLW_grammar.py
+7
-1
No files found.
examples/MLW/MLW.ebnf
View file @
8ec9ed34
...
...
@@ -57,7 +57,8 @@ genus = "maskulinum" | "m." |
## ETYMOLOGIE-POSITION ##
EtymologiePosition
EtymologiePosition = "ETYMOLOGIE" [LZ] EtymologieVarianten
EtymologieVarianten = { ( SW_LAT | SW_GRIECH ) !([LZ] ()) }+
#### ARTIKEL-KOPF ############################################################
...
...
@@ -77,8 +78,8 @@ BedeutungsPosition = { "BEDEUTUNG" [LZ] §Bedeutung }+
Bedeutung = (Interpretamente | Bedeutungskategorie) [Belege]
Bedeutungskategorie = /(?:(?![A-ZÄÖÜ][A-ZÄÖÜ]).)+/~ [LZ]
Interpretamente = LateinischeBedeutung [LZ] §DeutscheBedeutung [LZ]
LateinischeBedeutung =
"LAT"
/(?:(?![A-ZÄÖÜ][A-ZÄÖÜ]).)+/~
DeutscheBedeutung =
"DEU"
/(?:(?![A-ZÄÖÜ][A-ZÄÖÜ]).)+/~
LateinischeBedeutung =
SW_LAT
/(?:(?![A-ZÄÖÜ][A-ZÄÖÜ]).)+/~
DeutscheBedeutung =
SW_DEU
/(?:(?![A-ZÄÖÜ][A-ZÄÖÜ]).)+/~
Belege = "BELEGE" [LZ] { "*" EinBeleg }
EinBeleg = { !([LZ] ("*" | "BEDEUTUNG" | "AUTOR" | "NAME" | "ZUSATZ"))
/\s*.*\s*/ }+
...
...
@@ -92,6 +93,13 @@ ArtikelVerfasser = ("AUTORIN" | "AUTOR") Name
Name = { NAME | NAMENS_ABKÜRZUNG }+
#### Schlüsselwörter #########################################################
SW_LAT = "LATEINISCH" | "LAT"
SW_DEU = "DEUTSCH" | "DEUT"
SW_GRIECH = "GRIECHISCH" | "GRIECH" | "GRIE" | "GRI"
#### GENERISCHE UND ATOMARE AUSDRÜCKE ########################################
Beleg = Verweis
...
...
examples/MLW/t
e
st_MLW_grammar.py
→
examples/MLW/tst_MLW_grammar.py
View file @
8ec9ed34
...
...
@@ -22,8 +22,14 @@ limitations under the License.
import
sys
sys
.
path
.
extend
([
'../'
,
'../../'
])
from
DHParser
import
dsl
from
DHParser
import
testing
if
not
dsl
.
recompile_grammar
(
'MLW.ebnf'
,
force
=
True
):
# recompiles Grammar only if it has changed
with
open
(
'MLW_ebnf_ERRORS.txt'
)
as
f
:
print
(
f
.
read
())
sys
.
exit
(
1
)
from
MLWCompiler
import
get_grammar
,
get_transformer
error_report
=
testing
.
grammar_suite
(
'grammar_tests'
,
get_grammar
,
get_transformer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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