9d27edafd014eadeeb88318c85a04f26a5972027 blob 1442 bytes (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| | zero programming language specification
=======================================
ABSTRACT
--------
This document specifies the semantics and behavior of the Zero Programming
Language for compiler programmers be informed how the language is designed.
This specification is on DRAFT and will evolve through discussions on olang-dev
mailing list.
Language Syntax
---------------
This is the Zero Programming Language EBNF grammar specification
NOTE: This grammar spec is a DRAFT and it covers only a small portion of the
language.
```
<program> ::= <function-definition>
<function-definition> ::= <fn_keyword> <space>+ <identifier> <space>* <f-args> <space>* <colon> <space>* <type> <space>* <block>
<identifier> ::= <alpha>+
| <alpha>+ <number>*
;
<f-args> ::= '(' <space>* ')'
<block> ::= <ocurly> <space>* <statement>* <space>* <ccurly>
<statement> ::= <return-statement>
<return-statement> ::= <return_keyword> <space>* <number>* <space>* <semicolon>
<semicolon> ::= ';'
<ocurly> ::= '{'
<ccurly> ::= '}'
<type> ::= 'u32 '
<colon> ::= ':'
<alpha> ::= #'[a-zA-Z_]'
<number> ::= #'[0-9]'
<fn_keyword> ::= 'fn'
<return_keyword> ::= 'return'
<space> ::= #'[ \t\r\n]'
```
|
debug log:
solving 9d27eda ...
found 9d27eda in http://lists.johnnyrichard.com/olang/20240309000855.1059007-1-johnny@johnnyrichard.com/
applying [1/1] http://lists.johnnyrichard.com/olang/20240309000855.1059007-1-johnny@johnnyrichard.com/
diff --git a/docs/pages/language_specification.md b/docs/pages/language_specification.md
new file mode 100644
index 0000000..9d27eda
1:22: trailing whitespace.
This is the Zero Programming Language EBNF grammar specification
Checking patch docs/pages/language_specification.md...
Applied patch docs/pages/language_specification.md cleanly.
warning: 1 line adds whitespace errors.
index at:
100644 9d27edafd014eadeeb88318c85a04f26a5972027 docs/pages/language_specification.md
Code repositories for project(s) associated with this public inbox
https://git.johnnyrichard.com/olang.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox