ESTree中抽象语法树用什么语言来描述? [英] What language is used to describe an Abstract Syntax Tree in ESTree?

查看:27
本文介绍了ESTree中抽象语法树用什么语言来描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我指的是 ECMAScript 2015 的 ESTree 文档此处.

I am referring the ESTree documentation for ECMAScript 2015 here.

例如,它使用以下语法:

For instance, it uses the following syntax:

extend interface Program {
    sourceType: "script" | "module";
    body: [ Statement | ModuleDeclaration ];
}

interface ForOfStatement <: ForInStatement {
    type: "ForOfStatement";
}

AST 的这种表示是什么语言?我们在哪里可以阅读有关用于描述 AST 的规范或对所用自定义格式的解释的信息?

What language is this representation of the AST? Where can we read about the specification used to describe an AST or explanation of the custom format used?

推荐答案

正如 Bergi 所指出的,README 状态

As also pointed out by Bergi, the README states

规范使用自定义语法来描述其结构.

The spec uses a custom syntax to describe its structures.

核心模型在 es5.md 中描述,包含了解更高规范 (ES2015+) 中描述的扩展所需的大部分基础知识.

The core model is described in es5.md and contains most of the basics required to understand the extensions described in higher specifications (ES2015+).

这篇关于ESTree中抽象语法树用什么语言来描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆