{"id":30792086,"url":"https://github.com/je-es/syntax","last_synced_at":"2025-09-05T15:37:09.031Z","repository":{"id":310315953,"uuid":"1039462795","full_name":"je-es/syntax","owner":"je-es","description":"Unified wrapper that streamlines syntax creation with integrated lexer-parser coordination, LSP support, and enhanced linting capabilities.","archived":false,"fork":false,"pushed_at":"2025-09-05T02:34:10.000Z","size":331,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T04:19:23.561Z","etag":null,"topics":["ast","je-es","lexer","lint","parser","syntax","tool"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/je-es.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-17T09:36:10.000Z","updated_at":"2025-09-05T02:34:13.000Z","dependencies_parsed_at":"2025-08-17T09:41:43.290Z","dependency_job_id":"97ab4406-01fa-48da-a045-37fb3b00bf22","html_url":"https://github.com/je-es/syntax","commit_stats":null,"previous_names":["je-es/syntax"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/je-es/syntax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/je-es%2Fsyntax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/je-es%2Fsyntax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/je-es%2Fsyntax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/je-es%2Fsyntax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/je-es","download_url":"https://codeload.github.com/je-es/syntax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/je-es%2Fsyntax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273779139,"owners_count":25166730,"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":["ast","je-es","lexer","lint","parser","syntax","tool"],"created_at":"2025-09-05T15:37:06.668Z","updated_at":"2025-09-05T15:37:09.012Z","avatar_url":"https://github.com/je-es.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!----------------------------------- BEG -----------------------------------\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cp\u003e\n        \u003cimg src=\"./assets/img/logo.png\" alt=\"syntax\" height=\"80\" /\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Unified-black\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Developer%20Friendly-black\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/LSP%20Ready-black\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Enhanced%20Linting-black\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" style=\"font-style:italic; color:gray\"\u003e\n    A comprehensive wrapper that unifies lexer and \u003cbr\u003e\n    parser modules into a streamlined interface for creating custom syntax.\u003cbr\u003e\n    It provides LSP integration, CLI tooling support, and advanced linting with early error detection.\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./assets/img/line.png\" alt=\"line\" style=\"display: block; margin-top:20px;margin-bottom:20px;width:500px;\"/\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\u003c!---------------------------------------------------------------------------\u003e\n\n\n\n\u003c!----------------------------------- HOW -----------------------------------\u003e\n\n## 🚀 Installation\n\n```bash\nnpm install @je-es/syntax\n```\n\n```typescript\nimport * as syntax from '@je-es/syntax';\n```\n\n\u003cbr\u003e\n\n## 🌟 How to Use\n\n\u003e The [@je-es/lexer](https://github.com/je-es/lexer) and [@je-es/parser](https://github.com/je-es/parser) modules are designed as completely independent, lightweight components with zero dependencies.\n\u003e\n\u003e While this modular architecture ensures flexibility and focused functionality, integrating these modules can be complex for end users.\n\n\u003e **@je-es/syntax** solves this by providing a unified wrapper that streamlines the development experience.\n\u003e\n\u003e This enables you to create different syntaxes through a consistent API, while offering dedicated interfaces for Language Server Protocol (LSP) and CLI applications.\n\u003e\n\u003e The wrapper facilitates seamless parsing, advanced linting capabilities, and early syntax error detection before code generation.\n\n```ts\nconst mySyntax = syntax.create({\n    name     : 'mySyntax',\n    version  : '0.0.1',\n    lexer    : { .. },\n    parser   : [ .. ],\n    settings : { .. }\n});\n\nconst result = mySyntax.parse('some code');\n```\n\n\u003cbr\u003e\n\n\u003c!---------------------------------------------------------------------------\u003e\n\n\n\n\u003c!----------------------------------- API -----------------------------------\u003e\n\n## 📖 API Reference\n\n- #### Functions\n\n    ```ts\n    // Create a new syntax object with the given configuration.\n    function create(config: SyntaxConfig): Syntax\n    ```\n\n- #### Syntax Class\n\n  - #### Fields\n\n    ```ts\n    // The configuration object for the syntax, containing\n    // the lexer rules, parser rules, and parser settings.\n    public config: SyntaxConfig;\n    ```\n\n    ```ts\n    // The parser instance used to parse the syntax tree.\n    public parser: parser.Parser;\n    ```\n\n  - #### Functions\n\n    ```ts\n    // Parse a given input string into a structured syntax\n    // tree using the syntax's parser.\n    parse(input: string): parser.ParseResult\n    ```\n\n    ```ts\n    // Similar to parse, but returns only the errors in the parse result.\n    lint(input: string): parser.ParseError[]\n    ```\n\n    ```ts\n    // Create a new Syntax object with the given start rule and debug level,\n    // using the current syntax's configuration.\n    from(ruleName: string, debug: parser.DebugLevel | null = null) : Syntax\n    ```\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./assets/img/line.png\" alt=\"line\" style=\"display: block; margin-top:20px;margin-bottom:20px;width:500px;\"/\u003e\n\u003c/div\u003e\n\n\u003c!---------------------------------------------------------------------------\u003e\n\n\n\n\u003c!----------------------------------- REL -----------------------------------\u003e\n\n- #### 🔗 Related\n\n  - ##### [@je-es/lexer](https://github.com/je-es/lexer)\n      \u003e Fundamental lexical analyzer that transforms source text into structured tokens with type and position information.\n\n  - ##### [@je-es/parser](https://github.com/je-es/parser)\n      \u003e Advanced syntax analyzer that converts tokens into AST with customizable grammar rules and intelligent error detection.\n\n  - ##### @je-es/syntax\n      \u003e Unified wrapper that streamlines syntax creation with integrated lexer-parser coordination, LSP support, and enhanced linting capabilities.\n\n  - ##### [@je-es/program](https://github.com/je-es/program)\n      \u003e A high-performance, type-safe program representation library with advanced semantic analysis for programming languages.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./assets/img/line.png\" alt=\"line\" style=\"display: block; margin-top:20px;margin-bottom:20px;width:500px;\"/\u003e\n\u003c/div\u003e\n\n\u003c!---------------------------------------------------------------------------\u003e\n\n\n\n\u003c!----------------------------------- END -----------------------------------\u003e\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/maysara-elshewehy\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Made with ❤️ by-Maysara-orange\"/\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003c!---------------------------------------------------------------------------\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fje-es%2Fsyntax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fje-es%2Fsyntax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fje-es%2Fsyntax/lists"}