1Imager::Expr::Assem(3)User Contributed Perl DocumentationImager::Expr::Assem(3)
2
3
4
6 Imager::Expr::Assem - an assembler for producing code for the Imager
7 register machine
8
10 use Imager::Expr::Assem;
11 my $expr = Imager::Expr->new(assem=>'...', ...)
12
14 This module is a simple Imager::Expr compiler that compiles a low-level
15 language that has a nearly 1-to-1 relationship to the internal repre‐
16 sentation used for compiled regmach code.
17
18 Syntax
19
20 Each line can contain multiple statements separated by semi-colons.
21
22 Anything after '#' in a line is ignored.
23
24 Types of statements:
25
26 variable definition
27 "var" name:type
28
29 defines variable name to have type, which can be any of 'n' or
30 'num' for a numeric type or 'pixel', 'p' or 'c' for a pixel or
31 color type.
32
33 Variable names cannot include whitespace.
34
35 operators
36 Operators can be split into 3 basic types, those that have a result
37 value, those that don't and the null operator, eg. jump has no
38 value.
39
40 The format for operators that return a value is typically:
41
42 result = operator operand ...
43
44 and for those that don't return a value:
45
46 operator operand
47
48 where operator is any valid regmach operator, result is any vari‐
49 able defined with "var", and operands are variables, constants or
50 literals, or for jump operators, labels.
51
52 The set operator can be simplified to:
53
54 result = operator
55
56 All operators maybe preceded by a label, which is any non-white‐
57 space text immediately followed by a colon (':').
58
60 Note that the current optimizer may produce incorrect optimization for
61 your code, fortunately the optimizer will disable itself if you include
62 any jump operator in your code. A single jump to anywhere after your
63 final ret operator can be used to disable the optimizer without slowing
64 down your code.
65
66 There's currently no high-level code generation that can generate code
67 with loops or real conditions.
68
70 Imager(3), transform.perl, regmach.c
71
73 Tony Cook <tony@develop-help.com>
74
75
76
77perl v5.8.8 2008-03-28 Imager::Expr::Assem(3)