From b39149eae9a046dea7367ea0423fb7e7a27149a2 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 26 May 2025 11:00:33 +0200 Subject: rename syntax definitions: drop prefix def_ --- syntax/List.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 syntax/List.py (limited to 'syntax/List.py') diff --git a/syntax/List.py b/syntax/List.py new file mode 100755 index 0000000..a6d8afc --- /dev/null +++ b/syntax/List.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 + +# Copyright 2025, Jonas Smedegaard +# SPDX-License-Identifier: GPL-3+ + +from railroad import * + +Diagram( + Choice(0, + "[-*]", + Sequence( + "[[:digit:]]+", + "[).]", + ) + ), + Choice(0, + Sequence( + NonTerminal("_"), + Choice(0, + NonTerminal("List"), + NonTerminal("Words") + ) + ), + Skip() + ), + NonTerminal("NEWLINE"), + type="complex" +).writeStandalone(sys.stdout.write) -- cgit v1.2.3