{"id":19879321,"url":"https://github.com/jubayer98/a-simple-syntax-analyzer","last_synced_at":"2026-02-12T04:03:36.345Z","repository":{"id":127510766,"uuid":"134271919","full_name":"jubayer98/A-Simple-Syntax-Analyzer","owner":"jubayer98","description":"A syntax analyzer (parser) was developed using Flex and Bison tools based on the grammar specified in the README file.","archived":false,"fork":false,"pushed_at":"2024-08-03T17:57:47.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T17:51:00.946Z","etag":null,"topics":["lex","syntax-analysis","yacc"],"latest_commit_sha":null,"homepage":"","language":"Lex","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/jubayer98.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}},"created_at":"2018-05-21T13:19:22.000Z","updated_at":"2024-08-03T17:57:51.000Z","dependencies_parsed_at":"2025-01-11T17:49:15.717Z","dependency_job_id":"2295caf7-bda7-4a5c-8244-17d0fe7bd4d6","html_url":"https://github.com/jubayer98/A-Simple-Syntax-Analyzer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jubayer98%2FA-Simple-Syntax-Analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jubayer98%2FA-Simple-Syntax-Analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jubayer98%2FA-Simple-Syntax-Analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jubayer98%2FA-Simple-Syntax-Analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jubayer98","download_url":"https://codeload.github.com/jubayer98/A-Simple-Syntax-Analyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241309105,"owners_count":19941724,"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":["lex","syntax-analysis","yacc"],"created_at":"2024-11-12T17:08:09.288Z","updated_at":"2026-02-12T04:03:36.311Z","avatar_url":"https://github.com/jubayer98.png","language":"Lex","readme":"# A Simple Syntax Analyzer\n\nThis repository contains a syntax analyzer (parser) developed using Flex and Bison for a simple programming language grammar. The grammar rules are provided below and implemented in the code.\n\n## Grammar\n\n```\nPROG   → STMTS\n\nSTMTS  → STMT STMTS | ɛ\n\nSTMT   → DTYPE id IDLIST ;\n       | id := EXPR ;\n       | if ( EXPR ) then BLOCK\n       | while ( EXPR ) BLOCK\n\nIDLIST → , id | ɛ\n\nBLOCK  → { STMTS }\n\nEXPR   → EXPR OPTR TERM | TERM\n       | ( EXPR ) | neg EXPR\n\nTERM   → id | CONST\n\nDTYPE  → int | float | char\n\nCONST  → ilit | rlit | clit | slit\n\nOPTR   → + | - | * | / | %\n```\n\n## Tools Used\n\n- **Flex**: A tool for generating scanners: programs that recognize lexical patterns in text.\n- **Bison**: A parser generator that converts an annotated context-free grammar into a deterministic LR or GLR parser.\n\n## Getting Started\n\n### Prerequisites\n\n- **Flex**: Ensure Flex is installed on your system.\n- **Bison**: Ensure Bison is installed on your system.\n\n### Running the Analyzer\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/jubayer98/A-Simple-Syntax-Analyzer.git\n   cd A-Simple-Syntax-Analyzer\n   ```\n\n2. **Generate Scanner and Parser**:\n   ```bash\n   flex g20.l\n   bison -d g20.y\n   ```\n\n3. **Compile the Code**:\n   ```bash\n   gcc lex.yy.c parser.tab.c -o syntax_analyzer\n   ```\n\n4. **Run the Analyzer**:\n   ```bash\n   ./syntax_analyzer \u003c input_file.txt\n   ```\n\n## Contribution\n\nContributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.\n\n---\n\nEnjoy using the simple syntax analyzer built with Flex and Bison!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjubayer98%2Fa-simple-syntax-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjubayer98%2Fa-simple-syntax-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjubayer98%2Fa-simple-syntax-analyzer/lists"}