! Copyright (C) 2004, 2005 Slava Pestov. ! See http://factor.sf.net/license.txt for BSD license. IN: compiler USING: inference kernel lists math namespaces words strings errors prettyprint kernel-internals ; : >linear ( node -- ) #! Dataflow OPs have a linearizer word property. This #! quotation is executed to convert the node into linear #! form. "linearizer" [ "No linearizer" throw ] apply-dataflow ; : (linearize) ( dataflow -- ) [ >linear ] each ; : linearize ( dataflow -- linear ) #! Transform dataflow IR into linear IR. This strips out #! stack flow information, flattens conditionals into #! jumps and labels, and turns dataflow IR nodes into #! lists where the first element is an operation, and the #! rest is arguments. [ %prologue , (linearize) ] make-list ; :