Context
interface Context<Type> {
index: number;
length: number;
clone<Type>(): Context<Type>;
consume<Type>(token: Type, howMany?: number): boolean;
consume<Type>(token: Type, howMany?: number): boolean;
current<Type>(): Type | null;
done(): boolean;
next<Type>(): Type | null;
peek<Type>(): Type | null;
slice<Type>(): Type[];
update<Type>(context: Context<Type>): void;
}
index: number;
length: number;
clone<Type>(): Context<Type>;
consume<Type>(token: Type, howMany?: number): boolean;
consume<Type>(token: Type, howMany?: number): boolean;
current<Type>(): Type | null;
done(): boolean;
next<Type>(): Type | null;
peek<Type>(): Type | null;
slice<Type>(): Type[];
update<Type>(context: Context<Type>): void;
}
Type Parameters
- Type
The length of the context tokens to be consumed