[mlir][LangRef] Add top-level production to the MLIR grammar

The LangRef currently lacks a top-level production, leaving the productions attribute-alias-def and type-alias-defunused. Clarify the situation by declaring what is to be parsed by an MLIR parser at the toplevel.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117668
This commit is contained in:
Siddharth Bhat 2022-01-21 17:02:39 +05:30 committed by Groverkss
parent b6a41fddcf
commit 357f2d9ccf
1 changed files with 13 additions and 0 deletions

View File

@ -179,6 +179,19 @@ string-literal ::= `"` [^"\n\f\v\r]* `"` TODO: define escaping rules
Not listed here, but MLIR does support comments. They use standard BCPL syntax,
starting with a `//` and going until the end of the line.
### Top level Productions
```
// Top level production
toplevel := (operation | attribute-alias-def | type-alias-def)*
```
The production `toplevel` is the top level production that is parsed by any parsing
consuming the MLIR syntax. [Operations](#operations),
[Attribute alises](#attribute-value-aliases), and [Type aliases](#type-aliases)
can be declared on the toplevel.
### Identifiers and keywords
Syntax: