import TypeIndex from "../../indexing/type_index.js"; import ParsingBuffer from "../../parsing/parsing_buffer.js"; import StepVtableBuilder, { IndexMark } from "./step_vtable_builder.js"; export interface StepIndexEntryBase { address: number; length: number; typeID?: TypeIDType; expressID?: number; multiMapping?: StepIndexEntryBase[]; inlineEntities?: StepInlineIndexEntry[]; } export interface StepInlineIndexEntry extends StepIndexEntryBase { expressID?: undefined; } export interface StepIndexEntry extends StepIndexEntryBase { expressID: number; } export interface StepIndex { elements: StepIndexEntry[]; } export interface Argument { type: number; value: any; } /** * */ export declare enum ParseResult { COMPLETE = 0, INCOMPLETE = 1, SYNTAX_ERROR = 2, MISSING_TYPE = 3, INVALID_STEP = 4 } export type BlockParseResult = [ StepIndex, ParseResult ]; export type LineArgumentParseResult = [ StepIndex, ParseResult ]; export interface StepHeader { headers: Map; } export type HeaderParseResult = [ StepHeader, ParseResult ]; /** * Parser base for header parsing. */ export declare class StepHeaderParser { private static instance_?; /** * Get the singleton static instance of this. * * @return {StepHeaderParser} The singleton instance of this. */ static get instance(): StepHeaderParser; /** * Will parse the input up to data block (including the DATA token). * * @param input The input buffer to parse the header from. * @return {HeaderParseResult} The parse result for the header, plus the header values. */ parseHeader(input: ParsingBuffer): HeaderParseResult; } /** * Parses out STEP files to allow indexing and deserialization. */ export default class StepParser extends StepHeaderParser { private readonly index_; /** * Construct this with the type-index that will be used to map element types * to tokens. * * @param index_ The index. */ constructor(index_: Readonly>); /** * This uses a much lighter non correctness verifying parse to extract the locations of * the fields for an entry, using the v-table builder to * append the top level entries. * * In this case, the cursor should represent the start of the * * @param input * @param cursor * @param endCursor * @param vtableBuilder * @return {[IndexMark, number] | undefined} The vtable slice or undefined if it's not * defined due to an error. */ extractDataEntry(input: Uint8Array, cursor: number, endCursor: number, vtableBuilder: StepVtableBuilder): [ IndexMark, number, number ] | undefined; /** * Parse the data block of a step file, indexing it., * * @param input The input parsing buffer, in the data section. * @return {BlockParseResult} The parsing result, including the index and result enum. */ parseDataBlock(input: ParsingBuffer): BlockParseResult; /** * Parse arguments from a single line from a step file, indexing it., * * @param input The input parsing buffer, in the data section. * @param expressID * @return {LineArgumentParseResult} The parsing result, including the * arguments array and result enum. */ extractArguments(input: ParsingBuffer, expressID: number): [ any, ParseResult ]; } //# sourceMappingURL=step_parser.d.ts.map