/** * 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 { Encoding } from '../text/Encoding'; import { PhpParserOptions } from './PhpParserOptions'; import { SourceTextSyntaxNode } from '../language/syntax/SourceTextSyntaxNode'; import { SyntaxDiagnostic } from '../diagnostics/SyntaxDiagnostic'; import { SyntaxTreeBase } from './SyntaxTree'; /** * @todo Document PhpSyntaxTree. */ export declare class PhpSyntaxTree extends SyntaxTreeBase { /** * @inheritDoc */ readonly path: string; /** * @inheritDoc */ readonly root: SourceTextSyntaxNode; /** * Parser configuration options. */ protected readonly options: PhpParserOptions; /** * Creates a `PhpSyntaxTree` object. * * @param {SourceTextSyntaxNode} root * The root node of a parsed source file. * @param {string} path * The location of the source file. * @param {PhpParserOptions} options * Parser configuration options. */ constructor(root: SourceTextSyntaxNode, path: string, options: PhpParserOptions); /** * Parses a string into a syntax tree. * * @param {string} text * A string containing source code. * @param {string=} path * The location of the source file. * @param {PhpParserOptions=} options * Parser configuration options. * @param {Encoding=} encoding * The original encoding of the source text. Defaults to `Encoding.Utf8`. */ static fromText(text: string, path?: string, options?: PhpParserOptions, encoding?: Encoding): PhpSyntaxTree; /** * @inheritDoc */ getDiagnostics(): IterableIterator; }