DefinitelyTyped/types/antlr4/IntervalSet.d.ts
Marlon Chatman 877ced9c4b Add Antlr4 Definitions/Types (#27120)
* Add antlr4 definitions/types

* Update the tsconfig.json for the antlr4 types

* Update the tsconfig.json for the antlr4 types. Use files instead of includes.

* Remove antlr4-test.ts to antlr4-tests.ts, for the antlr4 types

* Remove the c-parser.ts, for the antlr4 types. As this is not allowed in the antlr4-test.ts

* Fix antlr4 types test lint failure

* Update the linting and the tslint.json

* Update the tslint.json, for antlr4 types
2018-07-13 12:46:40 -07:00

50 lines
1.1 KiB
TypeScript

import { Token } from './Token';
export class Interval {
readonly length: number;
readonly start: number;
readonly stop: number;
constructor(start: number, stop: number);
contains(item: number): boolean;
toString(): string;
}
export class IntervalSet {
readonly readOnly: boolean;
readonly intervals: Interval[];
readonly length: boolean;
first(): number;
addOne(v: number): void;
addRange(l: number, h: number): void;
addInterval(interval: Interval): void;
addSet(other: IntervalSet): void;
reduce(k: number): void;
complement(start: number, stop: number): IntervalSet;
contains(item: number): boolean;
removeRange(interval: Interval): boolean;
removeOne(v: number): boolean;
toString(literalNames?: string[], symbolicNames?: string[], elemsAreChar?: boolean): string;
toCharString(): string;
toIndexString(): string;
toTokenString(literalNames: string[], symbolicNames: string[]): string;
elementName(literalNames: string[], symbolicNames: string[], token: Token): string;
}