How robertoraggi/cplusplus works
cxx-frontend is a work-in-progress C++26/C23 compiler frontend. Its user workflow is to submit source for preprocessing, parsing and analysis, then inspect or transform the resulting AST or emit code; the product also exposes a language server and a browser playground. The README documents an MLIR-based code-generation pipeline and playground integration. Internal links between native compiler stages are based on the repository’s module structure; sampled excerpts do not establish every call edge.
Main entry points: frontend.cc Native Frontend · Parser.ts Parser API · App.tsx Playground UI · cxx.cc C++ CLI
Components 19
Frontend Core
- C++ CLI
src/frontend/cxx/cxx.cc - Native Frontend
src/frontend/cxx/frontend.cc - Preprocessor
src/parser/cxx/preprocessor.cc - Lexer and Parser
src/parser/cxx/parser.cc - AST and Rewriter
src/parser/cxx/ast_rewriter.cc - WASM API
src/js/cxx/api.cc - Parser API
packages/cxx-frontend/src/Parser.ts
Semantic Analysis
- Semantic Analysis
src/parser/cxx/type_checker.cc - Linker
src/frontend/cxx/linker.cc
Code Generation
- Code Generator
src/codegen/cxx/codegen/codegen.cc - MLIR Backend
src/mlir/cxx/mlir/mlir_emitter.cc
Language Services
- LSP Server
src/lsp/cxx/lsp/lsp_server.cc - LSP Worker
packages/cxx-playground/src/lsp.worker.ts - LSP Client
packages/cxx-playground/src/lib/lsp-client.ts
Browser Playground
- Playground UI
packages/cxx-playground/src/App.tsx - Code Editor
packages/cxx-playground/src/code-editor.tsx - Output View
packages/cxx-playground/src/output-code.tsx
Other components
- Developer
- Browser User
Connections 18
- Developer → C++ CLI: submits source
- C++ CLI → Native Frontend: invokes frontend
- Native Frontend → Preprocessor: processes source
- Native Frontend → Lexer and Parser: parses source
- Native Frontend → Semantic Analysis: analyzes source
- Native Frontend → Linker: links units
- Parser API → WASM API: creates unit
- WASM API → Native Frontend: calls native
- Parser API → AST and Rewriter: exposes transforms
- Parser API → Code Generator: emits code
- Code Generator → MLIR Backend: emits MLIR
- Browser User → Playground UI: uses
- Playground UI → Code Editor: shows editor
- Code Editor → Parser API: submits source
- Parser API → Output View: returns output
- Playground UI → LSP Client: starts language tools
- LSP Client → LSP Worker: sends requests
- LSP Worker → LSP Server: serves LSP