# AST

## Node

抽象構文木(AST)の基本的な建設部材です。一般に、`Node`は言語文法の非終端記号を表します。ただし、識別子やリテラルなどとして、終端記号がツリーに保持されています。

ASTノードのドキュメントを構成するものは、2つのキーとなるものです。AST内の型を識別するノードの`SyntaxKind`と、ASTにインスタンス化されたときにノードが提供するAPIである `interface`です。

いくつかの主要な `interface Node`のメンバがあります：

* ソースファイル内のノードの`start`と`end`を識別する`TextRange`メンバ
* ASTの中でノードの親となる`parent?: Node`

`Node`のフラグと修飾子のために、いくつか他のメンバがあります。あなたはソースコード中で`interface Node`を検索することで見つけることができます。しかし、上記で言及したものは、ノードトラバーサル(node traversal)のために不可欠です。

## SourceFile

* `SyntaxKind.SourceFile`
* `interface SourceFile`。

各`SourceFile`は`Program`に含まれるトップレベルのASTノードです。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://typescript-jp.gitbook.io/deep-dive/overview/ast.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
