import { ExtractionResult, Language } from '../types';
/**
 * CfmlExtractor - Extracts code relationships from CFML source (.cfc/.cfm).
 *
 * tree-sitter-cfml splits CFML into two related grammars: `cfml` (tag-based —
 * `<cfcomponent>`/`<cffunction>`/HTML) and `cfscript` (modern bare-script
 * `component { ... }` syntax). The `cfml` grammar's own injections.scm treats
 * bare-script content as an opaque blob meant to be re-parsed by `cfscript` —
 * that re-parsing only happens at the editor/highlighting layer, not in the
 * raw AST, so this extractor replicates it: a file whose first real token
 * isn't `<` is delegated wholesale to the cfscript grammar (the dominant
 * modern style); otherwise the file is walked tag-by-tag with the cfml
 * grammar, delegating any `<cfscript>` tag bodies the same way — and the
 * expressions written in tags themselves (`<cfset>`, `<cfif>`, `#hash#`, …)
 * through the same cfscript extraction (see extractTagExpressions).
 */
export declare class CfmlExtractor {
    private filePath;
    private source;
    private language;
    private nodes;
    private nodeIds;
    private edges;
    private unresolvedReferences;
    private errors;
    private tagExpressions;
    /** `language` is the file's detected language — `'cfml'` for `.cfc`/`.cfm`, `'cfscript'` for `.cfs`. Both dialect-switch internally; this only controls the language tag stamped onto emitted nodes/refs. */
    constructor(filePath: string, source: string, language?: Language);
    extract(): ExtractionResult;
    /** Modern bare-script `.cfc`/`.cfm`: delegate the whole file to the cfscript grammar. */
    private extractBareScript;
    /** Legacy tag-based CFML: walk `<cfcomponent>`/`<cffunction>`, delegating `<cfscript>` bodies. */
    private extractTagBased;
    /** Build the file's own `kind:'file'` node, spanning the whole source. Tag-based files need this explicitly — unlike `extractBareScript` (which delegates the whole file to `TreeSitterExtractor` and inherits its file node), `extractTagBased` walks the tree itself and has no other source of one. */
    private createFileNode;
    /**
     * Walks `program`'s named children with a single forward cursor (not an
     * index loop) — `extractComponent` consumes a variable run of FOLLOWING
     * siblings as the component body (see its doc comment), so this must
     * resume from whatever it last consumed rather than revisiting those same
     * cffunction/cfscript siblings a second time as bogus top-level symbols.
     */
    private walkProgram;
    /**
     * `<cfcomponent extends="Base" implements="IFoo,IBar">...</cfcomponent>`.
     * The grammar's implicit-end-tag scanner means component body content
     * (cffunction tags, cfscript tags, etc.) appears as the open tag's FOLLOWING
     * siblings in `program`, not nested children — walk forward to the matching
     * cf_component_close_tag.
     */
    private extractComponent;
    /**
     * `<cfinterface extends="IBase,IOther">...</cfinterface>` (#2091). Unlike
     * `<cfcomponent>` (see the implicit-end-tag note on `extractComponent`) the
     * grammar has no dedicated rule for it: it is a generic `cf_tag` whose body
     * — the `<cffunction>` signatures — is ordinary nested children. Named like
     * a component (the file name, unless a `name` attribute says otherwise), so
     * `<cfcomponent implements="ISearchable">` resolves to it. An interface may
     * extend several interfaces, comma-separated.
     */
    private extractInterfaceTag;
    /** One unresolved `extends`/`implements` ref per name in a comma-separated tag attribute. */
    private pushInheritanceRefs;
    /**
     * `<cffunction name="..." access="..." returntype="...">...</cffunction>`.
     * `parentClassId` decides `method` vs top-level `function`; `containerId` is
     * the `contains`-edge target (the class when inside one, otherwise the file
     * node for a bare top-level cffunction) — kept separate so a top-level
     * function still gets a containment edge without being misclassified as a
     * method of the file. A method's qualifiedName is scoped under
     * `parentClassName` (`TagService::save`, the same `Class::member` shape the
     * generic extractor produces) so type-validated method resolution can match.
     */
    private extractFunctionTag;
    /**
     * Visit one node of tag markup. `containerId` is the scope the node sits in
     * — the function whose body it is, else the component, else the file — and
     * owns whatever calls it makes. `declScope` is true outside function bodies
     * (component/interface/template scope), where a `<cffunction>` declares a
     * function of that scope; `parentClassName` is set at component/interface
     * scope, where those functions are methods.
     *
     * - `<cfscript>`/`<cfquery>` bodies go to their own grammars (see
     *   delegateScriptTag / delegateQueryTag).
     * - A `<cffunction>` is extracted when reached at declaration scope, at any
     *   depth: `<cfprocessingdirective>` around Application.cfc's handlers
     *   (#2091) or `<cfsilent>` around a template's helpers doesn't make them
     *   any less the scope's functions. Never through an ERROR node — at file
     *   scope that is typically a `<cfcomponent>` the parser lost (behind an
     *   unclosed `<cfsetting>`), whose methods must not be misfiled as
     *   top-level functions. Inside a function body a `<cffunction>` would be
     *   its own scope; CFML rejects that, so it is skipped.
     * - An expression in tag position — the value of `<cfset>`, the condition
     *   of `<cfif>`/`<cfelseif>`, the operand of `<cfreturn>`, a `#hash#`
     *   anywhere in markup, attributes and strings included — is recorded for
     *   extractTagExpressions. The grammar parses these structurally (the same
     *   expression rules as cfscript), so `parentType` (the node's parent) is
     *   enough to tell the expression from the tag around it.
     */
    private visitTag;
    /**
     * Visit `node`'s children (see visitTag) — e.g. a `<cfscript>`/`<cfquery>`
     * nested inside `<cfif>`/`<cfloop>`/`<cftry>` control-flow tags, which
     * (unlike `<cfcomponent>`'s body — see the implicit-end-tag note on
     * `extractComponent`) ARE normal children, just possibly several levels
     * deep, so a direct-children check misses them. `parentClassName` rides
     * along so a `<cfscript>` at component scope classifies its functions as
     * methods scoped under the component.
     */
    private delegateNestedTags;
    /** Record an expression in tag markup, owned by `scopeId`, for extractTagExpressions. */
    private addTagExpression;
    /**
     * Extract calls from the expressions visitTag recorded, through the same
     * cfscript extraction a `<cfscript>` body gets — one parse per file, not
     * one per expression: the expressions are copied out in order, each on its
     * own line (the line breaks between them are kept, so every line number is
     * the file's) and ended with a `;`, and the result is read with the
     * cfscript grammar. Each reference is handed back to the scope whose
     * expression contains it, its column shifted back to the file's. Only
     * references are kept: an expression declares nothing (`<cfset var x = …>`
     * is a function local, and its `var` isn't copied), so a closure written in
     * one is part of its scope's code.
     */
    private extractTagExpressions;
    /** The recorded expression containing a synthesized-source position: the last one starting at or before it. */
    private tagExpressionAt;
    /** A generic `cf_tag`'s start tag — where its name and attributes live. */
    private cfStartTag;
    /** A generic `cf_tag`'s name, lowercased, without the `cf` prefix (`<cfLoop>` → `loop`). */
    private cfTagName;
    /**
     * Delegate a `<cfscript>...</cfscript>` tag body to the cfscript grammar.
     * With `parentClassName` set (the block sits at component scope), functions
     * declared at the script's top level are the component's methods
     * (`<cfcomponent><cfscript>function configure(){}` — the standard ColdBox
     * ModuleConfig shape): they're re-kinded `function` → `method`, and every
     * merged symbol's qualifiedName is prefixed with the component scope
     * (`configure` → `ModuleConfig::configure`) so type-validated method
     * resolution can match them. Functions nested inside another function
     * (closures) keep kind `function`.
     */
    private delegateScriptTag;
    /**
     * Delegate a `<cfquery>...</cfquery>` tag's SQL body to the `cfquery` grammar.
     * `#hash#` expressions inside the SQL (e.g. `#getCurrentUser().getId()#` in a
     * WHERE clause) are real CFML calls/references — tree-sitter-cfml's `cfquery`
     * grammar parses them structurally (same `call_expression`/`member_expression`
     * shape as cfscript), so without this delegation they're silently dropped as
     * opaque SQL text. The grammar models no other symbols, so only call/reference
     * extraction is relevant here — unlike `delegateScriptTag`, there are no nodes
     * or contains-edges to merge.
     */
    private delegateQueryTag;
    /** Read a `cf_attribute`'s value by name from a tag node's direct `cf_attribute`/`cf_tag_attributes` children. */
    private tagAttr;
    /**
     * The `attribute_value` node of a tag attribute — `undefined` when the tag
     * has no such attribute, `null` when its value isn't plain text (empty, or
     * a `#hash#` expression).
     */
    private tagAttrValueNode;
    private componentNameFromPath;
}
/**
 * Sniff whether CFML source is bare-script (`component { ... }`, modern style)
 * vs tag-based (`<cfcomponent>`, `<cfif>`, HTML). Skips a leading UTF-8 BOM
 * (endemic in CFML's Windows-editor history — 17% of ColdBox's files carry
 * one; both grammars parse fine with it once routed correctly), whitespace,
 * and `//`/`/* *\/` comments to find the first real token; tag-based files
 * start with `<`, script-based files don't.
 */
export declare function isBareScriptCfml(source: string): boolean;
//# sourceMappingURL=cfml-extractor.d.ts.map