Merge pull request #1755 from AleoHQ/abnf-input-files

[ABNF] Add (first draft of) input grammar.
This commit is contained in:
Collin Chin 2022-04-18 14:38:08 -07:00 committed by GitHub
commit 92ddc88477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 0 deletions

View File

@ -400,6 +400,7 @@ symbol = "!" / "&&" / "||"
/ "+" / "-" / "*" / "/" / "**"
/ "="
/ "(" / ")"
/ "[" / "]"
/ "{" / "}"
/ "," / "." / ".." / ";" / ":" / "?"
/ "->" / "_"
@ -875,4 +876,56 @@ Go to: _[format-string-close-brace](#user-content-format-string-close-brace), [f
<a name="format-string"></a>
```abnf
format-string = *format-string-element
```
--------
Input Grammar
-------------
<a name="input-type"></a>
```abnf
input-type = type
```
Go to: _[type](#user-content-type)_;
<a name="input-expression"></a>
```abnf
input-expression = literal
```
Go to: _[literal](#user-content-literal)_;
<a name="input-item"></a>
```abnf
input-item = identifier ":" input-type "=" input-expression ";"
```
Go to: _[identifier](#user-content-identifier), [input-expression](#user-content-input-expression), [input-type](#user-content-input-type)_;
<a name="input-title"></a>
```abnf
input-title = "[" identifier "]"
```
Go to: _[identifier](#user-content-identifier)_;
<a name="input-section"></a>
```abnf
input-section = input-title *input-item
```
Go to: _[input-title](#user-content-input-title)_;
<a name="input-file"></a>
```abnf
input-file = *input-section

View File

@ -177,6 +177,7 @@ symbol = "!" / "&&" / "||"
/ "+" / "-" / "*" / "/" / "**"
/ "="
/ "(" / ")"
/ "[" / "]"
/ "{" / "}"
/ "," / "." / ".." / ";" / ":" / "?"
/ "->" / "_"
@ -348,3 +349,20 @@ format-string-element = not-brace
/ format-string-close-brace
format-string = *format-string-element
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Input Grammar
; -------------
input-type = type
input-expression = literal
input-item = identifier ":" input-type "=" input-expression ";"
input-title = "[" identifier "]"
input-section = input-title *input-item
input-file = *input-section