@atomic-ehr/ucum
Version:
TypeScript implementation of UCUM (Unified Code for Units of Measure)
21 lines • 601 B
TypeScript
export type TokenType = 'ATOM' | 'PREFIX' | 'DIGIT' | 'DOT' | 'SLASH' | 'LPAREN' | 'RPAREN' | 'LBRACE' | 'RBRACE' | 'CARET' | 'PLUS' | 'MINUS' | 'STAR' | 'EOF';
export interface Token {
type: TokenType;
value: string;
position: number;
length: number;
}
export declare class Lexer {
private input;
private position;
private tokens;
constructor(input: string);
tokenize(): Token[];
private skipWhitespace;
private isDigit;
private isLetter;
private readNumber;
private readAtomOrPrefix;
private addToken;
}
//# sourceMappingURL=lexer.d.ts.map