Skip to content

Commit c2df744

Browse files
authored
[spec/grammar] Add overview (#3912)
1 parent aee0c39 commit c2df744

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

spec/grammar.dd

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,30 @@ Ddoc
22

33
$(SPEC_S Grammar,
44

5-
$(NOTE This page is auto-generated, see the other pages for details.)
5+
$(P After the $(DDLINK spec/lex, Lexical, lexical analyzer) has created tokens
6+
from the source text, the tokens are parsed into the following key constructs:)
7+
8+
* A $(DDSUBLINK spec/module, Module, *Module*) normally has
9+
$(DDSUBLINK spec/module, DeclDef, *DeclDef*)s.
10+
* *DeclDef* can be a $(DDSUBLINK spec/declaration, Declaration, *Declaration*).
11+
* *Declaration* includes:
12+
* $(DDSUBLINK spec/declaration, VarDeclarations, *VarDeclarations*),
13+
which declares one or more variables with a $(DDSUBLINK spec/type, Type, *Type*)
14+
* $(DDSUBLINK spec/function, FuncDeclaration, *FuncDeclaration*), which can have a
15+
$(DDSUBLINK spec/statement, BlockStatement, *BlockStatement*)
16+
* *BlockStatement* can have $(DDSUBLINK spec/statement, Statement, *Statement*)s.
17+
* *Statement* includes:
18+
* *BlockStatement*
19+
* $(DDSUBLINK spec/statement, DeclarationStatement, *DeclarationStatement*), which has a
20+
*Declaration*
21+
* $(DDSUBLINK spec/statement, ExpressionStatement, *ExpressionStatement*), which has an
22+
$(DDSUBLINK spec/expression, Expression, *Expression*)
23+
24+
$(NOTE The remainder of this page is auto-generated, see the other pages for
25+
semantic details.)
626

727
$(HEADERNAV_TOC)
828

9-
$(H2 Lexical Syntax)
10-
11-
$(P Refer to the page for $(LINK2 lex.html, lexical syntax).)
12-
1329
$(GRAMMAR_SUMMARY)
1430

1531
$(SPEC_SUBNAV_PREV_NEXT istring, Interpolation Expression Sequence, module, Modules)

0 commit comments

Comments
 (0)