[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-611-gf45b3b1

Mildred Ki'Lya silkensedai at online.fr
Sun Mar 7 12:06:42 UTC 2010


The following commit has been merged in the master branch:
commit f45b3b18be418c94d7f4a266b8d0dd27da30e822
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Sun Mar 7 13:04:54 2010 +0100

    Documentation

diff --git a/.gitignore b/.gitignore
index 1faac49..5887732 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@
 /l.c
 /doc/
 /bootstrap/
+/Markdown.pl
diff --git a/Makefile b/Makefile
index b49209c..38f2d99 100644
--- a/Makefile
+++ b/Makefile
@@ -128,7 +128,7 @@ bin/shorter: bin/lisaac make.lip bin/path.h
 # Documentation
 #
 
-doc: doc/html
+doc: doc/html src/HACKING.html
 doc/html: bin/shorter make.lip lib
 	mkdir -p doc/html
 	cd doc && ../bin/shorter -d -f belinda ../lib -o html 
@@ -191,3 +191,27 @@ clean:
 
 clean-spaces:
 	-find . \( -name "*.li" -o -name "*.lip" \) -print0 | xargs -0 sed -i 's/\s*$$//'
+
+src/HACKING.html: src/HACKING Markdown.pl
+	$(MARKDOWN_CMDLINE)
+
+### Markdown ###
+
+MARKDOWN_URL=http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip
+MARKDOWN_DIR=Markdown_1.0.1
+MARKDOWN_CMDLINE=./Markdown.pl <$< >$@
+
+Markdown.zip:
+	wget $(MARKDOWN_URL) -O $@
+
+Markdown.pl:
+	$(MAKE) Markdown.zip
+	unzip -u -j Markdown.zip $(MARKDOWN_DIR)/$@
+	chmod +x $@
+	-$(RM) Markdown.zip
+
+%.html: %.mdwn Markdown.pl
+	$(MARKDOWN_CMDLINE)
+
+%.html: % Markdown.pl
+	$(MARKDOWN_CMDLINE)
diff --git a/src/.gitignore b/src/.gitignore
index aa32382..6cc14b8 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,3 +1,4 @@
 lisaac.c
 lisaac
 lisaac.exe
+*.html
diff --git a/src/HACKING b/src/HACKING
new file mode 100644
index 0000000..d2d2209
--- /dev/null
+++ b/src/HACKING
@@ -0,0 +1,99 @@
+A Guide to Hacking in the Compiler Source
+=========================================
+
+Type Hierarchy
+--------------
+
+### `INSTR`
+
+`external`:
+
+- `FORALL_DATA`
+- `CALL_NULL`
+
+`code_life`:
+
+- `LOOP_END`
+- `COP_LOCK`
+- `LIST`
+- `CALL_SLOT`
+- `PUSH`
+- `COP_UNLOCK`
+- `NOP`
+- `LOOP`
+- `SWITCH`
+- `NODE`
+- `EXPR`
+- `WRITE`
+    - `WRITE_SLOT`
+    - `WRITE_LOCAL`
+    - `WRITE_GLOBAL`
+    - `PUT_TO` (external)
+
+### `EXPR`
+
+`external`:
+
+- `EXTERNAL_C`
+- `SIZE_OF`
+- `ITEM`
+- `GET_TYPE_ID`
+- `IS_EXPANDED`
+- `PUT_TO`
+
+`external/comparison`:
+
+- `EXPR_BINARY_CMP`
+    - `EXPR_SUP_EQ`
+    - `EXPR_SUP`
+    - `EXPR_INF`
+    - `EXPR_EQUAL`
+    - `EXPR_INF_EQ`
+    - `EXPR_NOT_EQUAL`
+
+`external/logic`:
+
+- `EXPR_BINARY_LOGIC`
+    - `EXPR_AND_LOGIC`
+        - `EXPR_AND_AND_LOGIC`
+    - `EXPR_OR_LOGIC`
+        - `EXPR_OR_OR_LOGIC`
+- `EXPR_UNARY_LOGIC`
+    - `EXPR_NOT_LOGIC`
+
+`external/arithmetic`:
+
+- `EXPR_UNARY`
+    - `EXPR_NEG`
+    - `EXPR_NOT`
+- `EXPR_BINARY`
+    - `EXPR_AND`
+    - `EXPR_DIV`
+    - `EXPR_MOD`
+    - `EXPR_MUL`
+    - `EXPR_SUB`
+    - `EXPR_SHIFT_L`
+    - `EXPR_SHIFT_R`
+    - `EXPR_ADD`
+    - `EXPR_OR`
+    - `EXPR_XOR`
+
+`code_life`:
+
+- `CAST`
+- `EXPR_MULTIPLE`
+- `RESULT`
+- `READ`
+    - `READ_SLOT`
+    - `READ_LOCAL`
+    - `READ_GLOBAL`
+
+`constant`:
+
+- `CONSTANT`
+    - `CHARACTER_CST`
+    - `INTEGER_CST`
+    - `NATIVE_ARRAY_CHARACTER_CST`
+    - `PROTOTYPE_CST`
+    - `REAL_CST`
+    - `STRING_CST`
diff --git a/src/code_life/instr.li b/src/code_life/instr.li
index 9b58bdc..b081bf9 100644
--- a/src/code_life/instr.li
+++ b/src/code_life/instr.li
@@ -35,14 +35,21 @@ Section Inherit
 Section Public
 
   - is_invariant:BOOLEAN <- FALSE;
+  // TODO: Documentation
+  // For expressions, it seems they are invariant if they are constant, like 
+  // sizeof or binary operators on two invariant expressions.
+  // For instructions, it is redefined in LIST, SWITCH and WRITE
 
   //
   //
   //
 
   - hash_code:INTEGER <- INTEGER.force_conversion position;
+  // Hash code of instruction for storage
 
   - my_copy:SELF <-
+  // TODO: Documentation
+  // Deferred
   (
     debug_display;
     deferred;
@@ -54,10 +61,14 @@ Section Public
   //
 
   - cmp other:INSTR :BOOLEAN := FALSE;
+  // TODO: Documentation
 
   - i_am_the_last i:INSTR :BOOLEAN <- (i = Self);
+  // TODO: Documentation
 
   - execute:INSTR <-
+  // TODO: Documentation
+  // Deferred
   (
     debug_display;
     deferred;
@@ -65,12 +76,16 @@ Section Public
   );
 
   - remove <-
+  // TODO: Documentation
+  // Deferred
   (
     debug_display;
     deferred;
   );
 
   - genere buffer:STRING <-
+  // Generate the C code in `buffer'
+  // Deferred
   (
     // BUG.
     display buffer;
@@ -84,6 +99,7 @@ Section Public
   //
 
   - display_ref buffer:STRING <-
+  // Display reference for debug purposes
   (
     is_verbose.if {
       buffer.append "<";
@@ -93,12 +109,15 @@ Section Public
   );
 
   - display buffer:STRING <-
+  // Display instruction for debug purposes
+  // Deferred
   (
     "INSTR.display\n".print;
     deferred;
   );
 
   - debug_display <-
+  // Print the result of the `display' slot
   ( + voir:STRING;
 
     voir := STRING.create 250;
@@ -108,6 +127,7 @@ Section Public
   );
 
   - simplify_type v:VARIABLE <-
+  // TODO: Documentation
   ( + tmp_type:TYPES_TMP;
 
     ((! v.is_static) && {! v.type.is_strict}).if {

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list