Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.2 - Français

Change language to:
English - 日本語 - Português

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.

Aide Scilab >> Scilab > macr2lst

macr2lst

function to list conversion

Calling Sequence

[txt]=macr2lst(function-name)

Description

This primitive converts a compiled Scilab function function-name into a list which codes the internal representation of the function (reverse polish notation).

The first entry of the list is the function name, the second and third are respectively the vectors of left hand side variables and right hand side variables names. The following entries are either basic operation records either lists with contains the hierachical control structures like if , for, ...

Basic operation records are described by a character string vector whose first element represents the opcode.

op codes meaning parameters
"0" ignored opcode none
"1" No more used
"2" variable or function reference variable name, #rhs, #lhs
"3" put a string in the stack the string
"4" put am empty matrix in the stack none
"5" apply an operation operation code, #rhs,#lhs
"6" put a number in the stack the number
"12" pause command none
"13" break command none
"14" abort command none
"15" end of line mark none
"17" quit command none
"18" named variable variable name
"19" create recursive index structure path length, number of final indices
"20" function call function name, #rhs, #lhs
"23" create variable from name variable name
"24" put a variable with type 0 in the stack none
"25" profile record number of call, time spend
"26" put a vector of strings in the stack #rows, #columns, element sequence
"27" put a builtin reference in the stack interface number, position in interface, function name
"28" continue command none
"29" assignment #lhs, display mode, (variable name, #rhs)*
"30" logical expression short circuit type, jump size
"31" comment the comment
"99" return command none
> "100" builtin call (obsolete) 100*fun, #rhs, #lhs, fin

The fun2string function can be used to generate the intial code.

Examples

//DISPLAY
function y=foo(x, flag)
  if flag then 
    y=sin(x)
  else
    y=cos(x)
  end
endfunction
L=macr2lst(foo)
fun2string(L)

See Also

  • macrovar — variables of function
  • fun2string — generates ascii definition of a scilab function
  • macr2tree — conversion d'une fonction en arbre
  • tree2code — generates ascii definition of a Scilab function
<< lasterror Scilab newfun >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 12 11:44:46 CEST 2011