{"id":15913173,"url":"https://github.com/tintinweb/ebnfspill","last_synced_at":"2025-09-05T11:05:09.356Z","repository":{"id":6199429,"uuid":"7430154","full_name":"tintinweb/EBNFSpill","owner":"tintinweb","description":"Create Random Data based on EBNF Syntax description (EBNF parser: simpleparse)","archived":false,"fork":false,"pushed_at":"2013-08-19T18:23:56.000Z","size":140,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-05T11:02:07.029Z","etag":null,"topics":["ebnf"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tintinweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-03T20:58:39.000Z","updated_at":"2025-06-01T04:17:29.000Z","dependencies_parsed_at":"2022-09-09T02:31:11.599Z","dependency_job_id":null,"html_url":"https://github.com/tintinweb/EBNFSpill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tintinweb/EBNFSpill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FEBNFSpill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FEBNFSpill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FEBNFSpill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FEBNFSpill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tintinweb","download_url":"https://codeload.github.com/tintinweb/EBNFSpill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FEBNFSpill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273747788,"owners_count":25160652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ebnf"],"created_at":"2024-10-06T16:23:24.179Z","updated_at":"2025-09-05T11:05:09.297Z","avatar_url":"https://github.com/tintinweb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"EBNFSpill\n=========\n\n* Create Random Data based on EBNF Syntax description\n* Validate EBNF definition (simpleparse's part)\n* Validate some data against EBNF (simpleparse's part)\n\nEBNF-Parser: simpleparse (EBNF-Grammars: http://simpleparse.sourceforge.net/simpleparse_grammars.html)\n\nEBNF-Description\n=======\n\nOur simple INI-file looks like this:\n\n\t[MyFirstSection]\n\tmyKey\t=\"myValue9_test-test2\"\n\tmyKey2\t=\"myValue9_test-test2\"\n\tmyKey3\t=\"myValue9_test-test2\"\n\tmyKey4\t=\"myValue9_test-test2\"\n\t\n\t[MySecond-Section]\n\tmyKey11\t=\"myValuexx33_test-test2\"\n\n\nEBNF Declaration for a simple INI-File-Syntax:\n\n\tfile              := (section, entry+, '\\n\\n')+\n\tsection           := '[', wordspecial, ']','\\n'\n\tentry             := word, '\\t=', '\"', wordspecial , '\"', '\\n'\n\talpha             := [a-zA-Z]\n\talphanum          := [a-zA-Z0-9]\n\talphanumspecial   := [a-zA-Z0-9_-]\n\tword              := alpha,alphanum*\n\twordspecial       := alpha,alphanumspecial*\n\nDescription:\n\n\t'file'           ... our root definition (aka production) which describes the overall file syntax\n\t'section'        ... Ini-file section header\n\t'entry'          ... one key=value entry\n\t'alpha'          ... alpha-chars only\n\t'alphanum'       ... alphanumerical chars\n\t'alphanumspecial'... alphanumerical and _- chars\n\t'word'           ... begins with alpha and continues with none or more alphanums\n\t'wordspecial'    ... begins with alpha and continues with none or more alphanumspecial chars\n\n\nEBNFSpill Example #1 - Generate Random Data that meets the syntax requirements\n=================\n\nEBNFSpill will now take any EBNF defintion that is valid and will try to create random data that matches the described syntax. For the above EBNF declaration this would be random data like this:\n\nCode:\n\n\tdeclaration = \"\"\"\n\tfile              := (section, entry+, '\\n\\n')+\n\t\n\tsection           := '[', wordspecial, ']','\\n'\n\tentry             := word, '\\t=', '\"', wordspecial , '\"', '\\n'\n\talpha             := [a-zA-Z]\n\talphanum          := [a-zA-Z0-9]\n\talphanumspecial   := [a-zA-Z0-9_-]\n\tword              := alpha,alphanum*\n\twordspecial       := alpha,alphanumspecial*\n\t\"\"\"\n\tfrom EBNFSpill import EBNFSpill\n\ts = EBNFSpill()\n\t# process declaration (feeds simpleparse with declaration and defines 'file' as entrypoint)\n\ts.setDeclaration(declaration,production=\"file\")\t\n\t# lets generate some random data\n\tprint b.generate()\n\t\nOutput:\n\n\t[JaW-I]\n\tMEk\t=\"RIO_ZC\"\n\tKG1HWR0BcYATBF0CpgS5h\t=\"IzOI5ECekj\"\n\tc8bDI3ozx3LnwnjpM2lz8\t=\"go8iJsKkJ44JI\"\n\tshX3KIJLQkvNEEq1Ja\t=\"E3usLXmAEifbDWOt\"\n\t\n\t\n\t[y7aM2A1QIpcThzPRc0ryFU]\n\tNg7fMShX4\t=\"Xq\"\n\td43i42sbool3BnI24e\t=\"t1d5GHD\"\n\t\n\t\n\t[EJ4ll]\n\tNuCG\t=\"J0WrZdTnheSQq\"\n\tRm6STRGxllBxlf9fLlEmEtwbgH\t=\"cU82WpNkrHR0CqseBltmGOETdf\"\n\tLSadRHDXJ0\t=\"G0Ir0FufaQJdSg9F\"\n\tR5T02vYsf\t=\"JaJaPIUPh0zSSYSM4wfA8pjOq\"\n\tr6zhJQ7K\t=\"GdYp9hMJjA8\"\n\tXMwdm\t=\"wMjUQ0ADRjkT7MPV5zG\"\n\t\n\t\n\t[PXj0N0hrfu9e6dKM9-ujmEHuoU]\n\td1QFqfbTuqHnVQbK\t=\"wwQ0-sykooiJp201HCwm73fD3\"\n\tfQuzvHP2pVwvS8G7UB6s\t=\"PjofofSqLK4Nv25baoAi_RR7D\"\n\tjtrOtloyXUHJUKe\t=\"k8P3WxPBRbwPrrh0\"\n\tuAuSDmzSVkSHNp0\t=\"MBLM6Lw\"\n\tzEAwWEmfNpt\t=\"ZkecJcD\"\n\tLcOuVkhLGJkCQYbI\t=\"gnj_n8_FE\"\n\tI7TjmZC6\t=\"ci1YzwboZz\"\n\t\n\t\n\t[IMw_fjT1jv]\n\tcIXGM8TQuM29aWnXi9aYK\t=\"UwL_q7RC0JKv7lkFPY\"\n\tmmNGyBCO6qTF2yKvelBki77Wz\t=\"b1UZDdc7vT\"\n\tTPDcJMTv6mMuOKAoNS1xLf\t=\"TSvbaGyW7K5nV\"\n\taA6qLkQC08\t=\"H3UBl852kRFXlsmoqoX3nO4eGZ\"\n\tz7xPM9YLNOro6FKvc1QqkL6zl\t=\"VwiMf6EdCdK6cG7MtCLdof9h\"\n\t\n\nEBNFSpill Example #2 - show prettyprint of AST-Table, Step-by-Step walk the AST generated by Simpleparse\n=======================\n\nCode:\n\n\tdeclaration = \"\"\"\n\tfile              := (section, entry+, '\\n\\n')+\n\t\n\tsection           := '[', wordspecial, ']','\\n'\n\tentry             := word, '\\t=', '\"', wordspecial , '\"', '\\n'\n\talpha             := [a-zA-Z]\n\talphanum          := [a-zA-Z0-9]\n\talphanumspecial   := [a-zA-Z0-9_-]\n\tword              := alpha,alphanum*\n\twordspecial       := alpha,alphanumspecial*\n\t\"\"\"\n\tfrom EBNFSpill import EBNFSpill\n\ts = EBNFSpill()\n\t# process declaration (feeds simpleparse with declaration and defines 'file' as entrypoint)\n\ts.setDeclaration(declaration,production=\"file\")\t\n\t# lets generate some random data\n\tx= 0        \n\tfor i in s.walk():\n\t    x+=1\n\t    # print \u003cnumber\u003e, \u003cuid\u003e, \u003chuman_readable_AST_element\u003e \n\t    print x,id(i),s.process(i)\nOutput:\n\n\t1 36385136 (None, 'MATCH_SUBTABLE', (('section', 203, ((None, 21, '['), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, ']'), (None, 21, '\\n'))), ('entry', 203, (('word', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\\t='), (None, 21, '\"'), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\"'), (None, 21, '\\n'))), ('entry', 203, (('word', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\\t='), (None, 21, '\"'), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\"'), (None, 21, '\\n')), 2, 1), (None, 101, 1, -1, 1), (None, 21, '\\n\\n')))\n\t2 36743928 ('section', 'MATCH_TABLE', ((None, 21, '['), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, ']'), (None, 21, '\\n')))\n\t3 36325576 (None, 'MATCH_WORD', '[')\n\t4 36742248 ('wordspecial', 'MATCH_TABLE', (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1)))\n\t5 36742008 ('alpha', 'MATCH_ISIN', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')\n\t6 36746368 ('alphanumspecial', 'MATCH_ISIN', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1)\n\t7 36746416 (None, 'MATCH_EOF', 1, -1, 1)\n\t8 36742488 (None, 'MATCH_WORD', ']')\n\t9 36742848 (None, 'MATCH_WORD', '\\n')\n\t10 36384896 ('entry', 'MATCH_TABLE', (('word', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\\t='), (None, 21, '\"'), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\"'), (None, 21, '\\n')))\n\t11 36326336 ('word', 'MATCH_TABLE', (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1)))\n\t12 36326216 ('alpha', 'MATCH_ISIN', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')\n\t13 36746464 ('alphanum', 'MATCH_ISIN', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1)\n\t14 36746512 (None, 'MATCH_EOF', 1, -1, 1)\n\t15 36326776 (None, 'MATCH_WORD', '\\t=')\n\t16 36326416 (None, 'MATCH_WORD', '\"')\n\t17 36326136 ('wordspecial', 'MATCH_TABLE', (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1)))\n\t18 36292208 ('[RECURSION of Node=36741928]', 'MATCH_RECURSION', 36741928)\n\t19 36385336 (None, 'MATCH_WORD', '\"')\n\t20 36385096 (None, 'MATCH_WORD', '\\n')\n\t21 36746560 ('entry', 'MATCH_TABLE', (('word', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\\t='), (None, 21, '\"'), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\"'), (None, 21, '\\n')), 2, 1)\n\t22 36292208 ('[RECURSION of Node=36304296]', 'MATCH_RECURSION', 36304296)\n\t23 36746608 (None, 'MATCH_EOF', 1, -1, 1)\n\t24 36384936 (None, 'MATCH_WORD', '\\n\\n')\n\t25 36746704 (None, 'MATCH_SUBTABLE', (('section', 203, ((None, 21, '['), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, ']'), (None, 21, '\\n'))), ('entry', 203, (('word', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\\t='), (None, 21, '\"'), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\"'), (None, 21, '\\n'))), ('entry', 203, (('word', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanum', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\\t='), (None, 21, '\"'), ('wordspecial', 203, (('alpha', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), ('alphanumspecial', 14, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', 2, 1), (None, 101, 1, -1, 1))), (None, 21, '\"'), (None, 21, '\\n')), 2, 1), (None, 101, 1, -1, 1), (None, 21, '\\n\\n')), 2, 1)\n\t26 36292208 ('[RECURSION of Node=36746656]', 'MATCH_RECURSION', 36746656)\n\t27 36746752 (None, 'MATCH_EOF', 1, -1, 1)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftintinweb%2Febnfspill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftintinweb%2Febnfspill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftintinweb%2Febnfspill/lists"}