ref: 575cd5a2034d9bfe97fc2275df76631383fa0898
parent: 9367a1cb099e0968ccec1e77907a07984cbdc424
author: Ori Bernstein <[email protected]>
date: Wed Aug 8 20:09:51 EDT 2012
More docs.
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -463,6 +463,9 @@
operator. 'e' will stand in for any expression. Unless marked
otherwise, expressions are left associative.
+ BUG: There are too many precedence levels.
+
+
Precedence 0: (*ok, not really operators)
(,,,) Tuple Construction
(e) Grouping
@@ -548,7 +551,26 @@
4. TYPE SYSTEM:
+ The myrddin type system is a system similar to the Hindley Milner
+ system, however, types are not implicitly generalized. Instead, type
+ schemes (type parameters, in Myrddin lingo) must be explicitly provided
+ in the declarations. For purposes of brevity, instead of specifying type
+ rules for every operator, we group operators which behave identically
+ from the type system perspective into a small set of classes
+
+ Binop:
+ + -
+
5. TOOLCHAIN:
+
+ The toolchain used is inspired by the Plan 9 toolchain in name. There
+ is currently one compiler for x64, called '6m'. This compiler outputs
+ standard elf .o files, and supports these options:
+
+ 6m [-h] [-o outfile] [-d[dbgopts]] inputs
+ -I path Add 'path' to use search path
+ -o Output to outfile
+
5. EXAMPLES:
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -422,14 +422,14 @@
| castexpr
;
+
+cmpop : Teq | Tgt | Tlt | Tge | Tle | Tne ;
+
castexpr: unionexpr Tcast Toparen type Tcparen
{$$ = mkexpr($1->line, Ocast, $1, NULL);
$$->expr.type = $4;}
| unionexpr
;
-
-
-cmpop : Teq | Tgt | Tlt | Tge | Tle | Tne ;
unionexpr
: Ttick name borexpr