Skip to content

Commit

Permalink
[mlir][LangRef] Add top-level production to the MLIR grammar
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bollu authored and Groverkss committed Jan 21, 2022
1 parent b6a41fd commit 357f2d9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mlir/docs/LangRef.md
Expand Up @@ -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:
Expand Down

0 comments on commit 357f2d9

Please sign in to comment.