-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Pt edited this page Jun 17, 2026
·
2 revisions
Lc is built as a layered runtime system with strict boundaries between parsing, dispatch, execution state, and output generation.
-
EngineBuilderinbuilder.go. - Assembles parser, pipeline, context, logger, scope, default events, and endianness.
-
EngineUniversalinengine.go. - Stable API for both engines: process input, register commands, access shared params.
-
engine/stringEngine.gofor text command dispatch. -
engine/byteEngine.gofor opcode dispatch and pointer control.
-
Generator: deterministic pipeline output. -
Events: ordered event bus. -
Logger: thread-safe structured log storage/printing. -
UniversalEngineParams: shared runtime container.
events/stringEngine.goevents/byteEngine.go
stringParsing/*byteParsing/*
- Event handlers execute in registration order.
- Output is resolved in configured pipeline order.
- Scope state is shared intentionally across parser/event/handler stages.
-
INPUT stringscope injection. - parse to
PARSED []ParsedNode. - command dispatch by node switch.
- output emission to generator points.
-
INPUT []bytescope injection. - parse to
PARSED []ParsedBytes. - opcode dispatch by decoded switch.
- instruction pointer movement via auto/manual policy.
Mutex-guarded internals exist in:
- engine command maps,
- generator storage,
- event registry access,
- logger write paths.
This supports service-level embedding where concurrent operations and state integrity matter.
Both engines support context-aware processing:
ProcessStringWithCtxProcessBytesWithCtx
Default call events check context and stop on cancellation.