{"id":18370730,"url":"https://github.com/miho/vmf-text","last_synced_at":"2025-04-06T19:31:47.613Z","repository":{"id":137158951,"uuid":"140614958","full_name":"miho/VMF-Text","owner":"miho","description":"Powerful Grammar-based Language Modeling Framework","archived":false,"fork":false,"pushed_at":"2024-06-12T05:05:38.000Z","size":1146,"stargazers_count":10,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T04:51:18.463Z","etag":null,"topics":["abstract-syntax-tree","antlr","antlr4","code-generation","java","model-driven","parser","unparsing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miho.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-11T18:36:54.000Z","updated_at":"2024-07-14T12:48:34.000Z","dependencies_parsed_at":"2024-11-05T23:40:39.087Z","dependency_job_id":"de437baf-cb58-411c-b526-752d139bbfe0","html_url":"https://github.com/miho/VMF-Text","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FVMF-Text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FVMF-Text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FVMF-Text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FVMF-Text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miho","download_url":"https://codeload.github.com/miho/VMF-Text/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247539066,"owners_count":20955233,"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":["abstract-syntax-tree","antlr","antlr4","code-generation","java","model-driven","parser","unparsing"],"created_at":"2024-11-05T23:40:02.287Z","updated_at":"2025-04-06T19:31:46.339Z","avatar_url":"https://github.com/miho.png","language":"Java","readme":"# VMF-Text [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=VMF-Text:%20The%20new%20framework%20for%20grammar-based%20language%20modeling!\u0026url=https://github.com/miho/VMF-Text\u0026via=mihosoft\u0026hashtags=vmftext,vmf,antlr4,java,mdd,developers)\n\n[![Build Status](https://travis-ci.org/miho/VMF-Text.svg?branch=master)](https://travis-ci.org/miho/VMF-Text)\n[![Build status](https://ci.appveyor.com/api/projects/status/vh9eu5fmhhgqo21b/branch/master?svg=true)](https://ci.appveyor.com/project/miho/vmf-text/branch/master)\n[![Join the chat at https://gitter.im/VMF_/Lobby](https://badges.gitter.im/VMF_/Lobby.svg)](https://gitter.im/VMF_/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nVMF-Text is a novel framework for grammar-based language modeling on the Java Platform (it works with Java 8, 9, 10 and 11): give it a labeled [ANTLR4](https://github.com/antlr/antlr4) grammar and it will generate a rich and clean API (based on [VMF](https://github.com/miho/VMF)) for (un)parsing and transforming custom textual languages. **The complete API is derived from just a single ANTLR4 grammar file!**\n\n\u003cimg src=\"resources/img/vmf-text-01.jpg\"\u003e\n\n## Using VMF-Text\n\nCheckout the tutorial projects: https://github.com/miho/VMF-Text-Tutorials\n\nVMF-Text comes with excellent Gradle support. Just add the plugin like so (click [here](https://plugins.gradle.org/plugin/eu.mihosoft.vmftext) to get the latest version):\n\n```gradle\nplugins {\n  id \"eu.mihosoft.vmftext\" version \"0.1.2.7\" // use latest version\n}\n```\n(optionally) configure VMF-Text:\n\n```gradle\nvmfText {\n    vmfVersion   = '0.1.1'   // (runtime version)\n    antlrVersion = '4.7.1' // (runtime version)\n}\n```\n\nNow just add the labeled [ANTLR4](https://github.com/antlr/antlr4) grammar file to the VMF-Text source folder, e.g.: \n\n```\nsrc/main/vmf-text/my/pkg/ArrayLang.g4\n```\n\nSample grammar for parsing strings of the form `(1,2,3)`:\n\n```antlr\ngrammar ArrayLang;\n\narray:  '(' values+=INT (',' values+=INT)* ')' EOF;\n\nINT: SIGN? DIGIT+\n   ;\n\nfragment SIGN :'-' ;\nfragment DIGIT : [0-9];\n\nWS\n    : [ \\t\\r\\n]+ -\u003e channel(HIDDEN)\n    ;\n\n/*\u003c!vmf-text!\u003e\nTypeMap() {\n  (INT    -\u003e java.lang.Integer) = 'java.lang.Integer.parseInt(entry.getText())'\n}\n*/\n```\n\nFinally, call the `vmfTextGenCode` task to generate the implementation.\n\n## Building VMF-Text (Core)\n\n### Requirements\n\n- Java \u003e= 1.8\n- Internet connection (dependencies are downloaded automatically)\n- IDE: [Gradle](http://www.gradle.org/) Plugin (not necessary for command line usage)\n\n### IDE\n\nOpen the `VMF-Text/core` [Gradle](http://www.gradle.org/) project in your favourite IDE (tested with NetBeans 8.2 and IntelliJ 2018) and build it\nby calling the `publishToMavenLocal` task.\n\n### Command Line\n\nNavigate to the [Gradle](http://www.gradle.org/) project (i.e., `path/to/VMF-Text/core`) and enter the following command\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    bash gradlew publishToMavenLocal\n    \n#### Windows (CMD)\n\n    gradlew publishToMavenLocal\n\n## Building VMF-Text (Gradle Plugin)\n\n### Requirements\n\n- Java \u003e= 1.8\n- Internet connection (dependencies are downloaded automatically)\n- IDE: [Gradle](http://www.gradle.org/) Plugin (not necessary for command line usage)\n\n### IDE\n\nOpen the `VMF-Text/gradle-plugin` [Gradle](http://www.gradle.org/) project in your favourite IDE (tested with NetBeans 8.2 and IntelliJ 2018) and build it\nby calling the `publishToMavenLocal` task.\n\n### Command Line\n\nNavigate to the [Gradle](http://www.gradle.org/) project (i.e., `path/to/VMF-Text/gradle-plugin`) and enter the following command\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    bash gradlew publishToMavenLocal\n    \n#### Windows (CMD)\n\n    gradlew publishToMavenLocal \n\n## Testing VMF-Text (Core \u0026 Plugin)\n\nTo execute the test suite, navigate to the test project (i.e., `path/to/VMF-Text/test-suite`) and enter the following command\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    bash gradlew test\n    \n#### Windows (CMD)\n\n    gradlew test\n\nThis will use the latest snapshot vmf-text and gradle-plugin to execute the tests defined in the test-suite project.\n\n### Viewing the Report\n\nAn HTML version of the test report is located in the build folder `test-suite/build/reports/tests/test/index.html`.\n\nTest reports of the travis builds are available as well: \n[[Test reports]](https://vmf-text-tests.mihosoft.eu/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiho%2Fvmf-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiho%2Fvmf-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiho%2Fvmf-text/lists"}