{"id":37195895,"url":"https://github.com/padraicbc/gojsp","last_synced_at":"2026-01-14T22:47:11.827Z","repository":{"id":52477239,"uuid":"354028427","full_name":"padraicbc/gojsp","owner":"padraicbc","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-29T17:24:39.000Z","size":2822,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T15:55:51.090Z","etag":null,"topics":["antlr4","golang","javascript","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","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/padraicbc.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":"2021-04-02T13:31:48.000Z","updated_at":"2023-10-18T12:16:15.000Z","dependencies_parsed_at":"2022-08-31T12:03:38.579Z","dependency_job_id":null,"html_url":"https://github.com/padraicbc/gojsp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/padraicbc/gojsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padraicbc%2Fgojsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padraicbc%2Fgojsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padraicbc%2Fgojsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padraicbc%2Fgojsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/padraicbc","download_url":"https://codeload.github.com/padraicbc/gojsp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/padraicbc%2Fgojsp/sbom","scorecard":{"id":717649,"data":{"date":"2025-08-11","repo":{"name":"github.com/padraicbc/gojsp","commit":"922db5f59d5d3b5a4ee0b8f7aed42e24035bc390"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: runantlr/antlr-4.9.2-complete.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T10:13:00.605Z","repository_id":52477239,"created_at":"2025-08-22T10:13:00.605Z","updated_at":"2025-08-22T10:13:00.605Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":["antlr4","golang","javascript","parser"],"created_at":"2026-01-14T22:47:11.152Z","updated_at":"2026-01-14T22:47:11.822Z","avatar_url":"https://github.com/padraicbc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Very early attempt at creating an [ANTLR](https://www.antlr.org/) visitor for javascript files using GO. Going to change like Irish weather so don't expect things to stay the same any time soon. \n\n\nThe `base` is the result of running what is described [here](https://github.com/padraicbc/gojsp/tree/master/runantlr#readme)\n\nThe [vast](https://github.com/padraicbc/gojsp/tree/master/vast) folder is the implementation so far toward creating an ast which will allow easy manipulation/translation of the original source.\nThre are a few example functions in the exampls folder including how to parse and [manipulate](https://github.com/padraicbc/gojsp/blob/master/examples/singleexpress.go) a single expression. \n\n\n    import (\n\t    \"log\"\n\t    antlr \"github.com/padraicbc/antlr4\"\n\t    \"github.com/padraicbc/gojsp/base\"\n\t    \"github.com/padraicbc/gojsp/vast\"\n    )\n\n\n    \n\tcode := `i + j;`\n\tv := vast.NewVisitor(code)\n\t// do whatever with errors\n\tgo v.DefaultError()\n\t// start at ExpressionSequence\n\ttree := v.Parser.ExpressionSequence()\n\texp := visit(tree, v).(*vast.ExpressionSequence)\n\n\texpc := exp.FirstChild().(*vast.LRExpression)\n\n\tfmt.Println(expc.Left().(vast.Token).Value(), expc.OP().Value(), expc.Right().(vast.Token).Value())\n\t// change OP\n\texpc.OP().SetValue(\"/\")\n\texpc.Right().(vast.Token).SetValue(\"1000\")\n\tfmt.Println(expc.Left().(vast.Token).Value(), expc.OP().Value(), expc.Right().(vast.Token).Value())\n\n\t// reuse lexer and parser\n\tv.Stream.Seek(0)\n\tv.Lexer.SetInputStream(v.Stream)\n\ttokenStream := antlr.NewCommonTokenStream(v.Lexer, antlr.TokenDefaultChannel)\n\tv.Parser.SetInputStream(tokenStream)\n\n\ttree2 := v.Parser.ExpressionStatement()\n\texp2 := visit(tree2, v).(*vast.ExpressionStatement).FirstChild()\n\n\texpc = exp2.FirstChild().(*vast.LRExpression)\n\t// can be any singleExpression so any VNode\n\tfmt.Println(expc.Left().(vast.Token).Value(), expc.OP().Value(), expc.Right().(vast.Token).Value())\n\n\texpc = exp2.FirstChild().(*vast.LRExpression)\n\t// can be any singleExpression so any VNode\n\tfmt.Println(expc.Left().(vast.Token).Value(), expc.OP().Value(), expc.Right().(vast.Token).Value())\n\nAnd a very incomplete conversion from arrow to es5 functions but it shows the general idea:\n\n\tcode := `\n\t// Arrow Function Break Down\n\t// 1. Remove the word \"function\" and place arrow between the argument and opening body bracket\n\t(a) =\u003e {\n\treturn a + 100;\n\t}\n\n\t// 2. Remove the body brackets and word \"return\" -- the return is implied.\n\t(b) =\u003e b + 100;\n\n\t// 3. Remove the argument parentheses\n\tc =\u003e c \n\n\t// Arrow Function\n\t(a, b) =\u003e {\n\tlet chuck = 42;\n\treturn a + b + chuck;\n\t}\n\t`\n\n\tv := vast.NewVisitor(code)\n\ttree := v.Parser.Program()\n\tgo v.DefaultError()\n\t// v.Debug = true\n\n\trfs := visit(tree, v).(*vast.Program).Body\n\t// Statement -\u003eExpressionStatememts -\u003e ExpressionSequence\n\tfor _, fn := range rfs {\n\n\t\tvar trans string\n\t\t// all with one child\n\t\taf := fn.FirstChild().FirstChild().FirstChild().(*vast.ArrowFunction)\n\n\t\t// either has a function body with {} of a single expression.\n\t\tif af.Body.SingleExpression != nil {\n\t\t\t// can be there or not\n\t\t\tvar open, close string\n\t\t\tif af.FunctionParameters.OpenParen == nil {\n\t\t\t\topen, close = \"(\", \")\"\n\t\t\t}\n\n\t\t\ttrans = fmt.Sprintf(\"function%s%s%s {\\n\\treturn %s;\\n}\",\n\t\t\t\topen, af.FunctionParameters.Source, close, af.Body.SingleExpression.Code())\n\n\t\t} else {\n\n\t\t\ttrans = fmt.Sprintf(\"function%s %s\", af.FunctionParameters.Source, af.Body.Source)\n\n\t\t}\n\t\tfmt.Println(\"After -\u003e\", trans)\n\n\t}\n\t\nQuite verbose but more about getting it working than pretty to start...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadraicbc%2Fgojsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpadraicbc%2Fgojsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpadraicbc%2Fgojsp/lists"}