{"id":29177710,"url":"https://github.com/totvs/tds-parsers","last_synced_at":"2025-07-01T18:07:50.592Z","repository":{"id":57167340,"uuid":"288718550","full_name":"totvs/tds-parsers","owner":"totvs","description":"Extensão para análise sintática das linguagens proprietárias TOTVS.","archived":false,"fork":false,"pushed_at":"2021-08-27T14:07:33.000Z","size":12890,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-09T13:21:44.134Z","etag":null,"topics":["parsers"],"latest_commit_sha":null,"homepage":"","language":"xBase","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/totvs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-19T11:54:14.000Z","updated_at":"2024-07-26T17:16:48.000Z","dependencies_parsed_at":"2022-09-05T04:10:56.078Z","dependency_job_id":null,"html_url":"https://github.com/totvs/tds-parsers","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/totvs/tds-parsers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Ftds-parsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Ftds-parsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Ftds-parsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Ftds-parsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totvs","download_url":"https://codeload.github.com/totvs/tds-parsers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totvs%2Ftds-parsers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263013722,"owners_count":23399813,"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":["parsers"],"created_at":"2025-07-01T18:07:49.791Z","updated_at":"2025-07-01T18:07:50.569Z","avatar_url":"https://github.com/totvs.png","language":"xBase","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TOTVS Developer Studio: Analisador sintático\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n## Instalação\n\nPara uso local:\n\n```\nnpm install @totvs/tds-parsers\n```\n\nPara uso global:\n\n```\nnpm install @totvs/tds-parsers -g\n```\n\n## Uso embarcado (API)\n\nSe você deseja executar o **TDS-Parsers** via programa:\n\nImporte o pacote\n\n```ts\nimport { parser } from '@totvs/tds-parsers';\nimport { IParserOptions } from '@totvs/tds-parsers/typings/config';\nimport { ASTNode } from '@totvs/tds-parsers/typings/ast_node';\n```\n\n## `parser(source: string, parserInfo: IParserInfo): { ast: ASTNode~, error: Error }`\n\n`parser` executa a análise sintática do conteúdo em `source`, retornando a arvore sintátîca abstrata (_AST_, em ingles). `parserInfo.parser` deve ser informado de acordo com a linguagem a ser formatada. Os valores válidos são: `advpl` ou `4gl`. As demais informações são opcionais.\n\n```ts\ntry {\n    const parserInfo: any = {\n      debug: false, //adiciona informações de depuração do analisador\n      filepath: \"c:\\\\myProject\\\\file1.prw\", //localização do arquivo\n      parser: \"advpl\", //analisador a ser aplicado\n      fileext: \"prw\", //extensão do arquivo a ser considerado\n    };\n\n    const result: any = parser(source, parserInfo);\n    if (result.error) {\n      throw result.error;\n    }\n\n    // processamento da AST aqui\n\n  } catch (error) {\n    if (error.location) {\n      console.error(\n        `Sintax error: [${error.location.start.line}:${error.location.start.column}] ${error.message}`\n      );\n    } else {\n      console.error(error);\n    }\n    throw error;\n  }\n}\n```\n\n## Mantenedor\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/TOTVSDevelopers\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/20243897?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTOTVS S.A.\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-totvs\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#plugin-totvs\" title=\"Plugin/utility libraries\"\u003e🔌\u003c/a\u003e \u003ca href=\"#projectManagement-totvs\" title=\"Project Management\"\u003e📆\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Colaboradores\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/brodao\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/949914?v=4?s=50\" width=\"50px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlan Cândido\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/totvs/@totvs/prettier-plugin-4gl/commits?author=brodao\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/totvs/@totvs/prettier-plugin-4gl/commits?author=brodao\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/totvs/@totvs/prettier-plugin-4gl/commits?author=brodao\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotvs%2Ftds-parsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotvs%2Ftds-parsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotvs%2Ftds-parsers/lists"}