What language is used to describe an Abstract Syntax Tree in ESTree?

吃可爱长大的小学妹 提交于 2021-02-11 15:44:11

问题


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";
}

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?


回答1:


As also pointed out by Bergi, the README states

The spec uses a custom syntax to describe its structures.

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



来源:https://stackoverflow.com/questions/55060072/what-language-is-used-to-describe-an-abstract-syntax-tree-in-estree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!