structurizr-parser
Version:
Parses Structurizr DSL files
410 lines (387 loc) • 16 kB
text/typescript
import * as chevrotain from 'chevrotain';
import { Lexer, CstParser } from 'chevrotain';
import { Workspace as Workspace$1 } from 'structurizr-typescript';
declare const BlockComment: chevrotain.TokenType;
declare const LineComment: chevrotain.TokenType;
declare const HashComment: chevrotain.TokenType;
declare const Url: chevrotain.TokenType;
declare const FilePath: chevrotain.TokenType;
declare const StringLiteral: chevrotain.TokenType;
declare const Identifier: chevrotain.TokenType;
declare const BangInclude: chevrotain.TokenType;
declare const BangConstant: chevrotain.TokenType;
declare const BangDocs: chevrotain.TokenType;
declare const BangAdrs: chevrotain.TokenType;
declare const BangIndentifiers: chevrotain.TokenType;
declare const BangImpliedRelationships: chevrotain.TokenType;
declare const Workspace: chevrotain.TokenType;
declare const Extends: chevrotain.TokenType;
declare const Model: chevrotain.TokenType;
declare const Name: chevrotain.TokenType;
declare const Enterprise: chevrotain.TokenType;
declare const Group: chevrotain.TokenType;
declare const Person: chevrotain.TokenType;
declare const SoftwareSystem: chevrotain.TokenType;
declare const Container: chevrotain.TokenType;
declare const Component: chevrotain.TokenType;
declare const DeploymentEnvironment: chevrotain.TokenType;
declare const DeploymentGroup: chevrotain.TokenType;
declare const DeploymentNode: chevrotain.TokenType;
declare const InfrastructureNode: chevrotain.TokenType;
declare const SoftwareSystemInstance: chevrotain.TokenType;
declare const ContainerInstance: chevrotain.TokenType;
declare const Element: chevrotain.TokenType;
declare const Views: chevrotain.TokenType;
declare const SystemLandscape: chevrotain.TokenType;
declare const SystemContext: chevrotain.TokenType;
declare const Filtered: chevrotain.TokenType;
declare const Dynamic: chevrotain.TokenType;
declare const Deployment: chevrotain.TokenType;
declare const Custom: chevrotain.TokenType;
declare const Image: chevrotain.TokenType;
declare const Title: chevrotain.TokenType;
declare const Animation: chevrotain.TokenType;
declare const Styles: chevrotain.TokenType;
declare const Relationship: chevrotain.TokenType;
declare const Themes: chevrotain.TokenType;
declare const Theme: chevrotain.TokenType;
declare const Branding: chevrotain.TokenType;
declare const Terminology: chevrotain.TokenType;
declare const Configuration: chevrotain.TokenType;
declare const Users: chevrotain.TokenType;
declare const Include: chevrotain.TokenType;
declare const AutoLayout: chevrotain.TokenType;
declare const Description: chevrotain.TokenType;
declare const Properties: chevrotain.TokenType;
declare const Shape: chevrotain.TokenType;
declare const Background: chevrotain.TokenType;
declare const Color: chevrotain.TokenType;
declare const Colour: chevrotain.TokenType;
declare const ShapeEnum: chevrotain.TokenType;
declare const FontSize: chevrotain.TokenType;
declare const Opacity: chevrotain.TokenType;
declare const Equals: chevrotain.TokenType;
declare const RelatedTo: chevrotain.TokenType;
declare const Value: chevrotain.TokenType;
declare const Bool: chevrotain.TokenType;
declare const HexColor: chevrotain.TokenType;
declare const Word: chevrotain.TokenType;
declare const Float: chevrotain.TokenType;
declare const Int: chevrotain.TokenType;
declare const Wildcard: chevrotain.TokenType;
declare const LBrace: chevrotain.TokenType;
declare const RBrace: chevrotain.TokenType;
declare const WhiteSpace: chevrotain.TokenType;
declare const allTokens: chevrotain.TokenType[];
declare const StructurizrLexer: Lexer;
declare class structurizrParser extends CstParser {
constructor();
workspaceWrapper: chevrotain.ParserMethod<[], chevrotain.CstNode>;
private workspaceSection;
private modelSection;
private modelChildSection;
private systemGroupSection;
private systemGroupChildSection;
private personSection;
private softwareSystemSection;
private softwareSystemChildSection;
private containerSection;
private containerChildSection;
private componentSection;
private explicitRelationship;
private implicitRelationship;
private deploymentEnvironmentSection;
private deploymentEnvironmentChildSection;
private deploymentNodeSection;
private deploymentNodeChildSection;
private containerInstanceSection;
private softwareSystemInstanceSection;
private viewsSection;
private viewsChildSection;
private systemLandscapeView;
private viewOptions;
private includeOptions;
private autoLayoutOptions;
private animationOptions;
private descriptionOptions;
private propertiesOptions;
private systemContextView;
private containerView;
private componentView;
private imageSection;
private dynamicSection;
private deploymentSection;
private stylesSection;
private elementStyleSection;
private relationshipStyleSection;
private shapeStyle;
private backgroundStyle;
private colorStyle;
private colourStyle;
private fontStyle;
private opacityStyle;
}
declare const StructurizrParser: structurizrParser;
declare const BaseStructurizrVisitor: new (...args: any[]) => chevrotain.ICstVisitor<any, any>;
declare class structurizrInterpreter extends BaseStructurizrVisitor {
private _debug;
private elementsByIdentifier;
private workspace;
constructor();
set Debug(flag: boolean);
workspaceWrapper(node: any): Workspace$1;
workspaceSection(node: any): void;
modelSection(node: any): void;
modelChildSection(node: any): void;
systemGroupSection(node: any): void;
systemGroupChildSection(node: any): void;
personSection(node: any): void;
softwareSystemSection(node: any): void;
softwareSystemChildSection(node: any): void;
containerSection(node: any): void;
containerChildSection(node: any): void;
componentSection(node: any): void;
explicitRelationship(node: any): void;
implicitRelationship(node: any): void;
deploymentEnvironmentSection(node: any): void;
deploymentEnvironmentChildSection(node: any): void;
deploymentNodeSection(node: any): void;
deploymentNodeChildSection(node: any): void;
containerInstanceSection(node: any): void;
softwareSystemInstanceSection(node: any): void;
viewsSection(node: any): void;
viewsChildSection(node: any): void;
systemLandscapeView(node: any): void;
viewOptions(node: any, view: any): void;
includeOptions(node: any, view: any): void;
autoLayoutOptions(node: any, view: any): void;
animationOptions(node: any): void;
descriptionOptions(node: any): void;
propertiesOptions(node: any): void;
systemContextView(node: any): void;
containerView(node: any): void;
componentView(node: any): void;
imageSection(node: any): void;
dynamicSection(node: any): void;
deploymentSection(node: any): void;
stylesSection(node: any): void;
elementStyleSection(node: any): void;
relationshipStyleSection(node: any): void;
shapeStyle(node: any): void;
backgroundStyle(node: any): void;
colorStyle(node: any): void;
colourStyle(node: any): void;
fontStyle(node: any): void;
opacityStyle(node: any): void;
}
declare const StructurizrInterpreter: structurizrInterpreter;
declare class C4Relationship {
private targetId;
private description?;
private technology?;
constructor(targetId: string, description?: string, technology?: string);
get TargetId(): string;
get Description(): string | undefined;
get Technology(): string | undefined;
}
declare class C4Element {
private id;
private name;
private description;
private tags;
private relationships;
constructor(id: string, name: string, description?: string, tags?: string[]);
get Id(): string;
get Name(): string;
get Description(): string;
get Tags(): string[];
get Relationships(): C4Relationship[];
addRelationship(targetId: string, description?: string, technology?: string): void;
}
declare class C4Component extends C4Element {
constructor(id: string, name: string, description?: string);
findElement(e_id: string): C4Element[];
}
declare class C4Container extends C4Element {
private components;
constructor(id: string, name: string, description?: string);
addComponent(component: C4Component): void;
findElement(e_id: string): C4Element[];
get Components(): C4Component[];
get NestedRelationships(): C4Relationship[];
}
declare class C4Person extends C4Element {
private location;
constructor(id: string, name: string, description?: string, location?: "External" | "Internal" | "Unspecified");
findElement(e_id: string): C4Element[];
get Location(): "External" | "Internal" | "Unspecified";
}
declare class C4SoftwareSystem extends C4Element {
private containers;
constructor(id: string, name: string, description?: string);
addContainer(container: C4Container): void;
findElement(e_id: string): C4Element[];
get Containers(): C4Container[];
get NestedRelationships(): C4Relationship[];
}
declare class C4Group {
private id;
private name;
private people;
private softwaresystems;
constructor(id: string, name: string);
addPerson(person: C4Person): void;
addSoftwareSystem(ssys: C4SoftwareSystem): void;
get Id(): string;
get Name(): string;
get People(): C4Person[];
get SoftwareSystems(): C4SoftwareSystem[];
findElement(e_id: string): C4Element[];
}
declare class C4ElementStyle {
tag: string;
shape?: "Box" | "RoundedBox" | "Circle" | "Ellipse" | "Hexagon" | "Cylinder" | "Pipe" | "Person" | "Robot" | "Folder" | "WebBrowser" | "MobileDevicePortrait" | "MobileDeviceLandscape" | "Component";
background?: string;
color?: string;
constructor();
}
declare class C4Model {
private people;
private softwaresystems;
private groups;
constructor();
addGroup(group: C4Group): void;
addPerson(person: C4Person): void;
addSoftwareSystem(ssys: C4SoftwareSystem): void;
addRelationship(s_id: string, t_id: string, desc: string): void;
findElement(e_id: string): C4Element[];
get People(): C4Person[];
get SoftwareSystems(): C4SoftwareSystem[];
get Groups(): C4Group[];
}
declare class C4RelationshipStyle {
}
declare class C4Styles {
private elementStyles;
private relationshipStyles;
constructor();
addElementStyle(style: C4ElementStyle): void;
addRelationshipStyle(style: C4RelationshipStyle): void;
get ElementStyles(): C4ElementStyle[];
get RelationshipStyles(): C4RelationshipStyle[];
}
declare class C4View {
private type;
private key?;
private description?;
private include;
constructor(type: "SystemLandscape" | "SystemContext" | "Container" | "Component", key?: string, description?: string);
includeEntity(id: string): void;
get Type(): "SystemLandscape" | "SystemContext" | "Container" | "Component";
get Key(): string | undefined;
get Description(): string | undefined;
get Include(): string[];
}
declare class C4SystemLandscapeView extends C4View {
/**
*
*/
constructor(key?: string, description?: string);
}
declare class C4Workspace {
private id;
private name;
private description?;
private model;
private views;
private styles;
constructor(id: string, name: string, description?: string);
setName(name: string): void;
setDescription(description: string): void;
addGroup(group: C4Group): void;
addPerson(person: C4Person): void;
addSoftwareSystem(ssys: C4SoftwareSystem): void;
addRelationship(s_id: string, t_id: string, desc: string): void;
addView(view: C4SystemLandscapeView): void;
addRelationshipStyle(style: C4RelationshipStyle): void;
addElementStyle(style: C4ElementStyle): void;
get Model(): C4Model;
get Views(): C4View[];
get Styles(): C4Styles;
}
declare class c4Interpreter extends BaseStructurizrVisitor {
private _debug;
private workspace;
constructor();
set Debug(flag: boolean);
workspaceWrapper(node: any): C4Workspace;
workspaceSection(node: any): void;
modelSection(node: any): void;
modelChildSection(node: any): void;
systemGroupSection(node: any): void;
systemGroupChildSection(node: any, group: C4Group): void;
personSection(node: any, group?: C4Group): void;
softwareSystemSection(node: any, group?: C4Group): void;
softwareSystemChildSection(node: any, ssys: C4SoftwareSystem): void;
containerSection(node: any, ssys: C4SoftwareSystem): void;
containerChildSection(node: any, ctr: C4Container): void;
componentSection(node: any, ctr: C4Container): void;
explicitRelationship(node: any): void;
implicitRelationship(node: any): void;
deploymentEnvironmentSection(node: any): void;
deploymentEnvironmentChildSection(node: any): void;
deploymentNodeSection(node: any): void;
deploymentNodeChildSection(node: any): void;
containerInstanceSection(node: any): void;
softwareSystemInstanceSection(node: any): void;
viewsSection(node: any): void;
viewsChildSection(node: any): void;
systemLandscapeView(node: any): void;
viewOptions(node: any, view: any): void;
includeOptions(node: any, view: any): void;
autoLayoutOptions(node: any, view: any): void;
animationOptions(node: any): void;
descriptionOptions(node: any): void;
propertiesOptions(node: any): void;
systemContextView(node: any): void;
containerView(node: any): void;
componentView(node: any): void;
imageSection(node: any): void;
dynamicSection(node: any): void;
deploymentSection(node: any): void;
stylesSection(node: any): void;
elementStyleSection(node: any): void;
relationshipStyleSection(node: any): void;
shapeStyle(node: any, style: any): void;
backgroundStyle(node: any, style: any): void;
colorStyle(node: any, style: any): void;
colourStyle(node: any, style: any): void;
fontStyle(node: any): void;
opacityStyle(node: any): void;
}
declare const C4Interpreter: c4Interpreter;
declare class C4ComponentView extends C4View {
private componentID;
/**
*
*/
constructor(componentId: string, key?: string, description?: string);
get ComponentId(): string;
}
declare class C4ContainerView extends C4View {
private containerID;
/**
*
*/
constructor(containerId: string, key?: string, description?: string);
get ContainerId(): string;
}
declare class C4SystemContextView extends C4View {
private systemID;
/**
*
*/
constructor(systemId: string, key?: string, description?: string);
get SystemId(): string;
}
export { Animation, AutoLayout, Background, BangAdrs, BangConstant, BangDocs, BangImpliedRelationships, BangInclude, BangIndentifiers, BaseStructurizrVisitor, BlockComment, Bool, Branding, C4Component, C4ComponentView, C4Container, C4ContainerView, C4Element, C4ElementStyle, C4Group, C4Interpreter, C4Model, C4Person, C4Relationship, C4RelationshipStyle, C4SoftwareSystem, C4Styles, C4SystemContextView, C4SystemLandscapeView, C4View, C4Workspace, Color, Colour, Component, Configuration, Container, ContainerInstance, Custom, Deployment, DeploymentEnvironment, DeploymentGroup, DeploymentNode, Description, Dynamic, Element, Enterprise, Equals, Extends, FilePath, Filtered, Float, FontSize, Group, HashComment, HexColor, Identifier, Image, Include, InfrastructureNode, Int, LBrace, LineComment, Model, Name, Opacity, Person, Properties, RBrace, RelatedTo, Relationship, Shape, ShapeEnum, SoftwareSystem, SoftwareSystemInstance, StringLiteral, StructurizrInterpreter, StructurizrLexer, StructurizrParser, Styles, SystemContext, SystemLandscape, Terminology, Theme, Themes, Title, Url, Users, Value, Views, WhiteSpace, Wildcard, Word, Workspace, allTokens };