Skip to content

Commit b4d0bde

Browse files
Minor updates
1 parent e67d829 commit b4d0bde

11 files changed

+59
-51
lines changed

_sources/ez-lang.rst.txt

+18-14
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Keywords
1919
--------
2020
Following are keywords in the language::
2121

22-
func var int struct if else while break continue return
22+
func var int struct if else while break continue return null
2323

2424
Source Unit
2525
-----------
@@ -36,7 +36,7 @@ Types
3636
The only primitive type in the language is the integer type ``Int``.
3737
The size of this type is unspecified, the default implementation is 64-bit integers.
3838

39-
There is not a distinct boolean type, non-zero integer values evaluate as true, and ``0`` evaluates as false.
39+
There is not a distinct boolean type, non-zero integer values evaluate as true, and zero evaluates as false.
4040

4141
Users can define one-dimensional arrays and structs.
4242

@@ -47,7 +47,8 @@ The language does not specify whether the heap is garbage collected or manually
4747
up to the implementation.
4848

4949
A ``struct`` type is a named aggregate with one or more fields. Fields may of be of any supported
50-
type.
50+
type. Struct types are nominal, i.e. each struct type is identified uniquely by its name.
51+
Multiple definitions of a struct type are not allowed.
5152

5253
An array type is declared by enclosing the element type in brackets, i.e. ``[`` and ``]``.
5354

@@ -69,21 +70,18 @@ Examples::
6970
var array: [Tree?]?
7071
}
7172

72-
Struct types are nominal, i.e. each struct type is identified uniquely by its name.
73-
Multiple definitions of struct types is not allowed.
74-
7573
The language does not require forward declarations.
7674

7775
Functions
7876
---------
7977

8078
Users can declare functions, each function must have a unique name.
8179

82-
Polymorphic functions are not supported.
80+
Functions cannot be overloaded. Functions are not closures.
8381

8482
Functions can accept one or more arguments and may optionally return a result.
8583

86-
The ``func`` keyword instroduces a function declaration.
84+
The ``func`` keyword introduces a function declaration.
8785

8886
Examples::
8987

@@ -104,6 +102,11 @@ Examples::
104102
return fib(10)
105103
}
106104

105+
Literals
106+
--------
107+
108+
The only literals are integer values and ``null``.
109+
107110
Variables and Fields
108111
--------------------
109112

@@ -171,12 +174,12 @@ Examples::
171174
Control Flow
172175
------------
173176

174-
The language is lexically scoped, and block structured.
177+
The language is block structured.
175178

176179
A block is enclosed in ``{`` and ``}`` and introduces a lexical scope.
177180

178181
The ``if`` statement allows branching based on a condition. The condition must be an
179-
integer expression; a value of ``0`` is false, any other value is ``true``.
182+
integer expression; a value of zero is ``false``, any other value is ``true``.
180183

181184
The ``if`` statement can have an optional ``else`` branch.
182185

@@ -253,16 +256,17 @@ The following grammar describes the language syntax::
253256
;
254257

255258
typeName
256-
: simpleType
259+
: nominalType
257260
| arrayType
258261
;
259262

260-
simpleType
261-
: IDENTIFIER ('?')?
263+
nominalType
264+
: 'Int'
265+
| IDENTIFIER ('?')?
262266
;
263267

264268
arrayType
265-
: '[' simpleType ']' ('?')?
269+
: '[' nominalType ']' ('?')?
266270
;
267271

268272
functionDeclaration

abstract-syntax-tree.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ <h2>Example Implementation<a class="headerlink" href="#example-implementation" t
6363
<h3>Table of Contents</h3>
6464
<p class="caption" role="heading"><span class="caption-text">Preliminaries</span></p>
6565
<ul>
66-
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Implementation Language</a></li>
67-
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">EeZee Programming Language</a></li>
66+
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Compiler Implementation Language</a></li>
67+
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">The EeZee Programming Language</a></li>
6868
</ul>
6969
<p class="caption" role="heading"><span class="caption-text">Parsing Techniques</span></p>
7070
<ul class="current">

compiler-books.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ <h2>Other Book Reviews<a class="headerlink" href="#other-book-reviews" title="Pe
165165
<h3>Table of Contents</h3>
166166
<p class="caption" role="heading"><span class="caption-text">Preliminaries</span></p>
167167
<ul>
168-
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Implementation Language</a></li>
169-
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">EeZee Programming Language</a></li>
168+
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Compiler Implementation Language</a></li>
169+
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">The EeZee Programming Language</a></li>
170170
</ul>
171171
<p class="caption" role="heading"><span class="caption-text">Parsing Techniques</span></p>
172172
<ul>

ez-lang.html

+21-17
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<link rel="index" title="Index" href="genindex.html" />
1717
<link rel="search" title="Search" href="search.html" />
1818
<link rel="next" title="Lexical Analysis" href="lexical-analysis.html" />
19-
<link rel="prev" title="Implementation Language" href="prelim-impl-lang.html" />
19+
<link rel="prev" title="Compiler Implementation Language" href="prelim-impl-lang.html" />
2020
</head><body>
2121
<div class="header-wrapper" role="banner">
2222
<div class="header">
2323
<div class="headertitle"><a
2424
href="index.html">Compiler Programming</a></div>
2525
<div class="rel" role="navigation" aria-label="related navigation">
26-
<a href="prelim-impl-lang.html" title="Implementation Language"
26+
<a href="prelim-impl-lang.html" title="Compiler Implementation Language"
2727
accesskey="P">previous</a> |
2828
<a href="lexical-analysis.html" title="Lexical Analysis"
2929
accesskey="N">next</a> |
@@ -60,7 +60,7 @@ <h2>Language features<a class="headerlink" href="#language-features" title="Perm
6060
<section id="keywords">
6161
<h2>Keywords<a class="headerlink" href="#keywords" title="Permalink to this headline"></a></h2>
6262
<p>Following are keywords in the language:</p>
63-
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">func</span> <span class="n">var</span> <span class="nb">int</span> <span class="n">struct</span> <span class="k">if</span> <span class="k">else</span> <span class="k">while</span> <span class="k">break</span> <span class="k">continue</span> <span class="k">return</span>
63+
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">func</span> <span class="n">var</span> <span class="nb">int</span> <span class="n">struct</span> <span class="k">if</span> <span class="k">else</span> <span class="k">while</span> <span class="k">break</span> <span class="k">continue</span> <span class="k">return</span> <span class="n">null</span>
6464
</pre></div>
6565
</div>
6666
</section>
@@ -75,14 +75,15 @@ <h2>Source Unit<a class="headerlink" href="#source-unit" title="Permalink to thi
7575
<h2>Types<a class="headerlink" href="#types" title="Permalink to this headline"></a></h2>
7676
<p>The only primitive type in the language is the integer type <code class="docutils literal notranslate"><span class="pre">Int</span></code>.
7777
The size of this type is unspecified, the default implementation is 64-bit integers.</p>
78-
<p>There is not a distinct boolean type, non-zero integer values evaluate as true, and <code class="docutils literal notranslate"><span class="pre">0</span></code> evaluates as false.</p>
78+
<p>There is not a distinct boolean type, non-zero integer values evaluate as true, and zero evaluates as false.</p>
7979
<p>Users can define one-dimensional arrays and structs.</p>
8080
<p>Arrays and structs are implicitly reference types, i.e. instances of these types are
8181
allocated on the heap.</p>
8282
<p>The language does not specify whether the heap is garbage collected or manually managed, it is
8383
up to the implementation.</p>
8484
<p>A <code class="docutils literal notranslate"><span class="pre">struct</span></code> type is a named aggregate with one or more fields. Fields may of be of any supported
85-
type.</p>
85+
type. Struct types are nominal, i.e. each struct type is identified uniquely by its name.
86+
Multiple definitions of a struct type are not allowed.</p>
8687
<p>An array type is declared by enclosing the element type in brackets, i.e. <code class="docutils literal notranslate"><span class="pre">[</span></code> and <code class="docutils literal notranslate"><span class="pre">]</span></code>.</p>
8788
<p>There is a <code class="docutils literal notranslate"><span class="pre">Null</span></code> type, with a predefined literal named <code class="docutils literal notranslate"><span class="pre">null</span></code> of this type.</p>
8889
<p>When declaring fields or variables of reference types, user may suffix the type name with <code class="docutils literal notranslate"><span class="pre">?</span></code> to
@@ -100,16 +101,14 @@ <h2>Types<a class="headerlink" href="#types" title="Permalink to this headline">
100101
}
101102
</pre></div>
102103
</div>
103-
<p>Struct types are nominal, i.e. each struct type is identified uniquely by its name.
104-
Multiple definitions of struct types is not allowed.</p>
105104
<p>The language does not require forward declarations.</p>
106105
</section>
107106
<section id="functions">
108107
<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline"></a></h2>
109108
<p>Users can declare functions, each function must have a unique name.</p>
110-
<p>Polymorphic functions are not supported.</p>
109+
<p>Functions cannot be overloaded. Functions are not closures.</p>
111110
<p>Functions can accept one or more arguments and may optionally return a result.</p>
112-
<p>The <code class="docutils literal notranslate"><span class="pre">func</span></code> keyword instroduces a function declaration.</p>
111+
<p>The <code class="docutils literal notranslate"><span class="pre">func</span></code> keyword introduces a function declaration.</p>
113112
<p>Examples:</p>
114113
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">func</span> <span class="n">fib</span><span class="p">(</span><span class="n">n</span><span class="p">:</span> <span class="n">Int</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">Int</span> <span class="p">{</span>
115114
<span class="n">var</span> <span class="n">f1</span><span class="o">=</span><span class="mi">1</span>
@@ -130,6 +129,10 @@ <h2>Functions<a class="headerlink" href="#functions" title="Permalink to this he
130129
</pre></div>
131130
</div>
132131
</section>
132+
<section id="literals">
133+
<h2>Literals<a class="headerlink" href="#literals" title="Permalink to this headline"></a></h2>
134+
<p>The only literals are integer values and <code class="docutils literal notranslate"><span class="pre">null</span></code>.</p>
135+
</section>
133136
<section id="variables-and-fields">
134137
<h2>Variables and Fields<a class="headerlink" href="#variables-and-fields" title="Permalink to this headline"></a></h2>
135138
<p>The <code class="docutils literal notranslate"><span class="pre">var</span></code> keyword is used to introduce a new variable in the current lexical scope,
@@ -181,10 +184,10 @@ <h2>Creating new instances of structs<a class="headerlink" href="#creating-new-i
181184
</section>
182185
<section id="control-flow">
183186
<h2>Control Flow<a class="headerlink" href="#control-flow" title="Permalink to this headline"></a></h2>
184-
<p>The language is lexically scoped, and block structured.</p>
187+
<p>The language is block structured.</p>
185188
<p>A block is enclosed in <code class="docutils literal notranslate"><span class="pre">{</span></code> and <code class="docutils literal notranslate"><span class="pre">}</span></code> and introduces a lexical scope.</p>
186189
<p>The <code class="docutils literal notranslate"><span class="pre">if</span></code> statement allows branching based on a condition. The condition must be an
187-
integer expression; a value of <code class="docutils literal notranslate"><span class="pre">0</span></code> is false, any other value is <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
190+
integer expression; a value of zero is <code class="docutils literal notranslate"><span class="pre">false</span></code>, any other value is <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
188191
<p>The <code class="docutils literal notranslate"><span class="pre">if</span></code> statement can have an optional <code class="docutils literal notranslate"><span class="pre">else</span></code> branch.</p>
189192
<p>The only looping construct is the <code class="docutils literal notranslate"><span class="pre">while</span></code> statement; this executes the sub statement
190193
as long as the supplied condition evaluates to a non zero value.</p>
@@ -277,16 +280,17 @@ <h2>Grammar<a class="headerlink" href="#grammar" title="Permalink to this headli
277280
;
278281

279282
typeName
280-
: simpleType
283+
: nominalType
281284
| arrayType
282285
;
283286

284-
simpleType
285-
: IDENTIFIER (&#39;?&#39;)?
287+
nominalType
288+
: &#39;Int&#39;
289+
| IDENTIFIER (&#39;?&#39;)?
286290
;
287291

288292
arrayType
289-
: &#39;[&#39; simpleType &#39;]&#39; (&#39;?&#39;)?
293+
: &#39;[&#39; nominalType &#39;]&#39; (&#39;?&#39;)?
290294
;
291295

292296
functionDeclaration
@@ -402,7 +406,7 @@ <h2>Grammar<a class="headerlink" href="#grammar" title="Permalink to this headli
402406
<h3>Table of Contents</h3>
403407
<p class="caption" role="heading"><span class="caption-text">Preliminaries</span></p>
404408
<ul class="current">
405-
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Implementation Language</a></li>
409+
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Compiler Implementation Language</a></li>
406410
<li class="toctree-l1 current"><a class="current reference internal" href="#">The EeZee Programming Language</a></li>
407411
</ul>
408412
<p class="caption" role="heading"><span class="caption-text">Parsing Techniques</span></p>
@@ -443,7 +447,7 @@ <h3 style="margin-top: 1.5em;">Search</h3>
443447
<div class="footer">
444448
<div class="left">
445449
<div role="navigation" aria-label="related navigaton">
446-
<a href="prelim-impl-lang.html" title="Implementation Language"
450+
<a href="prelim-impl-lang.html" title="Compiler Implementation Language"
447451
>previous</a> |
448452
<a href="lexical-analysis.html" title="Lexical Analysis"
449453
>next</a> |

intermediate-representations.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ <h2>Sea of Nodes IR<a class="headerlink" href="#sea-of-nodes-ir" title="Permalin
264264
<h3>Table of Contents</h3>
265265
<p class="caption" role="heading"><span class="caption-text">Preliminaries</span></p>
266266
<ul>
267-
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Implementation Language</a></li>
268-
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">EeZee Programming Language</a></li>
267+
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Compiler Implementation Language</a></li>
268+
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">The EeZee Programming Language</a></li>
269269
</ul>
270270
<p class="caption" role="heading"><span class="caption-text">Parsing Techniques</span></p>
271271
<ul>

learning-resources.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ <h2>Others<a class="headerlink" href="#others" title="Permalink to this headline
115115
<h3>Table of Contents</h3>
116116
<p class="caption" role="heading"><span class="caption-text">Preliminaries</span></p>
117117
<ul>
118-
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Implementation Language</a></li>
119-
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">EeZee Programming Language</a></li>
118+
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Compiler Implementation Language</a></li>
119+
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">The EeZee Programming Language</a></li>
120120
</ul>
121121
<p class="caption" role="heading"><span class="caption-text">Parsing Techniques</span></p>
122122
<ul>

lexical-analysis.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<link rel="index" title="Index" href="genindex.html" />
1717
<link rel="search" title="Search" href="search.html" />
1818
<link rel="next" title="Syntax Analysis" href="syntax-analysis.html" />
19-
<link rel="prev" title="EeZee Programming Language" href="ez-lang.html" />
19+
<link rel="prev" title="The EeZee Programming Language" href="ez-lang.html" />
2020
</head><body>
2121
<div class="header-wrapper" role="banner">
2222
<div class="header">
2323
<div class="headertitle"><a
2424
href="index.html">Compiler Programming</a></div>
2525
<div class="rel" role="navigation" aria-label="related navigation">
26-
<a href="ez-lang.html" title="EeZee Programming Language"
26+
<a href="ez-lang.html" title="The EeZee Programming Language"
2727
accesskey="P">previous</a> |
2828
<a href="syntax-analysis.html" title="Syntax Analysis"
2929
accesskey="N">next</a> |
@@ -103,8 +103,8 @@ <h2>Example Hand-Coded Implementation<a class="headerlink" href="#example-hand-c
103103
<h3>Table of Contents</h3>
104104
<p class="caption" role="heading"><span class="caption-text">Preliminaries</span></p>
105105
<ul>
106-
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Implementation Language</a></li>
107-
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">EeZee Programming Language</a></li>
106+
<li class="toctree-l1"><a class="reference internal" href="prelim-impl-lang.html">Compiler Implementation Language</a></li>
107+
<li class="toctree-l1"><a class="reference internal" href="ez-lang.html">The EeZee Programming Language</a></li>
108108
</ul>
109109
<p class="caption" role="heading"><span class="caption-text">Parsing Techniques</span></p>
110110
<ul class="current">
@@ -144,7 +144,7 @@ <h3 style="margin-top: 1.5em;">Search</h3>
144144
<div class="footer">
145145
<div class="left">
146146
<div role="navigation" aria-label="related navigaton">
147-
<a href="ez-lang.html" title="EeZee Programming Language"
147+
<a href="ez-lang.html" title="The EeZee Programming Language"
148148
>previous</a> |
149149
<a href="syntax-analysis.html" title="Syntax Analysis"
150150
>next</a> |

0 commit comments

Comments
 (0)