Download Visual Studio Community Edition: https://visualstudio.microsoft.com/vs/community/
Install the C# Console package from the installer.
Clone the project
git clone https://github.com/Sabelo710/SARSCustomsRiskEngine.git
Enter the SARSCustomsRiskEngine folder
cd SARSCustomsRiskEngineOpen the Visual Studio solution's file: SARSCustomsRiskEngine.sln (should be done after successfully installing Visual Studio above)
Start the application

-
Layered & Plug-in Architecture
The code is split into thin horizontal layers that only depend downward, enabling independent evolution and testability.Copy
┌────────────┐ CLI / UI / Web API (thin, replaceable) │ Program │ ├────────────┤ │ Results │ DTO returned to callers (RpnParseResult) ├────────────┤ │ Parsers │ Tokenizer + AST builder (RpnParser) ├────────────┤ │ Nodes │ Concrete AST nodes (OperandNode, OperatorNode) ├────────────┤ │Abstractions│ Contracts (ExpressionNode) ├────────────┤ │ Models │ Immutable value objects (Operand, Operator) └────────────┘ -
Domain-Driven Building Blocks
-
Value Objects –
Operand,Operatorencapsulate scalar values & behavior. -
Entities / Nodes –
OperandNode,OperatorNodeform a small Expression Tree aggregate. -
Domain Service –
RpnParserorchestrates tokenization and tree construction. -
Anti-Corruption Layer –
RpnParseExceptionprevents leaking low-level parsing errors.
-
-
Open/Closed Design
-
New operators: extend
Operator.csonly. -
New syntax (e.g., infix): add another parser class; reuse existing nodes & models.
-
-
Testability
-
Every public type is small, sealed, and has single responsibility → trivial unit tests.
-
No static state; parser is instantiable and side-effect free.
-
-
Deployment Flexibility
-
Core assembly (
*.Core) can be packaged as NuGet and reused in web APIs, Azure Functions, or Blazor apps. -
CLI (
Program.cs) is a thin adapter that can be swapped for any other host.
-
In short, the architecture is a micro-domain layer with clean boundaries, minimal surface, and maximal extensibility.