I'm looking for the Typescript grammar. Not the parser-lexer, but only the formal grammar description. I want to implement ts it's code folding and basic static code analyzing as plugin to one simple linux IDE for GNOME.
Tony BenBrahim
Since typescript is a strict superset of Ecmascript 5 (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf/), you could exend any ecmascript bnf with syntax definitions from the Typescript spec.
A starting point could be: http://www.antlr3.org/grammar/1153976512034/ecmascriptA3.g
Maybe you can find references in the source code, e.g. compiler/tokens.js
来源:https://stackoverflow.com/questions/12720955/is-there-a-formal-ideally-bnf-typescript-js-language-grammar-or-only-typescri