Finch Notation Internals
Finch IR is a tree structure that represents a finch program. Different types of nodes are delineated by a FinchKind
enum, for type stability. There are a few useful functions to be aware of:
Finch.FinchNotation.FinchNode
— TypeFinchNode
A Finch IR node, used to represent an imperative, physical Finch program.
The FinchNode struct represents many different Finch IR nodes. The nodes are differentiated by a FinchNotation.FinchNodeKind
enum.
Finch.FinchNotation.cached
— Constantcached(val, ref)
Finch AST expression val
, equivalent to the quoted expression ref
Finch.FinchNotation.finch_leaf
— Functionfinch_leaf(x)
Return a terminal finch node wrapper around x
. A convenience function to determine whether x
should be understood by default as a literal, value, or virtual.
Finch.FinchNotation.isstateful
— Functionisstateful(node)
Returns true if the node is a finch statement, and false if the node is an index expression. Typically, statements specify control flow and expressions describe values.
Finch.FinchNotation.isliteral
— Functionisliteral(node)
Returns true if the node is a finch literal
Finch.FinchNotation.isvalue
— Functionisvalue(node)
Returns true if the node is a finch value
Finch.FinchNotation.isconstant
— Functionisconstant(node)
Returns true if the node can be expected to be constant within the current finch context
Finch.FinchNotation.isvirtual
— Functionisvirtual(node)
Returns true if the node is a finch virtual
Finch.FinchNotation.isvariable
— Functionisvariable(node)
Returns true if the node is a finch variable
Finch.FinchNotation.isindex
— Functionisindex(node)
Returns true if the node is a finch index