{"id":48578760,"url":"https://github.com/shakurt/expression-compiler","last_synced_at":"2026-04-08T16:05:18.201Z","repository":{"id":320673887,"uuid":"1081782320","full_name":"shakurt/expression-compiler","owner":"shakurt","description":"A simple educational JavaScript project that simulates a mini compiler. It takes a mathematical expression as input and performs lexical, syntactic, semantic analysis, intermediate code generation, and basic optimization — all visualized step by step in React.","archived":false,"fork":false,"pushed_at":"2025-10-25T07:15:13.000Z","size":230,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-25T07:17:31.247Z","etag":null,"topics":["ast","codegen","compiler","compiler-construction","educational","expression-compiler","lexer","math-parser","parser","react","react-d3-tree","three-address-code","transpiler","typescript","visualization"],"latest_commit_sha":null,"homepage":"https://shakurt.github.io/expression-compiler/","language":"TypeScript","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/shakurt.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-23T09:27:44.000Z","updated_at":"2025-10-25T07:15:17.000Z","dependencies_parsed_at":"2025-10-25T07:17:37.614Z","dependency_job_id":null,"html_url":"https://github.com/shakurt/expression-compiler","commit_stats":null,"previous_names":["shakurt/expression-compiler"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/shakurt/expression-compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurt%2Fexpression-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurt%2Fexpression-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurt%2Fexpression-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurt%2Fexpression-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakurt","download_url":"https://codeload.github.com/shakurt/expression-compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakurt%2Fexpression-compiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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":["ast","codegen","compiler","compiler-construction","educational","expression-compiler","lexer","math-parser","parser","react","react-d3-tree","three-address-code","transpiler","typescript","visualization"],"created_at":"2026-04-08T16:05:18.135Z","updated_at":"2026-04-08T16:05:18.188Z","avatar_url":"https://github.com/shakurt.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Expression Compiler (React + TypeScript)\n\nThis project is a simple expression compiler built for a university compiler course. It demonstrates the main stages of compilation for mathematical expressions:\n\n- **Lexical Analysis**: Tokenizes the input string (identifiers, numbers, operators, parentheses, functions).\n- **Parsing**: Builds an Abstract Syntax Tree (AST) from the token stream.\n- **AST Visualization**: Shows the parse tree using a graphical tree view.\n- **Code Generation**: Produces three-address code (TAC) from the AST.\n\n## Features\n\n- Input and validate math expressions (supports variables, numbers, +, -, *, /, ^, parentheses, and `sqrt` function).\n- See the token list, transformed expression, parse tree, and generated TAC.\n- All logic is implemented in TypeScript and React.\n- Visualizes the parse tree using `react-d3-tree`.\n- Styled with Tailwind CSS.\n\n## Main Packages Used\n\n- [React](https://react.dev/) — UI framework\n- [Vite](https://vitejs.dev/) — build tool and dev server\n- [Tailwind CSS](https://tailwindcss.com/) — utility-first CSS framework\n- [react-d3-tree](https://github.com/bkrem/react-d3-tree) — parse tree visualization\n\n## Getting Started\n\n1. Install dependencies:\n   ```bash\n   npm install\n   ```\n2. Start the development server:\n   ```bash\n   npm run dev\n   ```\n3. Open [http://localhost:5173](http://localhost:5173) in your browser.\n\n## Project Structure\n\n- `src/utils/lexer.ts` — Lexer (tokenizer)\n- `src/utils/parser.ts` — Parser and AST builder\n- `src/utils/codegen.ts` — Three-address code generator\n- `src/components/InputForm.tsx` — Main input and analysis UI\n- `src/components/TreeView.tsx` — Parse tree visualization\n- `src/App.tsx` — App layout and stage display\n\n---\n\nThis project is for educational purposes and demonstrates the basic steps of compiling and visualizing simple math expressions in a web app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakurt%2Fexpression-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakurt%2Fexpression-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakurt%2Fexpression-compiler/lists"}