/** * Copyright 2017 Matt Acosta * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { INode } from './INode'; import { ISyntaxNode } from '../syntax/ISyntaxNode'; import { Node } from './Node'; import { NodeFlags } from './NodeFlags'; import { NodeList } from './NodeList'; import { NodeTransform } from './NodeTransform.Generated'; import { NodeVisitor } from './NodeVisitor.Generated'; import { SyntaxDiagnostic } from '../../diagnostics/SyntaxDiagnostic'; import { TokenKind } from '../TokenKind'; /** * A token that is part of the language syntax. */ export declare class TokenNode extends Node { /** * The type of the token. */ readonly kind: TokenKind; /** * @inheritDoc */ protected _flags: NodeFlags; /** * @inheritDoc */ protected _fullWidth: number; /** * @inheritDoc */ protected hash: number; /** * Constructs a `TokenNode` object. * * @param {TokenKind} kind * The type of the token. * @param {number} width * The width of the token. * @param {ReadonlyArray=} diagnostics * A list of diagnostics associated with the trivia token. */ constructor(kind: TokenKind, width: number, diagnostics?: ReadonlyArray); /** * @inheritDoc */ get flags(): NodeFlags; /** * @inheritDoc */ get fullWidth(): number; /** * @inheritDoc */ get isToken(): boolean; /** * @inheritdoc */ get leadingTrivia(): NodeList | null; /** * @inheritDoc */ get leadingTriviaWidth(): number; /** * @inheritDoc */ accept(visitor: NodeVisitor): void; /** * @inheritDoc */ acceptResult(visitor: NodeTransform): T; /** * @inheritDoc */ childAt(index: number): INode | null; /** * @inheritDoc */ createSyntaxNode(parent: ISyntaxNode, offset: number): T; /** * @inheritDoc */ equals(value: TokenNode): boolean; /** * @inheritDoc */ hashCode(): number; /** * @inheritDoc */ withDiagnostics(diagnostics: ReadonlyArray): TokenNode; /** * Returns a new token with the given leading trivia. */ withLeadingTrivia(leadingTrivia: NodeList | null): TokenNode; /** * @inheritDoc */ protected computeHashCode(): number; /** * @inheritDoc */ protected updateFlagsAndWidth(flags: NodeFlags, fullWidth: number): void; }