diff options
| author | Jonas Smedegaard <dr@jones.dk> | 2025-05-26 13:02:00 +0200 |
|---|---|---|
| committer | Jonas Smedegaard <dr@jones.dk> | 2025-05-26 13:02:00 +0200 |
| commit | a3eb7e16a727849c58cbabe3b1b9ef64b6f740f6 (patch) | |
| tree | b173b77fcbd7355d409df8a9cfc1362518569c75 /syntax/Attribute.py | |
| parent | cc6f0bb498635e85fa7938d34051af1e6ec0df37 (diff) | |
restructure PEG for simpler adding SemWord
Diffstat (limited to 'syntax/Attribute.py')
| -rwxr-xr-x | syntax/Attribute.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/syntax/Attribute.py b/syntax/Attribute.py new file mode 100755 index 0000000..c899252 --- /dev/null +++ b/syntax/Attribute.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 + +# Copyright 2025, Jonas Smedegaard <dr@jones.dk> +# SPDX-License-Identifier: GPL-3+ + +from railroad import * + +Diagram( + "[[:alpha:]]", + "[[:alnum:]]*", + NonTerminal("_?"), + "=", + NonTerminal("_?"), + Choice(0, + Sequence( + '"', + "[[:alnum:]]*", + '"', + ), + "[[:alnum:]]*" + ), + type="complex" +).writeStandalone(sys.stdout.write) |
