Reference: Abstract Syntax Trees

New in version 2014.1.

AST Expression

class islpy.AstExpr(_data)
access(self, indices)
Parameters:
Returns:

AstExpr

add(self, expr2)
Parameters:
Returns:

AstExpr

address_of(self)
Parameters:selfAstExpr
Returns:AstExpr
and_(self, expr2)
Parameters:
Returns:

AstExpr

and_then(self, expr2)
Parameters:
Returns:

AstExpr

call(self, arguments)
Parameters:
Returns:

AstExpr

copy(self)
Parameters:selfAstExpr
Returns:AstExpr
div(self, expr2)
Parameters:
Returns:

AstExpr

dump(self)
Parameters:selfAstExpr
Returns:(nothing)
eq(self, expr2)
Parameters:
Returns:

AstExpr

static from_id(id)
Parameters:idId
Returns:AstExpr
static from_val(v)
Parameters:vVal
Returns:AstExpr
ge(self, expr2)
Parameters:
Returns:

AstExpr

get_ctx(self)
Parameters:selfAstExpr
Returns:Context
get_id(self)
Parameters:selfAstExpr
Returns:Id
get_op_arg(self, pos)
Parameters:
Returns:

AstExpr

get_op_n_arg(self)
Parameters:selfAstExpr
Returns:int
get_op_type(self)
Parameters:selfAstExpr
Returns:isl_ast_op_type
get_type(self)
Parameters:selfAstExpr
Returns:isl_ast_expr_type
get_val(self)
Parameters:selfAstExpr
Returns:Val
gt(self, expr2)
Parameters:
Returns:

AstExpr

is_equal(self, expr2)
Parameters:
Returns:

bool

le(self, expr2)
Parameters:
Returns:

AstExpr

lt(self, expr2)
Parameters:
Returns:

AstExpr

mul(self, expr2)
Parameters:
Returns:

AstExpr

neg(self)
Parameters:selfAstExpr
Returns:AstExpr
or_(self, expr2)
Parameters:
Returns:

AstExpr

or_else(self, expr2)
Parameters:
Returns:

AstExpr

pdiv_q(self, expr2)
Parameters:
Returns:

AstExpr

pdiv_r(self, expr2)
Parameters:
Returns:

AstExpr

print_macros(self, p)
Parameters:
Returns:

Printer

set_op_arg(self, pos, arg)
Parameters:
Returns:

AstExpr

sub(self, expr2)
Parameters:
Returns:

AstExpr

substitute_ids(self, id2expr)
Parameters:
Returns:

AstExpr

to_C_str(self)
Parameters:selfAstExpr
Returns:string
to_str(self)
Parameters:selfAstExpr
Returns:string

AST Node

class islpy.AstNode(_data)
static alloc_user(expr)
Parameters:exprAstExpr
Returns:AstNode
block_get_children(self)
Parameters:selfAstNode
Returns:AstNodeList
copy(self)
Parameters:selfAstNode
Returns:AstNode
dump(self)
Parameters:selfAstNode
Returns:(nothing)
for_get_body(self)
Parameters:selfAstNode
Returns:AstNode
for_get_cond(self)
Parameters:selfAstNode
Returns:AstExpr
for_get_inc(self)
Parameters:selfAstNode
Returns:AstExpr
for_get_init(self)
Parameters:selfAstNode
Returns:AstExpr
for_get_iterator(self)
Parameters:selfAstNode
Returns:AstExpr
for_is_degenerate(self)
Parameters:selfAstNode
Returns:bool
for_print(self, p, options)
Parameters:
Returns:

Printer

foreach_descendant_top_down(self, fn)
Parameters:
  • selfAstNode
  • fn – callback(node) -> isl_bool
Returns:

(nothing)

get_annotation(self)
Parameters:selfAstNode
Returns:Id
get_ctx(self)
Parameters:selfAstNode
Returns:Context
get_type(self)
Parameters:selfAstNode
Returns:isl_ast_node_type
if_get_cond(self)
Parameters:selfAstNode
Returns:AstExpr
if_get_else(self)
Parameters:selfAstNode
Returns:AstNode
if_get_then(self)
Parameters:selfAstNode
Returns:AstNode
if_has_else(self)
Parameters:selfAstNode
Returns:bool
if_print(self, p, options)
Parameters:
Returns:

Printer

mark_get_id(self)
Parameters:selfAstNode
Returns:Id
mark_get_node(self)
Parameters:selfAstNode
Returns:AstNode
print_(self, p, options)
Parameters:
Returns:

Printer

print_macros(self, p)
Parameters:
Returns:

Printer

set_annotation(self, annotation)
Parameters:
Returns:

AstNode

to_C_str(self)
Parameters:selfAstNode
Returns:string
to_str(self)
Parameters:selfAstNode
Returns:string
user_get_expr(self)
Parameters:selfAstNode
Returns:AstExpr

AST Build

class islpy.AstBuild(_data)
access_from_multi_pw_aff(self, mpa)
Parameters:
Returns:

AstExpr

access_from_pw_multi_aff(self, pma)
Parameters:
Returns:

AstExpr

static alloc(ctx)
Parameters:ctxContext
Returns:AstBuild
ast_from_schedule(self, schedule)
Parameters:
Returns:

AstNode

call_from_multi_pw_aff(self, mpa)
Parameters:
Returns:

AstExpr

call_from_pw_multi_aff(self, pma)
Parameters:
Returns:

AstExpr

copy(self)
Parameters:selfAstBuild
Returns:AstBuild
expr_from_pw_aff(self, pa)
Parameters:
Returns:

AstExpr

expr_from_set(self, set)
Parameters:
Returns:

AstExpr

static from_context(set)
Parameters:setSet
Returns:AstBuild
get_ctx(self)
Parameters:selfAstBuild
Returns:Context
get_schedule(self)
Parameters:selfAstBuild
Returns:UnionMap
get_schedule_space(self)
Parameters:selfAstBuild
Returns:Space
node_from_schedule(self, schedule)
Parameters:
Returns:

AstNode

node_from_schedule_map(self, schedule)
Parameters:
Returns:

AstNode

restrict(self, set)
Parameters:
Returns:

AstBuild

set_after_each_for(self, fn)
Parameters:
  • selfAstBuild
  • fn – callback(node, build) -> isl_ast_node
Returns:

(AstBuild, ffi_callback_handle)

set_after_each_mark(self, fn)
Parameters:
  • selfAstBuild
  • fn – callback(node, build) -> isl_ast_node
Returns:

(AstBuild, ffi_callback_handle)

set_at_each_domain(self, fn)
Parameters:
  • selfAstBuild
  • fn – callback(node, build) -> isl_ast_node
Returns:

(AstBuild, ffi_callback_handle)

set_before_each_for(self, fn)
Parameters:
  • selfAstBuild
  • fn – callback(build) -> isl_id
Returns:

(AstBuild, ffi_callback_handle)

set_before_each_mark(self, fn)
Parameters:
  • selfAstBuild
  • fn – callback(mark, build) -> isl_stat
Returns:

(AstBuild, ffi_callback_handle)

set_create_leaf(self, fn)
Parameters:
  • selfAstBuild
  • fn – callback(build) -> isl_ast_node
Returns:

(AstBuild, ffi_callback_handle)

set_iterators(self, iterators)
Parameters:
Returns:

AstBuild

set_options(self, options)
Parameters:
Returns:

AstBuild

AST Print Options

class islpy.AstPrintOptions(_data)
  • __eq__()
  • __ne__()
  • alloc() (static)
static alloc(ctx)
Parameters:ctxContext
Returns:AstPrintOptions
copy(self)
Parameters:selfAstPrintOptions
Returns:AstPrintOptions
get_ctx(self)
Parameters:selfAstPrintOptions
Returns:Context
set_print_for(self, print_for)
Parameters:
  • selfAstPrintOptions
  • print_for – callback(p, options, node) -> isl_printer
Returns:

(AstPrintOptions, ffi_callback_handle)

set_print_user(self, print_user)
Parameters:
  • selfAstPrintOptions
  • print_user – callback(p, options, node) -> isl_printer
Returns:

(AstPrintOptions, ffi_callback_handle)