Public Member Functions | |
def | __init__ |
def | __getitem__ |
def | __add__ |
def | __sub__ |
def | __mul__ |
def | __div__ |
def | __xor__ |
def | __mod__ |
def | __lt__ |
def | __gt__ |
def | __eq__ |
def | __ne__ |
def | __lshift__ |
def | __rshift__ |
def | __and__ |
def | member |
def | ptr_member |
def | typing |
Data Fields | |
builder |
式オブジェクト Python式を書けばPython ASTの式が構築できるオブジェクト builder = Builder() a = builder.literal(3) b = builder.literal(4) c = a+b とすると、変数'c'は "3+4" を表現するPython ASTになる 大体の場合にうまくいくように見えるが、いくつか注意点がある 1. 左辺値にPython ASTを持ってくること メソッドが呼ばれるのは左辺値なので、 builder = Builder() a = builder.literal(3) b = 4 c = a+b これはうまくいくが、 builder = Builder() a = 3 b = builder.literal(4) c = a+b これはうまくいかない 2. 比較演算ができない Python AST式オブジェクトに'=='を適用した場合、 返すオブジェクトは、比較式を表現するオブジェクトであり、比較結果ではない builder = Builder() a = builder.literal(4) b = builder.literal(100) c = (a == b) if c: print 'xx' c が指すオブジェクトは '4 == 100' というPython ASTであり、True, Falseではない (なので、条件は常に真である)
Definition at line 488 of file Builder.py.
def ctrump::Builder::ExprBase::__init__ | ( | self, | ||
builder | ||||
) |
def ctrump::Builder::ExprBase::__getitem__ | ( | self, | ||
subscript | ||||
) |
Definition at line 544 of file Builder.py.
def ctrump::Builder::ExprBase::__add__ | ( | self, | ||
rhs | ||||
) |
Definition at line 546 of file Builder.py.
def ctrump::Builder::ExprBase::__sub__ | ( | self, | ||
rhs | ||||
) |
Definition at line 548 of file Builder.py.
def ctrump::Builder::ExprBase::__mul__ | ( | self, | ||
rhs | ||||
) |
Definition at line 550 of file Builder.py.
def ctrump::Builder::ExprBase::__div__ | ( | self, | ||
rhs | ||||
) |
Definition at line 552 of file Builder.py.
def ctrump::Builder::ExprBase::__xor__ | ( | self, | ||
rhs | ||||
) |
Definition at line 554 of file Builder.py.
def ctrump::Builder::ExprBase::__mod__ | ( | self, | ||
rhs | ||||
) |
Definition at line 556 of file Builder.py.
def ctrump::Builder::ExprBase::__lt__ | ( | self, | ||
rhs | ||||
) |
Definition at line 558 of file Builder.py.
def ctrump::Builder::ExprBase::__gt__ | ( | self, | ||
rhs | ||||
) |
Definition at line 560 of file Builder.py.
def ctrump::Builder::ExprBase::__eq__ | ( | self, | ||
rhs | ||||
) |
Definition at line 562 of file Builder.py.
def ctrump::Builder::ExprBase::__ne__ | ( | self, | ||
rhs | ||||
) |
Definition at line 564 of file Builder.py.
def ctrump::Builder::ExprBase::__lshift__ | ( | self, | ||
rhs | ||||
) |
Definition at line 566 of file Builder.py.
def ctrump::Builder::ExprBase::__rshift__ | ( | self, | ||
rhs | ||||
) |
Definition at line 568 of file Builder.py.
def ctrump::Builder::ExprBase::__and__ | ( | self, | ||
rhs | ||||
) |
Definition at line 570 of file Builder.py.
def ctrump::Builder::ExprBase::member | ( | self, | ||
name, | ||||
code = ctrump.EXPR_MEMBER_REF | ||||
) |
def ctrump::Builder::ExprBase::ptr_member | ( | self, | ||
name | ||||
) |
Definition at line 583 of file Builder.py.
def ctrump::Builder::ExprBase::typing | ( | self, | ||
builder | ||||
) |
Definition at line 586 of file Builder.py.
Reimplemented in ctrump::Builder::CastTo, ctrump::Builder::Func, and ctrump::Builder::SizeofType.
Definition at line 542 of file Builder.py.