# HG changeset patch # User Windel Bouwman # Date 1386330302 -3600 # Node ID fa99f36fabb52a1ba4643b25f28e2ef182a45142 # Parent be7f6054536891898ada4ddb9346bb978a76f07b Fix docs diff -r be7f60545368 -r fa99f36fabb5 doc/compiler.rst --- 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 diff -r be7f60545368 -r fa99f36fabb5 doc/ir.rst --- 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 + diff -r be7f60545368 -r fa99f36fabb5 python/ppci/ir.py --- 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]