import { ExpressionNode, PositionNode } from "./nodes.js"; /** Represents a state in the deterministic finite automaton. */ export interface DFAState { positions: Set; transitions: Uint16Array; accepting: boolean; marked: boolean; tags: Set; } /** * This is an implementation of the direct regular expression to DFA algorithm described * in section 3.9.5 of "Compilers: Principles, Techniques, and Tools" by Aho, * Lam, Sethi, and Ullman. http://dragonbook.stanford.edu * There is a PDF of the book here: * http://www.informatik.uni-bremen.de/agbkb/lehre/ccfl/Material/ALSUdragonbook.pdf */ export default function buildDFA(root: ExpressionNode, numSymbols: number): DFAState[];