Grammar Reference
Cesium does not have a complete formal grammar yet. Writing one is tracked in cesiumlang/cesium#57, and it is being published as part of the language specification (cesiumlang/cesiumlang.org#13).
What Exists Today
| Resource | What it is |
|---|---|
| Language Specification (draft) | The formal definition, in progress |
| Specification: Lexical Structure | Tokens, comments, identifiers, keywords and literals, with the undecided parts marked |
| Specification: the S0 subset | The grammar and rules of S0, the part of the language the first compiler stage accepts |
| cesiumlang/grammar | The TextMate grammar used for syntax highlighting on this site and in editors. It is regex-based and is not a definition of the language |
Known Gaps
These syntax questions have to be answered before a grammar for the full language can be written:
| Question | Issue |
|---|---|
Function definitions (T = name(...) {) cannot always be told apart from assignments | cesiumlang/cesium#27 |
| Decorated operators collide with postfix transpose; bitwise NOT has no spelling | cesiumlang/cesium#28 |
| Angle-bracket generics are ambiguous with comparison operators | cesiumlang/cesium#29 |
| Several operators have no precedence level | cesiumlang/cesium#15 |
| Numeric literal forms are not specified | cesiumlang/cesium#56 |
| String and character literals, escapes | cesiumlang/cesium#39 |
| The reserved-word list | cesiumlang/cesium#50 |