UNPKG

@cucumber/gherkin

Version:
43 lines (42 loc) 1.55 kB
import type { Background, Comment, DataTable, DocString, Examples, Feature, GherkinDocument, IdGenerator, Location, Rule, Step, TableRow, Tag } from '@cucumber/messages'; import AstNode from './AstNode.js'; import type { IAstBuilder } from './IAstBuilder.js'; import type IToken from './IToken.js'; import { RuleType, TokenType } from './Parser.js'; export default class AstBuilder implements IAstBuilder<AstNode, TokenType, RuleType> { stack: AstNode[]; comments: Comment[]; readonly newId: IdGenerator.NewId; constructor(newId: IdGenerator.NewId); reset(): void; startRule(ruleType: RuleType): void; endRule(): void; build(token: IToken<TokenType>): void; getResult(): any; currentNode(): AstNode; getLocation(token: IToken<TokenType>, column?: number): Location; getTags(node: AstNode): Tag[]; getCells(tableRowToken: IToken<TokenType>): { location: Location; value: string; }[]; getDescription(node: AstNode): any; getSteps(node: AstNode): any[]; getTableRows(node: AstNode): { id: string; location: Location; cells: { location: Location; value: string; }[]; }[]; ensureCellCount(rows: TableRow[]): void; transformNode(node: AstNode): string | { id: string; location: Location; cells: { location: Location; value: string; }[]; }[] | Background | DataTable | DocString | Examples | Feature | GherkinDocument | Rule | Step | AstNode; }