问题
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