{"id":15400740,"url":"https://github.com/paebbels/pyvhdlparser","last_synced_at":"2025-07-29T13:10:42.302Z","repository":{"id":40792242,"uuid":"68818889","full_name":"Paebbels/pyVHDLParser","owner":"Paebbels","description":"Streaming based VHDL parser.","archived":false,"fork":false,"pushed_at":"2024-07-15T05:45:31.000Z","size":7876,"stargazers_count":78,"open_issues_count":17,"forks_count":15,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-10-24T23:40:06.234Z","etag":null,"topics":["language-model","parser","python-3","vhdl"],"latest_commit_sha":null,"homepage":"https://paebbels.github.io/pyVHDLParser/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Paebbels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-21T13:20:39.000Z","updated_at":"2024-10-02T13:06:03.000Z","dependencies_parsed_at":"2023-09-29T02:50:37.776Z","dependency_job_id":"771934dd-ab60-4c19-a919-152866e26e54","html_url":"https://github.com/Paebbels/pyVHDLParser","commit_stats":{"total_commits":378,"total_committers":7,"mean_commits":54.0,"dds":0.5608465608465609,"last_synced_commit":"f780fcd3590d2f2f7b049aa0d7b636a1f7d1952c"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paebbels%2FpyVHDLParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paebbels%2FpyVHDLParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paebbels%2FpyVHDLParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paebbels%2FpyVHDLParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paebbels","download_url":"https://codeload.github.com/Paebbels/pyVHDLParser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066180,"owners_count":20392406,"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","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":["language-model","parser","python-3","vhdl"],"created_at":"2024-10-01T15:54:49.710Z","updated_at":"2025-03-17T16:11:02.754Z","avatar_url":"https://github.com/Paebbels.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Sourcecode on GitHub](https://img.shields.io/badge/Paebbels-pyVHDLParser-323131.svg?logo=github\u0026longCache=true)](https://github.com/Paebbels/pyVHDLParser)\n[![License](https://img.shields.io/badge/code%20license-Apache%20License%2C%202.0-lightgrey?logo=GitHub)](LICENSE.md)\n[![GitHub tag (latest SemVer incl. pre-release)](https://img.shields.io/github/v/tag/Paebbels/pyVHDLParser?logo=GitHub\u0026include_prereleases)](https://github.com/Paebbels/pyVHDLParser/tags)\n[![GitHub release (latest SemVer incl. including pre-releases)](https://img.shields.io/github/v/release/Paebbels/pyVHDLParser?logo=GitHub\u0026include_prereleases)](https://github.com/Paebbels/pyVHDLParser/releases/latest)\n[![GitHub release date](https://img.shields.io/github/release-date/Paebbels/pyVHDLParser?logo=GitHub\u0026)](https://github.com/Paebbels/pyVHDLParser/releases)  \n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Paebbels/pyVHDLParser/Test,%20Coverage%20and%20Release?label=Workflow\u0026logo=GitHub)](https://github.com/Paebbels/pyVHDLParser/actions?query=workflow%3A%22Test%2C+Coverage+and+Release%22)\n[![PyPI](https://img.shields.io/pypi/v/pyVHDLParser?logo=PyPI)](https://pypi.org/project/pyVHDLParser/)\n![PyPI - Status](https://img.shields.io/pypi/status/pyVHDLParser?logo=PyPI)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyVHDLParser?logo=PyPI)\n[![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/pypi/pyVHDLParser)](https://github.com/Paebbels/pyVHDLParser/network/dependents)  \n[![Libraries.io status for latest release](https://img.shields.io/librariesio/release/pypi/pyVHDLParser)](https://libraries.io/github/Paebbels/pyVHDLParser)\n[![Codacy - Quality](https://img.shields.io/codacy/grade/1155f244b6f54a3a95abdaa80d6771f8?logo=Codacy)](https://www.codacy.com/manual/Paebbels/pyVHDLParser)\n[![Codacy - Coverage](https://img.shields.io/codacy/coverage/1155f244b6f54a3a95abdaa80d6771f8?logo=Codacy)](https://www.codacy.com/manual/Paebbels/pyVHDLParser)\n[![Codecov - Branch Coverage](https://img.shields.io/codecov/c/github/Paebbels/pyVHDLParser?logo=Codecov)](https://codecov.io/gh/Paebbels/pyVHDLParser)\n[![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/pyVHDLParser)](https://libraries.io/github/Paebbels/pyVHDLParser/sourcerank)  \n[![Read the Docs](https://img.shields.io/readthedocs/pyvhdlparser)](https://pyVHDLParser.readthedocs.io/en/latest/)\n\n# pyVHDLParser\n\nThis is a token-stream based parser for VHDL-2008.\n\nThis project requires Python 3.8+.\n\n## Introduction\n\n### Main Goals\n\n* **Parsing**\n  * slice an input document into **tokens** and text **blocks** which are categorized\n  * preserve case, whitespace and comments\n  * recover on parsing errors\n  * good error reporting / throw exceptions\n* **Fast Processing**\n  * multi-pass parsing and analysis\n  * delay analysis if not needed at current pass\n  * link tokens and blocks for fast-forward scanning\n* **Generic VHDL Language Model**\n  * Assemble a document-object-model (Code-DOM)\n  * Provide an API for code introspection\n\n### Use Cases\n\n* generate documentation by using the fast-forward scanner\n* generate a document/language model by using the grouped text-block scanner\n* extract compile orders and other dependency graphs\n* generate highlighted syntax\n* re-annotate documenting comments to their objects for doc extraction\n\n### Parsing approach\n\n1. slice an input document into **tokens**\n2. assemble tokens to text **blocks** which are categorized\n3. assemble text blocks for fast-forward scanning into **groups**\n4. translate groups into a document-object-model (DOM)\n5. provide a generic VHDL language model\n\n### Long time goals\n\n* A Sphinx language plugin for VHDL \n\n    TODO: Move the following documentation to ReadTheDocs and replace it with a more lightweight version.\n\n## Basic Concept\n\n[![][concept]][concept]\n\n[concept]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/images/Linking_TokenBlockGroup.png\n\n## Example 1\n\nThis is an input file:\n\n```VHDL\n-- Copryright 2016\nlibrary IEEE;\nuse     IEEE.std_logic_1164.all;\n\nentity myEntity is\n  generic (\n    BITS : positive := 8\n  );\n  port (\n    Clock   : in   std_logic;\n    Output  : out  std_logic_vector(BITS - 1 downto 0)\n  );\nend entity;\n\narchitecture rtl of myEntity is\n  constant const0 : integer := 5;\nbegin\n  process(Clock)\n  begin\n  end process;\nend architecture;\n\nlibrary IEEE, PoC;\nuse     PoC.Utils.all, PoC.Common.all;\n\npackage pkg0 is\n  function func0(a : integer) return string;\nend package;\n\npackage body Components is\n  function func0(a : integer) return string is\n    procedure proc0 is\n    begin\n    end procedure;\n  begin\n  end function\nend package body;\n```\n\n### Step 1\nThe input file (stream of characters) is translated into stream of basic tokens:\n* `StartOfDocumentToken`\n* `LinebreakToken`\n* `SpaceToken`\n  * `IndentationToken`\n* `WordToken`\n* `CharacterToken`\n  * `FusedCharacterToken`\n* CommentToken\n  * `SingleLineCommentToken`\n  * `MultiLineCommentToken`\n* `EndOfDocumentToken`\n\n\nThe stream looks like this:\n```\n\u003cStartOfDocumentToken\u003e\n\u003cSLCommentToken '-- Copryright 2016\\n'  ................ at 1:1\u003e\n\u003cWordToken      'library'  ............................. at 2:1\u003e\n\u003cSpaceToken     ' '  ................................... at 2:8\u003e\n\u003cWordToken      'IEEE'  ................................ at 2:9\u003e\n\u003cCharacterToken ';'  ................................... at 2:13\u003e\n\u003cLinebreakToken ---------------------------------------- at 2:14\u003e\n\u003cWordToken      'use'  ................................. at 3:1\u003e\n\u003cSpaceToken     '     '  ............................... at 3:4\u003e\n\u003cWordToken      'IEEE'  ................................ at 3:9\u003e\n\u003cCharacterToken '.'  ................................... at 3:13\u003e\n\u003cWordToken      'std_logic_1164'  ...................... at 3:14\u003e\n\u003cCharacterToken '.'  ................................... at 3:28\u003e\n\u003cWordToken      'all'  ................................. at 3:29\u003e\n\u003cCharacterToken ';'  ................................... at 3:32\u003e\n\u003cLinebreakToken ---------------------------------------- at 3:33\u003e\n\u003cLinebreakToken ---------------------------------------- at 4:1\u003e\n\u003cWordToken      'entity'  .............................. at 5:1\u003e\n\u003cSpaceToken     ' '  ................................... at 5:7\u003e\n\u003cWordToken      'myEntity'  ............................ at 5:8\u003e\n\u003cSpaceToken     ' '  ................................... at 5:16\u003e\n\u003cWordToken      'is'  .................................. at 5:17\u003e\n\u003cLinebreakToken ---------------------------------------- at 5:19\u003e\n\u003cIndentToken    '\\t'  .................................. at 6:1\u003e\n\u003cWordToken      'generic'  ............................. at 6:2\u003e\n\u003cSpaceToken     ' '  ................................... at 6:9\u003e\n\u003cCharacterToken '('  ................................... at 6:10\u003e\n\u003cLinebreakToken ---------------------------------------- at 6:11\u003e\n\u003cIndentToken    '\\t\\t'  ................................ at 7:1\u003e\n\u003cWordToken      'BITS'  ................................ at 7:3\u003e\n\u003cSpaceToken     ' '  ................................... at 7:7\u003e\n\u003cCharacterToken ':'  ................................... at 7:8\u003e\n\u003cSpaceToken     ' '  ................................... at 7:8\u003e\n\u003cWordToken      'positive'  ............................ at 7:10\u003e\n\u003cSpaceToken     ' '  ................................... at 7:18\u003e\n\u003cFusedCharToken ':='  .................................. at 7:19\u003e\n\u003cSpaceToken     ' '  ................................... at 7:21\u003e\n\u003cWordToken      '8'  ................................... at 7:22\u003e\n\u003cLinebreakToken ---------------------------------------- at 7:23\u003e\n\u003cIndentToken    '\\t'  .................................. at 8:1\u003e\n\u003cCharacterToken ')'  ................................... at 8:2\u003e\n\u003cCharacterToken ';'  ................................... at 8:3\u003e\n\u003cLinebreakToken ---------------------------------------- at 8:4\u003e\n\u003cIndentToken    '\\t'  .................................. at 9:1\u003e\n\u003cWordToken      'port'  ................................ at 9:2\u003e\n\u003cSpaceToken     ' '  ................................... at 9:6\u003e\n\u003cCharacterToken '('  ................................... at 9:7\u003e\n\u003cLinebreakToken ---------------------------------------- at 9:8\u003e\n\u003cIndentToken    '\\t\\t'  ................................ at 10:1\u003e\n\u003cWordToken      'Clock'  ............................... at 10:3\u003e\n\u003cSpaceToken     '   '  ................................. at 10:8\u003e\n\u003cCharacterToken ':'  ................................... at 10:11\u003e\n\u003cSpaceToken     ' '  ................................... at 10:11\u003e\n\u003cWordToken      'in'  .................................. at 10:13\u003e\n\u003cSpaceToken     '  '  .................................. at 10:15\u003e\n\u003cWordToken      'std_logic'  ........................... at 10:17\u003e\n\u003cCharacterToken ';'  ................................... at 10:26\u003e\n\u003cLinebreakToken ---------------------------------------- at 10:27\u003e\n\u003cIndentToken    '\\t\\t'  ................................ at 11:1\u003e\n\u003cWordToken      'Output'  .............................. at 11:3\u003e\n\u003cSpaceToken     '       '  ................................... at 11:9\u003e\n\u003cCharacterToken ':'  ................................... at 11:10\u003e\n\u003cSpaceToken     ' '  ................................... at 11:10\u003e\n\u003cWordToken      'out'  ................................. at 11:12\u003e\n\u003cSpaceToken     '       '  ................................... at 11:15\u003e\n\u003cWordToken      'std_logic_vector'  .................... at 11:16\u003e\n\u003cCharacterToken '('  ................................... at 11:32\u003e\n\u003cWordToken      'BITS'  ................................ at 11:33\u003e\n\u003cSpaceToken     ' '  ................................... at 11:37\u003e\n\u003cCharacterToken '-'  ................................... at 11:38\u003e\n\u003cSpaceToken     ' '  ................................... at 11:38\u003e\n\u003cWordToken      '1'  ................................... at 11:40\u003e\n\u003cSpaceToken     ' '  ................................... at 11:41\u003e\n\u003cWordToken      'downto'  .............................. at 11:42\u003e\n\u003cSpaceToken     ' '  ................................... at 11:48\u003e\n\u003cWordToken      '0'  ................................... at 11:49\u003e\n\u003cCharacterToken ')'  ................................... at 11:50\u003e\n\u003cLinebreakToken ---------------------------------------- at 11:51\u003e\n\u003cIndentToken    '\\t'  .................................. at 12:1\u003e\n\u003cCharacterToken ')'  ................................... at 12:2\u003e\n\u003cCharacterToken ';'  ................................... at 12:3\u003e\n\u003cLinebreakToken ---------------------------------------- at 12:4\u003e\n\u003cWordToken      'end'  ................................. at 13:1\u003e\n\u003cSpaceToken     ' '  ................................... at 13:4\u003e\n\u003cWordToken      'entity'  .............................. at 13:5\u003e\n\u003cCharacterToken ';'  ................................... at 13:11\u003e\n\u003cLinebreakToken ---------------------------------------- at 13:12\u003e\n\u003cLinebreakToken ---------------------------------------- at 14:1\u003e\n\u003cWordToken      'architecture'  ........................ at 15:1\u003e\n\u003cSpaceToken     ' '  ................................... at 15:13\u003e\n\u003cWordToken      'rtl'  ................................. at 15:14\u003e\n\u003cSpaceToken     ' '  ................................... at 15:17\u003e\n\u003cWordToken      'of'  .................................. at 15:18\u003e\n\u003cSpaceToken     ' '  ................................... at 15:20\u003e\n\u003cWordToken      'myEntity'  ............................ at 15:21\u003e\n\u003cSpaceToken     ' '  ................................... at 15:29\u003e\n\u003cWordToken      'is'  .................................. at 15:30\u003e\n\u003cLinebreakToken ---------------------------------------- at 15:32\u003e\n\u003cIndentToken    '\\t'  .................................. at 16:1\u003e\n\u003cWordToken      'constant'  ............................ at 16:2\u003e\n\u003cSpaceToken     ' '  ................................... at 16:10\u003e\n\u003cWordToken      'const0'  .............................. at 16:11\u003e\n\u003cSpaceToken     ' '  ................................... at 16:17\u003e\n\u003cCharacterToken ':'  ................................... at 16:18\u003e\n\u003cSpaceToken     ' '  ................................... at 16:18\u003e\n\u003cWordToken      'integer'  ............................. at 16:20\u003e\n\u003cSpaceToken     ' '  ................................... at 16:27\u003e\n\u003cFusedCharToken ':='  .................................. at 16:28\u003e\n\u003cSpaceToken     ' '  ................................... at 16:30\u003e\n\u003cWordToken      '5'  ................................... at 16:31\u003e\n\u003cCharacterToken ';'  ................................... at 16:32\u003e\n\u003cLinebreakToken ---------------------------------------- at 16:33\u003e\n\u003cWordToken      'begin'  ............................... at 17:1\u003e\n\u003cLinebreakToken ---------------------------------------- at 17:6\u003e\n\u003cIndentToken    '\\t'  .................................. at 18:1\u003e\n\u003cWordToken      'process'  ............................. at 18:2\u003e\n\u003cCharacterToken '('  ................................... at 18:9\u003e\n\u003cWordToken      'Clock'  ............................... at 18:10\u003e\n\u003cCharacterToken ')'  ................................... at 18:15\u003e\n\u003cLinebreakToken ---------------------------------------- at 18:16\u003e\n\u003cIndentToken    '\\t'  .................................. at 19:1\u003e\n\u003cWordToken      'begin'  ............................... at 19:2\u003e\n\u003cLinebreakToken ---------------------------------------- at 19:7\u003e\n\u003cIndentToken    '\\t'  .................................. at 20:1\u003e\n\u003cWordToken      'end'  ................................. at 20:2\u003e\n\u003cSpaceToken     ' '  ................................... at 20:5\u003e\n\u003cWordToken      'process'  ............................. at 20:6\u003e\n\u003cCharacterToken ';'  ................................... at 20:13\u003e\n\u003cLinebreakToken ---------------------------------------- at 20:14\u003e\n\u003cWordToken      'end'  ................................. at 21:1\u003e\n\u003cSpaceToken     ' '  ................................... at 21:4\u003e\n\u003cWordToken      'architecture'  ........................ at 21:5\u003e\n\u003cCharacterToken ';'  ................................... at 21:17\u003e\n\u003cLinebreakToken ---------------------------------------- at 21:18\u003e\n\u003cLinebreakToken ---------------------------------------- at 22:1\u003e\n\u003cWordToken      'library'  ............................. at 23:1\u003e\n\u003cSpaceToken     ' '  ................................... at 23:8\u003e\n\u003cWordToken      'IEEE'  ................................ at 23:9\u003e\n\u003cCharacterToken ','  ................................... at 23:13\u003e\n\u003cSpaceToken     ' '  ................................... at 23:14\u003e\n\u003cWordToken      'PoC'  ................................. at 23:15\u003e\n\u003cCharacterToken ';'  ................................... at 23:18\u003e\n\u003cLinebreakToken ---------------------------------------- at 23:19\u003e\n\u003cWordToken      'use'  ................................. at 24:1\u003e\n\u003cSpaceToken     '     '  ............................... at 24:4\u003e\n\u003cWordToken      'PoC'  ................................. at 24:9\u003e\n\u003cCharacterToken '.'  ................................... at 24:12\u003e\n\u003cWordToken      'Utils'  ............................... at 24:13\u003e\n\u003cCharacterToken '.'  ................................... at 24:18\u003e\n\u003cWordToken      'all'  ................................. at 24:19\u003e\n\u003cCharacterToken ','  ................................... at 24:22\u003e\n\u003cSpaceToken     ' '  ................................... at 24:23\u003e\n\u003cWordToken      'PoC'  ................................. at 24:24\u003e\n\u003cCharacterToken '.'  ................................... at 24:27\u003e\n\u003cWordToken      'Common'  .............................. at 24:28\u003e\n\u003cCharacterToken '.'  ................................... at 24:34\u003e\n\u003cWordToken      'all'  ................................. at 24:35\u003e\n\u003cCharacterToken ';'  ................................... at 24:38\u003e\n\u003cLinebreakToken ---------------------------------------- at 24:39\u003e\n\u003cLinebreakToken ---------------------------------------- at 25:1\u003e\n\u003cWordToken      'package'  ............................. at 26:1\u003e\n\u003cSpaceToken     ' '  ................................... at 26:8\u003e\n\u003cWordToken      'pkg0'  ................................ at 26:9\u003e\n\u003cSpaceToken     ' '  ................................... at 26:13\u003e\n\u003cWordToken      'is'  .................................. at 26:14\u003e\n\u003cLinebreakToken ---------------------------------------- at 26:16\u003e\n\u003cIndentToken    '\\t'  .................................. at 27:1\u003e\n\u003cWordToken      'function'  ............................ at 27:2\u003e\n\u003cSpaceToken     ' '  ................................... at 27:10\u003e\n\u003cWordToken      'func0'  ............................... at 27:11\u003e\n\u003cCharacterToken '('  ................................... at 27:16\u003e\n\u003cWordToken      'a'  ................................... at 27:17\u003e\n\u003cSpaceToken     ' '  ................................... at 27:18\u003e\n\u003cCharacterToken ':'  ................................... at 27:19\u003e\n\u003cSpaceToken     ' '  ................................... at 27:19\u003e\n\u003cWordToken      'integer'  ............................. at 27:21\u003e\n\u003cCharacterToken ')'  ................................... at 27:28\u003e\n\u003cSpaceToken     ' '  ................................... at 27:29\u003e\n\u003cWordToken      'return'  .............................. at 27:30\u003e\n\u003cSpaceToken     ' '  ................................... at 27:36\u003e\n\u003cWordToken      'string'  .............................. at 27:37\u003e\n\u003cCharacterToken ';'  ................................... at 27:43\u003e\n\u003cLinebreakToken ---------------------------------------- at 27:44\u003e\n\u003cWordToken      'end'  ................................. at 28:1\u003e\n\u003cSpaceToken     ' '  ................................... at 28:4\u003e\n\u003cWordToken      'package'  ............................. at 28:5\u003e\n\u003cCharacterToken ';'  ................................... at 28:12\u003e\n\u003cLinebreakToken ---------------------------------------- at 28:13\u003e\n\u003cLinebreakToken ---------------------------------------- at 29:1\u003e\n\u003cWordToken      'package'  ............................. at 30:1\u003e\n\u003cSpaceToken     ' '  ................................... at 30:8\u003e\n\u003cWordToken      'body'  ................................ at 30:9\u003e\n\u003cSpaceToken     ' '  ................................... at 30:13\u003e\n\u003cWordToken      'Components'  .......................... at 30:14\u003e\n\u003cSpaceToken     ' '  ................................... at 30:24\u003e\n\u003cWordToken      'is'  .................................. at 30:25\u003e\n\u003cLinebreakToken ---------------------------------------- at 30:27\u003e\n\u003cIndentToken    '\\t'  .................................. at 31:1\u003e\n\u003cWordToken      'function'  ............................ at 31:2\u003e\n\u003cSpaceToken     ' '  ................................... at 31:10\u003e\n\u003cWordToken      'func0'  ............................... at 31:11\u003e\n\u003cCharacterToken '('  ................................... at 31:16\u003e\n\u003cWordToken      'a'  ................................... at 31:17\u003e\n\u003cSpaceToken     ' '  ................................... at 31:18\u003e\n\u003cCharacterToken ':'  ................................... at 31:19\u003e\n\u003cSpaceToken     ' '  ................................... at 31:19\u003e\n\u003cWordToken      'integer'  ............................. at 31:21\u003e\n\u003cCharacterToken ')'  ................................... at 31:28\u003e\n\u003cSpaceToken     ' '  ................................... at 31:29\u003e\n\u003cWordToken      'return'  .............................. at 31:30\u003e\n\u003cSpaceToken     ' '  ................................... at 31:36\u003e\n\u003cWordToken      'string'  .............................. at 31:37\u003e\n\u003cSpaceToken     ' '  ................................... at 31:43\u003e\n\u003cWordToken      'is'  .................................. at 31:44\u003e\n\u003cLinebreakToken ---------------------------------------- at 31:46\u003e\n\u003cIndentToken    '\\t\\t'  ................................ at 32:1\u003e\n\u003cWordToken      'procedure'  ........................... at 32:3\u003e\n\u003cSpaceToken     ' '  ................................... at 32:12\u003e\n\u003cWordToken      'proc0'  ............................... at 32:13\u003e\n\u003cSpaceToken     ' '  ................................... at 32:18\u003e\n\u003cWordToken      'is'  .................................. at 32:19\u003e\n\u003cLinebreakToken ---------------------------------------- at 32:21\u003e\n\u003cIndentToken    '\\t\\t'  ................................ at 33:1\u003e\n\u003cWordToken      'begin'  ............................... at 33:3\u003e\n\u003cLinebreakToken ---------------------------------------- at 33:8\u003e\n\u003cIndentToken    '\\t\\t'  ................................ at 34:1\u003e\n\u003cWordToken      'end'  ................................. at 34:3\u003e\n\u003cSpaceToken     ' '  ................................... at 34:6\u003e\n\u003cWordToken      'procedure'  ........................... at 34:7\u003e\n\u003cCharacterToken ';'  ................................... at 34:16\u003e\n\u003cLinebreakToken ---------------------------------------- at 34:17\u003e\n\u003cIndentToken    '\\t'  .................................. at 35:1\u003e\n\u003cWordToken      'begin'  ............................... at 35:2\u003e\n\u003cLinebreakToken ---------------------------------------- at 35:7\u003e\n\u003cIndentToken    '\\t'  .................................. at 36:1\u003e\n\u003cWordToken      'end'  ................................. at 36:2\u003e\n\u003cSpaceToken     ' '  ................................... at 36:5\u003e\n\u003cWordToken      'function'  ............................ at 36:6\u003e\n\u003cLinebreakToken ---------------------------------------- at 36:14\u003e\n\u003cWordToken      'end'  ................................. at 37:1\u003e\n\u003cSpaceToken     ' '  ................................... at 37:4\u003e\n\u003cWordToken      'package'  ............................. at 37:5\u003e\n\u003cSpaceToken     ' '  ................................... at 37:12\u003e\n\u003cWordToken      'body'  ................................ at 37:13\u003e\n\u003cCharacterToken ';'  ................................... at 37:17\u003e\n\u003cLinebreakToken ---------------------------------------- at 37:18\u003e\n```\n\n[![Screenshot][10]][10]\n\n### Step 2\nThe token stream from step 1 is translated into typed tokens like\n`DelimiterToken` (:), `EndToken` (;) or subtypes of `KeywordToken`.\nThese tokens are then grouped into blocks.\n\nThe example generates:\n```\n[StartOfDocumentBlock]\n[Blocks.CommentBlock            '-- Copryright 2016\\n'                                         at (line:   1, col:  1) .. (line:   1, col: 19)]\n[LibraryStatement.LibraryBlock           'library '                                                     at (line:   2, col:  1) .. (line:   2, col:  8)]\n[LibraryStatement.LibraryNameBlock       'IEEE'                                                         at (line:   2, col:  9) .. (line:   2, col: 13)]\n[LibraryStatement.LibraryEndBlock        ';'                                                            at (line:   2, col: 13) .. (line:   2, col: 13)]\n[LinebreakBlock                                                                                at (line:   2, col: 14) .. (line:   2, col: 14)]\n[Use.UseBlock                   'use     '                                                     at (line:   3, col:  1) .. (line:   3, col:  8)]\n[Use.UseNameBlock               'IEEE.std_logic_1164.all'                                      at (line:   3, col:  9) .. (line:   3, col: 32)]\n[Use.UseEndBlock                ';'                                                            at (line:   3, col: 32) .. (line:   3, col: 32)]\n[LinebreakBlock                                                                                at (line:   3, col: 33) .. (line:   3, col: 33)]\n[EmptyLineBlock                                                                                at (line:   4, col:  1) .. (line:   4, col:  1)]\n[Entity.NameBlock               'entity myEntity is'                                           at (line:   5, col:  1) .. (line:   5, col: 19)]\n[LinebreakBlock                                                                                at (line:   5, col: 19) .. (line:   5, col: 19)]\n[IndentationBlock                length=1 (2)                                                  at (line:   6, col:  1) .. (line:   6, col:  1)]\n[GenericList.OpenBlock          'generic ('                                                    at (line:   6, col:  2) .. (line:   6, col: 10)]\n[LinebreakBlock                                                                                at (line:   6, col: 11) .. (line:   6, col: 11)]\n[IndentationBlock                length=2 (4)                                                  at (line:   7, col:  1) .. (line:   7, col:  2)]\n[GenericList.ItemBlock          'BITS : positive := 8\\n\\t'                                     at (line:   7, col:  3) .. (line:   8, col:  1)]\n[GenericList.CloseBlock         ');'                                                           at (line:   8, col:  2) .. (line:   8, col:  3)]\n[LinebreakBlock                                                                                at (line:   8, col:  4) .. (line:   8, col:  4)]\n[IndentationBlock                length=1 (2)                                                  at (line:   9, col:  1) .. (line:   9, col:  1)]\n[PortList.OpenBlock             'port ('                                                       at (line:   9, col:  2) .. (line:   9, col:  7)]\n[LinebreakBlock                                                                                at (line:   9, col:  8) .. (line:   9, col:  8)]\n[IndentationBlock                length=2 (4)                                                  at (line:  10, col:  1) .. (line:  10, col:  2)]\n[PortList.ItemBlock             'Clock   : in  std_logic'                                      at (line:  10, col:  3) .. (line:  10, col: 26)]\n[PortList.DelimiterBlock        ';'                                                            at (line:  10, col: 26) .. (line:  10, col: 26)]\n[LinebreakBlock                                                                                at (line:  10, col: 27) .. (line:  10, col: 27)]\n[IndentationBlock                length=2 (4)                                                  at (line:  11, col:  1) .. (line:  11, col:  2)]\n[PortList.ItemBlock             'Output\\t: out\\tstd_logic_vector(BITS - 1 downto 0)\\n\\t'       at (line:  11, col:  3) .. (line:  12, col:  1)]\n[PortList.CloseBlock            ');'                                                           at (line:  12, col:  2) .. (line:  12, col:  3)]\n[LinebreakBlock                                                                                at (line:  12, col:  4) .. (line:  12, col:  4)]\n[Entity.EndBlock                'end entity;'                                                  at (line:  13, col:  1) .. (line:  13, col: 11)]\n[LinebreakBlock                                                                                at (line:  13, col: 12) .. (line:  13, col: 12)]\n[EmptyLineBlock                                                                                at (line:  14, col:  1) .. (line:  14, col:  1)]\n[Architecture.NameBlock         'architecture rtl of myEntity is'                              at (line:  15, col:  1) .. (line:  15, col: 32)]\n[LinebreakBlock                                                                                at (line:  15, col: 32) .. (line:  15, col: 32)]\n[IndentationBlock                length=1 (2)                                                  at (line:  16, col:  1) .. (line:  16, col:  1)]\n[Constant.ConstantBlock         'constant const0 : integer := 5;'                              at (line:  16, col:  2) .. (line:  16, col: 32)]\n[LinebreakBlock                                                                                at (line:  16, col: 33) .. (line:  16, col: 33)]\n[EmptyLineBlock                                                                                at (line:  17, col:  6) .. (line:  17, col:  6)]\n[IndentationBlock                length=1 (2)                                                  at (line:  18, col:  1) .. (line:  18, col:  1)]\n[Process.OpenBlock              'process('                                                     at (line:  18, col:  2) .. (line:  18, col:  9)]\n[SensitivityList.ItemBlock      'Clock'                                                        at (line:  18, col: 10) .. (line:  18, col: 15)]\n[Process.OpenBlock2*            ')'                                                            at (line:  18, col: 15) .. (line:  18, col: 15)]\n[LinebreakBlock                                                                                at (line:  18, col: 16) .. (line:  18, col: 16)]\n...\n```\n\nThe following screenshot shows the resulting stream of blocks:\n[![][20]][20]\n\n\n[outdated]\nThe block stream can also be \"opened\" to show the stream of tokens within each block. This is shown in the next screenshot:\n[![][21]][21]\n\n### Step 3\nThe stream of blocks from step 2 is transformed into a stream of groups.\n\n### Step 4\nOne of many post processing steps could be to remove whitespaces, indentation and comment blocks. So a filter can be applied to remove these block types. Additionally, multiparted blocks (e.g. if a comment or linebreak was inserted between consecutive code sequences, which belong to one block) can be fused to one single block.\n\nThis screenshot shows the filtered results:\n[![][30]][30] \n\n [10]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/screens/TokenStream_Example_1.png\n [20]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/screens/BlockStream_Example_1.png\n [21]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/screens/BlockStream_Uses_Detailed.png\n [30]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/screens/BlockStream_Uses_Fused.png\n\n## Example 2 - Simple_1\n\nThis is an input file:\n\n```VHDL\n-- Copryright 2016\nlibrary IEEE;\nuse     IEEE.std_logic_1164.all;\nuse      IEEE.numeric_std.all;\n\nentity myEntity is\n  generic (\n    BITS : positive := 8\n  );\n  port (\n    Clock   : in  std_logic;\n    Reset   : in  std_logic;\n    Output  : out  std_logic_vector(BITS - 1 downto 0)\n  );\nend entity;\n\narchitecture rtl of myEntity is\n\nbegin\n\nend architecture;\n```\n\nThis is the result stream:\n[![][40]][40] \n\nAnd this is the filtered and fused result stream:\n[![][41]][41]\n\n [40]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/screens/BlockStream_Simple_1.png\n [41]: https://raw.githubusercontent.com/Paebbels/pyVHDLParser/master/doc/screens/BlockStream_Simple_1_Fused.png\n\n\n## Contributors\n* [Patrick Lehmann](https://github.com/Paebbels) (Maintainer)\n* [and more...](https://github.com/Paebbels/pyVHDLParser/graphs/contributors)\n\n\n## License\n\nThis Python package (source code) licensed under [Apache License 2.0](LICENSE.md).  \nThe accompanying documentation is licensed under [Creative Commons - Attribution 4.0 (CC-BY 4.0)](doc/Doc-License.rst).\n\n-------------------------\n\nSPDX-License-Identifier: Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaebbels%2Fpyvhdlparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaebbels%2Fpyvhdlparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaebbels%2Fpyvhdlparser/lists"}