{"id":25828455,"url":"https://github.com/paladitya/jparser","last_synced_at":"2025-06-11T17:32:03.198Z","repository":{"id":119918706,"uuid":"207291777","full_name":"PalAditya/JParser","owner":"PalAditya","description":"A Java library to give YACC like facility","archived":false,"fork":false,"pushed_at":"2020-10-13T17:51:11.000Z","size":31,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T21:21:56.729Z","etag":null,"topics":["functional-programming","java","java8","lambdas","library","maven","parser","utility-application","yacc"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/PalAditya.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-09T11:18:47.000Z","updated_at":"2020-11-23T04:14:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b4bce9d-9bdd-4c4c-b2ef-c20b106f3fde","html_url":"https://github.com/PalAditya/JParser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PalAditya/JParser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PalAditya%2FJParser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PalAditya%2FJParser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PalAditya%2FJParser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PalAditya%2FJParser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PalAditya","download_url":"https://codeload.github.com/PalAditya/JParser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PalAditya%2FJParser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259308157,"owners_count":22837974,"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":["functional-programming","java","java8","lambdas","library","maven","parser","utility-application","yacc"],"created_at":"2025-02-28T17:39:42.671Z","updated_at":"2025-06-11T17:32:03.192Z","avatar_url":"https://github.com/PalAditya.png","language":"Java","readme":"# JParser: An easy-to-use library to quickly debug your work.\n\nCurrently supported parsers: *LR0*, *SLR*, *LR1* and *LALR* parsers.  \nA basic usage of the library is as easy as follows:\n\n```java\nLR1Parser obj=new LR1Parser();//Create an instance of the desired parser-In this case LR1 type parser\nobj.read_grammar(\"Path_to_grammar\");//Read the grammar file\nobj.buildDFA();//Build a dfa from the file\nSystem.out.println(obj.states);//Prints the transitions in all states\nobj.print_transitions();//Print all the transitions\nobj.getParsingTable(true);//Use false to avoid printing the table after creation\nobj.parse(\"a c e\",true);//Parse the string; use false to prevent the stack actions from displaying on screen\n```\n\nAn example grammar files is included in the files directory.\n\n- The map of the states\n\n![map](https://user-images.githubusercontent.com/25523604/64479680-d9936480-d1d7-11e9-9461-66f5ae88e970.PNG)\n\n- The parse table\n\n![table](https://user-images.githubusercontent.com/25523604/64479682-d9936480-d1d7-11e9-95a1-c502f42eb3e1.PNG)\n\n- The actions taken by stack to parse the table\n\n![Stack_actions](https://user-images.githubusercontent.com/25523604/64479679-d8face00-d1d7-11e9-826b-1674716a80aa.PNG)\n\n\u003ch2\u003eFunctions\u003c/h2\u003e\n\n*Parser.java* is the base class which all the other classes inherit from. It exposes the following methods:\n\n|Function|Return Type|Action|\n|------|---------|---------|\nread_grammar|void|Reads the grammar, augments it and fills in the list of terminals and non-terminals\njoin|String|Utility method to join convert ArrayList to String\ngetClosure|void|Accepts a HashSet of type \u003cParser.Pair\u003e and computes it's closure\ngetGoto|HashSet\u003cParser.Pair\u003eComputes Goto\naugment, unaugment| void,void| Augments and unaugments the grammar\nparse|void|Parses the string using the generated table\ngetIndex|int|Returns the index of the state, or -1 if a new state\npretty_it|void|Formatting\nprint_transitions|void|Prints all transitions\n\nYou can either clone the repository here for a minimal usage, or download it from maven, with full documentation and junit tests.\n\nIf you choose option 1, you can use **mvn clean install** on the files in src and pom.xml directly (don't use the files directory) to build the jar, javadoc and run tests.  \nThe files in the **files** directory gives you all the source files, if you want to run them individually, with more verbose debugging options.\n\nFor option 2 and **release** build:\n\n```java\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.PalAditya\u003c/groupId\u003e\n  \u003cartifactId\u003eparser-library\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nFor **snapshot** build:\n\n```java\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.PalAditya\u003c/groupId\u003e\n  \u003cartifactId\u003eparser-library\u003c/artifactId\u003e\n  \u003cversion\u003e0.1-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIn case you want the pre-release (latest) versions, you can download it manually from [here](https://oss.sonatype.org/content/repositories/central_bundles-18962/io/github/PalAditya/parser-library/0.1.1/)  \n\nMore documentation coming soon!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaladitya%2Fjparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaladitya%2Fjparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaladitya%2Fjparser/lists"}