[Mlir-commits] [mlir] 357f2d9 - [mlir][LangRef] Add top-level production to the MLIR grammar

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jan 21 03:40:11 PST 2022


Author: Siddharth Bhat
Date: 2022-01-21T17:08:53+05:30
New Revision: 357f2d9ccf204981fd90481ba5ebb942ea46d7f9

URL: https://github.com/llvm/llvm-project/commit/357f2d9ccf204981fd90481ba5ebb942ea46d7f9
DIFF: https://github.com/llvm/llvm-project/commit/357f2d9ccf204981fd90481ba5ebb942ea46d7f9.diff

LOG: [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

Added: 
    

Modified: 
    mlir/docs/LangRef.md

Removed: 
    


################################################################################
diff  --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md
index 357778a54f087..4b956c581cb55 100644
--- a/mlir/docs/LangRef.md
+++ b/mlir/docs/LangRef.md
@@ -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:


        


More information about the Mlir-commits mailing list