{"id":17037735,"url":"https://github.com/dmq/js-parser","last_synced_at":"2026-02-07T22:03:38.916Z","repository":{"id":46705011,"uuid":"513088670","full_name":"DMQ/js-parser","owner":"DMQ","description":"JS 代码解析器 ，生成AST、生成代码、解析执行代码","archived":false,"fork":false,"pushed_at":"2022-07-19T11:46:47.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T03:51:36.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DMQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-12T09:58:37.000Z","updated_at":"2024-05-22T09:11:01.000Z","dependencies_parsed_at":"2022-09-04T01:22:55.576Z","dependency_job_id":null,"html_url":"https://github.com/DMQ/js-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DMQ/js-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMQ%2Fjs-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMQ%2Fjs-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMQ%2Fjs-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMQ%2Fjs-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DMQ","download_url":"https://codeload.github.com/DMQ/js-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DMQ%2Fjs-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29209857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T21:35:21.898Z","status":"ssl_error","status_checked_at":"2026-02-07T21:35:20.106Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-14T08:54:56.103Z","updated_at":"2026-02-07T22:03:38.895Z","avatar_url":"https://github.com/DMQ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS 代码解析器\n\u003e 极简版本AST代码解析器，支持的js语法有限，但模块较完整：词法分析、语法分析（生成AST)、生成代码（依赖AST)、执行代码（依赖AST）\n\n1. 本项目供学习使用，仅实现以下AST类型，（完整的AST类型有哪些？👉 [estree](https://github.com/estree/estree)）\n```javascript\n{\n  Program: 'Program', // 程序\n  VariableDeclaration: 'VariableDeclaration', // 变量声明，可包含多个 VariableDeclarator，如：var a,b;\n  VariableDeclarator: 'VariableDeclarator', // 变量声明器\n  FunctionDeclaration: 'FunctionDeclaration', // 函数声明\n  Identifier: 'Identifier', // 标识符\n  NumericLiteral: 'NumericLiteral', // 数字字面量\n  StringLiteral: 'StringLiteral', // 字符串字面量\n  BlockStatement: 'BlockStatement', // 块级语句\n  ExpressionStatement: 'ExpressionStatement', // 表达式语句\n  AssignmentExpression: 'AssignmentExpression', // 赋值表达式\n  CallExpression: 'CallExpression', // 函数调用表达式\n  MemberExpression: 'MemberExpression', // 成员表达式，如：obj.a\n};\n```\n2. 模块指引\n- [TokenStream](./ast/token-stream.js)\n- [AST Parser](./ast/ast-parser.js)\n- [Code Generator](./process-ast/generator.js)\n- [Code Excutor](./process-ast/executor.js)\n\n3. 执行Demo\n```\nnode ./demo.js\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmq%2Fjs-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmq%2Fjs-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmq%2Fjs-parser/lists"}