aboutsummaryrefslogtreecommitdiff
path: root/syntax/def_SemWord.py
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-05-26 10:05:06 +0200
committerJonas Smedegaard <dr@jones.dk>2025-05-26 10:10:36 +0200
commitaba01b80e7ea75438db7933f9430997bc853250f (patch)
tree650aa3983f1483243755b0de9ddeaad63bcbb851 /syntax/def_SemWord.py
parent881490dfec59f22b648766ea083cf23c0b29eaba (diff)
add syntax SemWord
Diffstat (limited to 'syntax/def_SemWord.py')
-rwxr-xr-xsyntax/def_SemWord.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/syntax/def_SemWord.py b/syntax/def_SemWord.py
new file mode 100755
index 0000000..d0768ad
--- /dev/null
+++ b/syntax/def_SemWord.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+
+# Copyright 2025, Jonas Smedegaard <dr@jones.dk>
+# SPDX-License-Identifier: GPL-3+
+
+from railroad import *
+
+Diagram(
+ Choice(0,
+ Sequence(
+ NonTerminal("SEMPREFIX"),
+ "<",
+ NonTerminal("![<>] PRINTABLES"),
+ ">",
+ ),
+ Sequence(
+ NonTerminal("SEMPREFIX"),
+ NonTerminal("CURIE"),
+ )
+ ),
+ type="complex"
+).writeStandalone(sys.stdout.write)