changeset 304:fa99f36fabb5

Fix docs
author Windel Bouwman
date Fri, 06 Dec 2013 12:45:02 +0100
parents be7f60545368
children 0615b5308710
files doc/compiler.rst doc/ir.rst python/ppci/ir.py
diffstat 3 files changed, 23 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/doc/compiler.rst	Fri Dec 06 12:37:48 2013 +0100
+++ b/doc/compiler.rst	Fri Dec 06 12:45:02 2013 +0100
@@ -88,8 +88,8 @@
 selection.  The output of this phase is a one frame per function with a flat
 list of abstract machine instructions.
 
-.. autoclass:: irmach.Frame
+// .. autoclass:: ppci.irmach.Frame
 
-.. autoclass:: irmach.AbstractInstruction
+// .. autoclass:: ppci.irmach.AbstractInstruction
 
 
--- a/doc/ir.rst	Fri Dec 06 12:37:48 2013 +0100
+++ b/doc/ir.rst	Fri Dec 06 12:45:02 2013 +0100
@@ -7,15 +7,26 @@
 
 The IR-code is implemented in the ir package.
 
-.. autoclass:: ir.Module
+.. autoclass:: ppci.ir.Module
+
+.. autoclass:: ppci.ir.Function
+
+.. autoclass:: ppci.ir.Block
 
-.. autoclass:: ir.Function
+A block contains a sequence of statements.
 
-.. autoclass:: ir.Block
+.. autoclass:: ppci.ir.Statement
+
+.. autoclass:: ppci.ir.Jump
 
-.. autoclass:: ir.Statement
+.. autoclass:: ppci.ir.CJump
+
+Statements can contain again expressions.
+
+.. autoclass:: ppci.ir.Expression
 
-.. autoclass:: ir.Expression
+.. autoclass:: ppci.ir.Const
 
-.. # .. inheritance-diagram:: ir.Statement
+.. autoclass:: ppci.ir.Binop
 
+
--- a/python/ppci/ir.py	Fri Dec 06 12:37:48 2013 +0100
+++ b/python/ppci/ir.py	Fri Dec 06 12:45:02 2013 +0100
@@ -237,10 +237,12 @@
 
 
 class Expression:
+    """ Base class for an expression """
     pass
 
 
 class Const(Expression):
+    """ Represents a constant value """
     def __init__(self, value):
         self.value = value
 
@@ -262,6 +264,7 @@
 
 # Data operations
 class Binop(Expression):
+    """ Generic binary operation """
     ops = ['+', '-', '*', '/', '|', '&', '<<', '>>']
     def __init__(self, value1, operation, value2):
         assert operation in Binop.ops
@@ -384,6 +387,7 @@
 
 
 class Jump(LastStatement):
+    """ Jump statement to some target location """
     def __init__(self, target):
         self.Targets = [target]