From 7e56c94c03727894dec1b65da923bb4bd532df52 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 23 May 2025 07:07:04 +0200 Subject: move syntax diagrams to subdir --- syntax/def_PlainWords.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 syntax/def_PlainWords.py (limited to 'syntax/def_PlainWords.py') diff --git a/syntax/def_PlainWords.py b/syntax/def_PlainWords.py new file mode 100755 index 0000000..eafe2fc --- /dev/null +++ b/syntax/def_PlainWords.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +# Copyright 2025, Jonas Smedegaard +# SPDX-License-Identifier: GPL-3+ + +from os.path import basename, splitext +from railroad import * + +Diagram( + NonTerminal("PRINTABLES"), + Choice(0, + OneOrMore( + NonTerminal("_"), + NonTerminal("PRINTABLES") + ), + Skip() + ), + type="complex" +).writeStandalone( + open(splitext(basename(__file__))[0] + ".svg", "w").write) -- cgit v1.2.3