How hsnkh12/query-language-interpreter works
Project type and purpose
• From the README and file tree, this is a language-processing tool: a custom query-language interpreter written in Go. It is not a full-stack web app but rather a CLI-driven compiler/interpreter pipeline designed to read queries, parse them, type-check them, and execute them via a query manager (presumably against an in-memory or external data store).
File structure
• cmd/main.go → the CLI entry point that reads user input or script files.
• internal/query_parser → implements the lexer (lexer.go), parser (parser.go), and type checkers (type_checkers.go). It produces an AST or intermediate representation.
• internal/query_interpreter → walks the AST, interprets commands, and plumbs through the query manager.
• internal/query_manager → dispatches parsed, checked queries into actual execution logic (CRUD operations on projects, collections, documents).
• internal/query_interpreter/types.go & parser/types.go → shared AST and semantic data types.
• tests/ → unit tests for parser and interpreter components.
• go.mod → Go module definition.
• query_language.txt → spec or examples of the custom language.
README for additional insights
• The README defines the DSL commands (“create project …”, “get from … where …”) and indicates that this combines a lexical analyzer, syntax analyzer, type checker, and interpreter.
• There is no built-in database connector in the tree; the “query_manager” likely abstracts document store operations (in memory or via an adapter you may add later).
Final advice
• Clearly label interfaces (e.g., QueryManager interface) versus implementations.
• Call out the extension point in QueryManager for plugging real DB backends.