@stackables/bridge-parser
v1.5.0
Published
Bridge DSL parser — turns .bridge text into a BridgeDocument (AST)
Readme
The Bridge Parser
The parser for The Bridge — turns .bridge source text into a BridgeDocument (AST).
Installing
npm install @stackables/bridge-parserParsing a Bridge File
The most common thing you'll do — read a .bridge file and get instructions the engine can run:
import { parseBridge } from "@stackables/bridge-parser";
import { readFileSync } from "node:fs";
const source = readFileSync("logic.bridge", "utf8");
const instructions = parseBridge(source);
// → Instruction[] — feed this to executeBridge() or bridgeTransform()Serializing Back to .bridge
Round-trip support — parse a bridge file, then serialize the AST back into clean .bridge text:
import {
parseBridgeFormat,
serializeBridge,
} from "@stackables/bridge-parser";
const ast = parseBridgeFormat(source);
const formatted = serializeBridge(ast);Part of the Bridge Ecosystem
| Package | What it does |
| ---------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| @stackables/bridge | The All-in-One — everything in a single install |
| @stackables/bridge-core | The Engine — runs the instructions this package produces |
| @stackables/bridge-compiler | The Compiler — compiles BridgeDocument into optimized JavaScript |
| @stackables/bridge-graphql | The Adapter — wires bridges into a GraphQL schema |
| @stackables/bridge-stdlib | The Standard Library — httpCall, strings, arrays, and more |
| @stackables/bridge-types | Shared Types — ToolCallFn, ToolMap, CacheStore |
