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
8ec9ed34
Commit
8ec9ed34
authored
Jul 20, 2017
by
di68kap
Browse files
- MLW: EytmologiePosition neu
parent
89148145
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
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