How beefyandtheducks/xmlsharp works
XMLSharp is a command-line toolchain for a small XMLSharp language: users compile source files to an intermediate representation (IR), or run a file, compiling it first when it is not already IR. The visible run command establishes that compile-if-needed workflow, and the interpreter executes IR instructions through operation handlers. The tree shows compiler stages for lexing, validation, AST construction, desugaring, and IR handling, but their internal calls are not shown in the sampled source. No README is present, so additional documented capabilities cannot be confirmed.
Main entry points: Compiler.cs Compiler entry · Interpreter.cs Interpreter · Program.cs Command dispatch · RunCommand.cs Run command
Components 20
CLI
- Command dispatch
XMLSharp/Program.cs - Compile command
XMLSharp/Commands/CompileCommand.cs - Run command
XMLSharp/Commands/RunCommand.cs
Compiler
- Compiler entry
XMLSharpCompiler/Compiler.cs - Lexer
XMLSharpCompiler/Lexer.cs - Syntax validator
XMLSharpCompiler/SyntaxValidator.cs - Syntax rules
XMLSharpCompiler/SyntaxRules.cs - AST generator
XMLSharpCompiler/AstGenerator.cs - Desugarer
XMLSharpCompiler/Desugarer.cs - Import expansion
XMLSharpCompiler/ImportExpander.cs
Language model
- IR handling
Common/IR.cs - AST nodes
Common/AstNodes.cs - IR model
Common/IIR.cs - Diagnostics
Common/ErrorReporter.cs
Runtime
- Interpreter
XMLSharpInterpreter/Interpreter.cs - Operation handlers
XMLSharpInterpreter/OperationHandlers.cs
Other components
- CLI user
- Source file
- IR file
- Program output
Connections 22
- CLI user → Command dispatch: invokes
- Command dispatch → Compile command: dispatches
- Command dispatch → Run command: dispatches
- Source file → Compile command: supplies input
- Compile command → Compiler entry: compiles
- Run command → Compiler entry: compiles if needed
- Run command → Interpreter: starts
- Compiler entry → Lexer: uses
- Compiler entry → Syntax validator: uses
- Syntax validator → Syntax rules: applies
- Compiler entry → AST generator: uses
- AST generator → AST nodes: creates
- Compiler entry → Desugarer: uses
- Compiler entry → Import expansion: uses
- Compiler entry → IR handling: emits IR
- IR handling → IR model: uses
- Compiler entry → Diagnostics: reports errors
- IR handling → IR file: writes
- Interpreter → IR model: reads
- Interpreter → Operation handlers: dispatches
- Operation handlers → Program output: writes
- Interpreter → Program output: reports status