<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="Equal">
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+-->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+ xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+ xml:lang="en" xml:id="Equal">
<refnamediv>
<refname>Equal</refname>
- <refpurpose>Create a tree representing an instruction</refpurpose>
+ <refpurpose>
+ Generates the Scilab internal code representing an instruction "LHS = RHS"
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
- <synopsis>eq=Equal(lhslist,expression)</synopsis>
+ <synopsis>eq = Equal(lhslist, RHS)</synopsis>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
<varlistentry>
<term>lhslist</term>
<listitem>
- <para>list of lhs parameters (list of "M2SCI tlists")</para>
+ <para>list of Left Hand Side parameters (list of "M2SCI tlists")</para>
</listitem>
</varlistentry>
<varlistentry>
- <term>expression</term>
+ <term>RHS</term>
<listitem>
- <para>right member of equal (an "M2SCI tlist")</para>
+ <para>
+ a tlist built with "M2SCI" functions, representing the
+ Right Hand Side member of the instruction.
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term>eq</term>
<listitem>
- <para>an "equal" tlist</para>
+ <para>tlist of type "equal"</para>
</listitem>
</varlistentry>
</variablelist>
All input parameters values are verified to be compatible with "M2SCI tlists".
</para>
</refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ Let's define the pseudo-code representing the simple statement
+ <literal>A = "off"</literal>:
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+LHS = Variable("A", Infer(list(1,1),Type(String,Unknown)));
+Equal(list(LHS), Cste("off"))
+ ]]></programlisting>
+ <para>
+ Let's define the pseudo-code representing the statement
+ <literal>A(2,:) = "off"</literal> :
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+// A
+LHS = Variable("A", Infer(list(Unknown,Unknown),Type(String,Unknown)));
+// A(2,:)
+LHS = Operation("ins", list(LHS,Cste(2),Colon), list()) // Insertion
+// A(2,:) = "off"
+Equal(list(LHS), Cste("off"))
+ ]]></programlisting>
+ <para>
+ Let's define the pseudo-code representing the expression
+ <literal>handles(:).axes_reverse(:,2) = "off"</literal>, where
+ <literal>handles</literal> is a 1x3 row of graphical (axes) handles:
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+h = Variable("handles", Infer(list(1,3),Type(Handle,Unknown)));
+
+// Building the Left-Hand-Side part of the assignment (Equal):
+// handles(:)
+LHS = Operation("ins", list(h,Colon), list()); // Insertion
+
+// handles(:).axes_reverse :
+LHS = Operation("ins", list(LHS,Cste("axes_reverse")), list()) // Insertion
+
+// handles(:).axes_reverse(:,2) :
+LHS = Operation("ins", list(LHS,Colon,Cste(2)), list()); // Insertion
+
+// .. and finally the full statement:
+s.statement = Equal(list(LHS), Cste("off"))
+ ]]></programlisting>
+ <screen><![CDATA[
+---> s.statement = Equal(list(LHS), Cste("off"))
+ s =
+ statement: [equal] tlist with fields:
+ lhs: list:
+ (1) : [operation] tlist with fields:
+ operator = "ins"
+ operands: list:
+ (1) : [operation] tlist with fields:
+ operator = "ins"
+ operands: list:
+ (1) : [operation] tlist with fields:
+ operator = "ins"
+ operands: list with 2 elements.
+ out: empty list()
+ (2) : [cste] tlist with fields:
+ value = "axes_reverse"
+ infer: [infer] tlist with fields:
+ [dims, type, contents]
+ out: empty list()
+ (2) : [variable] tlist with fields:
+ name = ":"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = -1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ (3) : [cste] tlist with fields:
+ value = 2
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ out: empty list()
+ expression: [cste] tlist with fields:
+ value = "off"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 3
+ type: [type] tlist with fields:
+ vtype = 10
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ endsymbol = ";"
+]]></screen>
+ </refsection>
<refsection role="see also">
<title>See also</title>
<simplelist type="inline">
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="Operation">
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+-->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+ xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+ xml:lang="en" xml:id="Operation">
<refnamediv>
<refname>Operation</refname>
- <refpurpose>Create a tree representing an operation</refpurpose>
+ <refpurpose>
+ Generates the Scilab pseudo-code representing an operation
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
- <synopsis>op=Operation(operator,operands,out)</synopsis>
+ <synopsis>op = Operation(operator, operands, out)</synopsis>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
<varlistentry>
<term>operator</term>
<listitem>
- <para>operator symbol (character string)</para>
+ operator symbol (character string). Supported codes are:
+ <literal>"''", ".''", "~", ":",
+ "+", "-", "*", ".*", ".*.", ".^", "/", "./", "\",
+ "==", "<>", "<", "<=", ">", ">=", "|", "||", "&", "&&",
+ "cc"</literal> (Columns horizontal Concatenation [,]), <literal>"rc"</literal>
+ (Rows vertical concatenation [;]),
+ <literal>"ccc"</literal> (Cells horizontal concatenation {,}),
+ <literal>"crc"</literal> (Cells vertical concatenation {;}),
+ <literal>"ins"</literal> (insertion), <literal>"ext"</literal> (extraction).
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>operands</term>
<listitem>
- <para>list of operands (list of "M2SCI tlists")</para>
+ List of Tlists representing operands, of type "cste" (ex: 1.23),
+ "variable" (ex: A), "funcall" (ex: gcf()), or "operation"
+ (ex: (1+3)).
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>out</term>
<listitem>
- <para>list of outputs (list of "M2SCI tlists")</para>
+ List of TLists representing the operation result(s) (most often
+ unique). Each result is represented as a M2SCI tlist.
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>op</term>
<listitem>
- <para>an "operation" tlist</para>
+ Tlist of type "operation"
+ <para/>
</listitem>
</varlistentry>
</variablelist>
<refsection>
<title>Description</title>
<para>
- This function create a <literal>tlist</literal> representing an operation when using M2SCI.
- All input parameters values are verified to be compatible with "M2SCI tlists".
+ This function creates a <literal>tlist</literal> representing an operation when using
+ M2SCI. All input parameters values are verified to be compatible with "M2SCI tlists".
</para>
</refsection>
<refsection role="see also">
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="Variable">
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+-->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+ xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+ xml:lang="en" xml:id="Variable">
<refnamediv>
<refname>Variable</refname>
- <refpurpose>Create a tree representing a variable</refpurpose>
+ <refpurpose>
+ Generates the Scilab internal code representing a variable (without its content)
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
- <synopsis>var=Variable(name,infer)</synopsis>
+ <synopsis>var = Variable(name, infer)</synopsis>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
This function create a <literal>tlist</literal> representing a variable when using M2SCI.
All input parameters values are verified to be compatible with "M2SCI tlists".
</para>
+ <note>
+ <emphasis role="bold">Colon</emphasis> is a predefined Variable containing the
+ pseudo-code representing a colon. It can be used as is as a "ALL" index, for instance
+ in insertion or extraction operations.
+ </note>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ Let's defined the pseudo-code representing a variable <literal>a</literal> aimed
+ to be a 3x5 matrix of strings:
+ </para>
+ <para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+ s.a_code = Variable("a", Infer(list(1,1),Type(String,Unknown)))
+ ]]></programlisting>
+ <screen><![CDATA[
+--> s.a_code = Variable("a", Infer(list(3,5),Type(String,Unknown)))
+ s =
+ a_code: [variable] tlist with fields:
+ name = "a"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 3
+ (2) = 5
+ type: [type] tlist with fields:
+ vtype = 10
+ property = -1
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+]]></screen>
+ </para>
</refsection>
<refsection role="see also">
<title>See also</title>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Predefined variable <literal>Colon</literal> added.
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
<refsection>
<title>Description</title>
<para>
- The main difficulty for M2SCI (<literal>mfile2sci</literal>) is to find what variables are: dimensions, type...
+ The main difficulty for M2SCI (<literal>mfile2sci</literal>) is to find what variables
+ are: dimensions, type...
</para>
<para>
- To help this tool, just add comments beginning with <literal>%m2scideclare</literal> in the M-file to convert,
- (<literal>%m2sciassume</literal> was used in previous Scilab versions and is now obsolete).
+ To help this tool, just add comments beginning with <literal>%m2scideclare</literal> in
+ the M-file to convert, (<literal>%m2sciassume</literal> was used in previous Scilab
+ versions and is now obsolete).
</para>
<para>
The syntax of this command is:
<itemizedlist>
<listitem>
<para>
- variable_name: name of the variable declared. It can be a Struct field (e.g. <literal>x(1,2).name</literal>)
+ <emphasis role="bold">variable_name</emphasis>: name of the variable declared.
+ It can be a Struct field (e.g. <literal>x(1,2).name</literal>)
or describe the contents of a Cell using syntax
- <literal>x(1,2).entries</literal>. NOTE that for Cells and Structs,
- <literal>*</literal> can be used as an index (see examples below).
+ <literal>x(1,2).entries</literal>.
+ <note>
+ NOTE that for Cells and Structs,
+ <literal>*</literal> can be used as an index (see examples below).
+ </note>
</para>
</listitem>
<listitem>
<para>
- dimensions: dimensions of the variable declared separated by blanks, if a dimension is unknown,
- replace it by <literal>?</literal>. NOTE that String dimensions must be similar to Matlab ones
- e.g. <literal>1 6</literal> for character string 'string'.
+ <emphasis role="bold">dimensions</emphasis>: dimensions of the variable declared
+ separated by blanks, if a dimension is unknown, replace it by <literal>?</literal>.
+ <warning>
+ NOTE that String dimensions must be similar to Matlab ones
+ e.g. <literal>1 6</literal> for character string 'string'.
+ </warning>
</para>
</listitem>
- <listitem>
- <para>
- data_type: data type of the variable which can be:
- </para>
- <informaltable border="1">
- <tr>
- <td>m2scideclare data type</td>
- <td>Scilab "equivalent" type</td>
- </tr>
- <tr>
- <td>Double</td>
- <td>1</td>
- </tr>
- <tr>
- <td>Boolean</td>
- <td>4</td>
- </tr>
- <tr>
- <td>Sparse</td>
- <td>5</td>
- </tr>
- <tr>
- <td>Int</td>
- <td>8</td>
- </tr>
- <tr>
- <td>Handle</td>
- <td>9</td>
- </tr>
- <tr>
- <td>String</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Struct</td>
- <td>Matlab struct (16)</td>
- </tr>
- <tr>
- <td>Cell</td>
- <td>Matlab cell (17)</td>
- </tr>
- <tr>
- <td>Void</td>
- <td>No type (0)</td>
- </tr>
- <tr>
- <td>?</td>
- <td>Unknown type</td>
- </tr>
- </informaltable>
- </listitem>
- <listitem>
- <para>
- property: property of the variable which can be:
- </para>
- <informaltable border="1">
- <tr>
- <td>m2scideclare property</td>
- <td>Scilab "equivalent"</td>
- </tr>
- <tr>
- <td>Real</td>
- <td>Real data</td>
- </tr>
- <tr>
- <td>Complex</td>
- <td>Complex data</td>
- </tr>
+ <listitem>.
+ <informaltable border="0">
<tr>
- <td>?</td>
- <td>Unknown property</td>
+ <td valign="top">
+ <para>
+ <emphasis role="bold">data_type</emphasis>:
+ data type of the variable which can be:
+ </para>
+ <informaltable border="1">
+ <tr>
+ <th>m2scideclare data type</th>
+ <th>Scilab "equivalent" type</th>
+ </tr>
+ <tr><td>Double</td> <td>1</td> </tr>
+ <tr><td>Boolean</td> <td>4</td> </tr>
+ <tr><td>Sparse</td> <td>5</td> </tr>
+ <tr><td>Int</td> <td>8</td> </tr>
+ <tr><td>Handle</td> <td>9</td> </tr>
+ <tr><td>String</td> <td>10</td> </tr>
+ <tr><td>Struct</td> <td>16</td> </tr>
+ <tr><td>Cell</td> <td>17</td> </tr>
+ <tr><td>Function</td><td>13 (macro)</td></tr>
+ <tr><td>Builtin</td> <td>130</td> </tr>
+ <tr><td>Void</td> <td>0 (undefined)</td></tr>
+ <tr><td>?</td> <td>Unknown type</td></tr>
+ </informaltable>
+ </td>
+ <td valign="top">
+ <para>
+ <emphasis role="bold">property</emphasis>:
+ property of the variable, which can be:
+ </para>
+ <informaltable border="1">
+ <tr><th>m2scideclare property</th> <th>Scilab "equivalent"</th></tr>
+ <tr><td>Real</td> <td>Real data</td> </tr>
+ <tr><td>Complex</td> <td>Complex data</td> </tr>
+ <tr><td>?</td> <td>Unknown property</td> </tr>
+ </informaltable>
+ <para>
+ This field is ignored for following datatypes: <literal>Cell</literal>,
+ <literal>Struct</literal>, <literal>String</literal> and <literal>Boolean</literal>.
+ </para>
+ </td>
</tr>
- </informaltable>
- <para>
- This field is ignored for following datatypes: <literal>Cell</literal>,
- <literal>Struct</literal>, <literal>String</literal> and <literal>Boolean</literal>.
- </para>
+ </informaltable>
</listitem>
</itemizedlist>
<para>
in case of conflict, infered data are kept and a warning message is displayed.
If you are sure about your data, report a bug.
</para>
- <para>Some examples are given below:</para>
+ </refsection>
+ <refsection>
+ <title>Examples</title>
<itemizedlist>
<listitem>
<literal>%m2scideclare var1|2 3|Double|Real</literal>
</listitem>
</itemizedlist>
</refsection>
+ <refsection role="see also">
+ <title>See also</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="Type">Type</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
+ <para>
+ To use the default value of some input arguments, just skip their value as in
+ <literal>mfile2sci(M_file_path, result_path, , , 0)</literal>.
+ </para>
<variablelist>
<varlistentry>
<term>M_file_path</term>
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="Equal">
<refnamediv>
<refname>Equal</refname>
- <refpurpose>Créé un arbre représentant une instruction</refpurpose>
+ <refpurpose>
+ Génère le code interne Scilab représentant une instruction "LHS = RHS"
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Séquence d'appel</title>
- <synopsis>eq=Equal(lhslist,expression)</synopsis>
+ <synopsis>eq = Equal(lhslist, RHS)</synopsis>
</refsynopsisdiv>
<refsection>
- <title>Paramètres</title>
+ <title>Arguments</title>
<variablelist>
<varlistentry>
<term>lhslist</term>
<listitem>
- <para>liste des paramètres de sortie (liste de "tlists M2SCI")</para>
+ <para>
+ liste des arguments de sortie (Left Hand Side : coté gauche de l'assignation)
+ (liste d'une liste typée de M2SCI)
+ </para>
</listitem>
</varlistentry>
<varlistentry>
- <term>expression</term>
+ <term>RHS</term>
<listitem>
- <para>partie droite de l'instruction (une "tlist M2SCI")</para>
+ <para>partie droite de l'instruction (Righ Hand Side)(une tlist de M2SCI)</para>
</listitem>
</varlistentry>
<varlistentry>
<term>eq</term>
<listitem>
- <para>une tlist de type "equal"</para>
+ <para>une tlist de type "equal".</para>
</listitem>
</varlistentry>
</variablelist>
<refsection>
<title>Description</title>
<para>
- Cette fonction créé une <literal>tlist</literal> représentant les données d'inférence quand
- on utilise M2SCI. Tous les paramètres d'entrée sont vérifiés pour être compatible avec
- les "tlists M2SCI".
+ Cette fonction créé une <literal>tlist</literal> représentant une instruction "LHS = RHS",
+ utilisable par le convertisseur M2SCI.
+ Les arguments d'entrée sont vérifiés, en regard des formats attendus par le convertisseur.
</para>
</refsection>
+ <refsection>
+ <title>Examples</title>
+ <para>
+ Générons le code interne représentant l'instruction simple <literal>A = "off"</literal>:
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+LHS = Variable("A", Infer(list(1,1),Type(String,Unknown)));
+Equal(list(LHS), Cste("off"))
+ ]]></programlisting>
+ <para>
+ Générons le code interne représentant l'instruction <literal>A(2,:) = "off"</literal> :
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+// A
+LHS = Variable("A", Infer(list(Unknown,Unknown),Type(String,Unknown)));
+// A(2,:)
+LHS = Operation("ins", list(LHS,Cste(2),Colon), list()) // Insertion
+// A(2,:) = "off"
+Equal(list(LHS), Cste("off"))
+ ]]></programlisting>
+ <para>
+ Générons le code interne représentant l'expression
+ <literal>handles(:).axes_reverse(:,2) = "off"</literal>, où <literal>handles</literal>
+ est un vecteur ligne 1x3 d'identifiants (de repères) graphiques:
+ </para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+h = Variable("handles", Infer(list(1,3),Type(Handle,Unknown)));
+
+// Construction du code interne du récipient (partie gauche):
+// handles(:)
+LHS = Operation("ins", list(h,Colon), list()); // Insertion
+
+// handles(:).axes_reverse :
+LHS = Operation("ins", list(LHS,Cste("axes_reverse")), list()) // Insertion
+
+// handles(:).axes_reverse(:,2) :
+LHS = Operation("ins", list(LHS,Colon,Cste(2)), list()); // Insertion
+
+// .. et finalement l'expression complète :
+s.statement = Equal(list(LHS), Cste("off"))
+ ]]></programlisting>
+ <screen><![CDATA[
+--> s.statement = Equal(list(LHS), Cste("off"))
+ s =
+ statement: [equal] tlist with fields:
+ lhs: list:
+ (1) : [operation] tlist with fields:
+ operator = "ins"
+ operands: list:
+ (1) : [operation] tlist with fields:
+ operator = "ins"
+ operands: list:
+ (1) : [operation] tlist with fields:
+ operator = "ins"
+ operands: list with 2 elements.
+ out: empty list()
+ (2) : [cste] tlist with fields:
+ value = "axes_reverse"
+ infer: [infer] tlist with fields:
+ [dims, type, contents]
+ out: empty list()
+ (2) : [variable] tlist with fields:
+ name = ":"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = -1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ (3) : [cste] tlist with fields:
+ value = 2
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ out: empty list()
+ expression: [cste] tlist with fields:
+ value = "off"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 3
+ type: [type] tlist with fields:
+ vtype = 10
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ endsymbol = ";"
+]]></screen>
+ </refsection>
<refsection role="see also">
<title>Voir aussi</title>
<simplelist type="inline">
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="Operation">
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+-->
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+ xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+ xml:lang="fr" xml:id="Operation">
<refnamediv>
<refname>Operation</refname>
- <refpurpose>Créé un arbre représentant une opération</refpurpose>
+ <refpurpose>Génère le code interne Scilab représentant une opération</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Séquence d'appel</title>
- <synopsis>op=Operation(operator,operands,out)</synopsis>
+ <synopsis>op = Operation(operator, operands, out)</synopsis>
</refsynopsisdiv>
<refsection>
<title>Paramètres</title>
<varlistentry>
<term>operator</term>
<listitem>
- <para>symbole de l'opérateur (chaîne de caractères)</para>
+ <para>
+ code de l'opérateur. Les codes admis sont :
+ <literal>"''", ".''", "~", ":",
+ "+", "-", "*", ".*", ".*.", ".^", "/", "./", "\",
+ "==", "<>", "<", "<=", ">", ">=", "|", "||", "&", "&&",
+ "cc"</literal> (Concatenation des Colonnes [,]), <literal>"rc"</literal>
+ (Concanétation des lignes [;]),
+ <literal>"ccc"</literal> (Cells horizontal concatenation {,}),
+ <literal>"crc"</literal> (Cells vertical concatenation {;}),
+ <literal>"ins"</literal> (insertion), <literal>"ext"</literal> (extraction).
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term>operands</term>
<listitem>
- <para>liste des opérandes (liste de "tlists M2SCI")</para>
+ liste des opérandes, chacun étant représenté par une tlist
+ M2SCI de type "cste" (ex: 1.23), "variable" (ex: A),
+ "funcall" (ex: gcf()), ou "operation" (ex: (1+3)).
+ <para/>
</listitem>
</varlistentry>
<varlistentry>
<term>out</term>
<listitem>
- <para>liste des paramètres de sortie (liste de "tlists M2SCI")</para>
+ <para>
+ liste des paramètres de sortie de l'opération (le plus souvent
+ unique), chacun étant représenté par une tlist M2SCI.
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term>op</term>
<listitem>
- <para>une tlist de type "operation"</para>
+ <para>une tlist M2SCI de type "operation"</para>
</listitem>
</varlistentry>
</variablelist>
<refsection>
<title>Description</title>
<para>
- Cette fonction créé une <literal>tlist</literal> représentant les données d'inférence quand
- on utilise M2SCI. Tous les paramètres d'entrée sont vérifiés pour être compatible avec
+ Cette fonction créé une <literal>tlist</literal> représentant une opération quand
+ on utilise M2SCI. Les arguments d'entrée sont vérifiés pour être compatibles avec
les "tlists M2SCI".
</para>
</refsection>
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="Variable">
<refnamediv>
<refname>Variable</refname>
- <refpurpose>Créé un arbre représentant une variable</refpurpose>
+ <refpurpose>Génère le code interne Scilab représentant une variable (sans sa valeur)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Séquence d'appel</title>
- <synopsis>var=Variable(name,infer)</synopsis>
+ <synopsis>var = Variable(name, infer)</synopsis>
</refsynopsisdiv>
<refsection>
<title>Paramètres</title>
<varlistentry>
<term>infer</term>
<listitem>
- <para>données d'inférence (une tlist de type "infer", voir la page d'aide de Infer)</para>
+ <para>
+ données d'inférence (taille et type): tlist de type "infer", voir la page
+ d'aide de Infer)
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<refsection>
<title>Description</title>
<para>
- Cette fonction créé une <literal>tlist</literal> représentant les données d'inférence quand
- on utilise M2SCI. Tous les paramètres d'entrée sont vérifiés pour être compatible avec
+ Cette fonction crée une <literal>tlist</literal> représentant une variable, pour le
+ le convertisseur M2SCI. Les arguments d'entrée sont vérifiés pour être compatible avec
les "tlists M2SCI".
</para>
+ <note>
+ <emphasis role="bold">Colon</emphasis> est une variable prédéfinie contenant le
+ code interne Scilab représentant l'indice ":" (tout). Elle peut être utilisée
+ notamment dans les codes représentant des opérations d'insertion ou d'extraction.
+ </note>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
+ <para>
+ Définissons le code interne représentant une variable <literal>a</literal>,
+ matrice de taille 3x5 de textes:
+ </para>
+ <para>
+ <programlisting role="no-scilab-exec"><![CDATA[
+ s.a_code = Variable("a", Infer(list(1,1),Type(String,Unknown)))
+ ]]></programlisting>
+ <screen><![CDATA[
+--> s.a_code = Variable("a", Infer(list(3,5),Type(String,Unknown)))
+ s =
+ a_code: [variable] tlist with fields:
+ name = "a"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 3
+ (2) = 5
+ type: [type] tlist with fields:
+ vtype = 10
+ property = -1
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+]]></screen>
+ </para>
</refsection>
<refsection role="see also">
<title>Voir aussi</title>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>Historique</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.1.1</revnumber>
+ <revdescription>
+ Ajout de la variable prédéfinie <literal>Colon</literal>.
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
<?xml version="1.0" encoding="UTF-8"?>
<!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- -->
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+* Copyright (C) 2012 - 2016 - Scilab Enterprises
+* Copyright (C) 2020 - Samuel GOUGEON
+*
+* This file is hereby licensed under the terms of the GNU GPL v2.0,
+* pursuant to article 5.3.4 of the CeCILL v.2.1.
+* This file was originally licensed under the terms of the CeCILL v2.1,
+* and continues to be available under such terms.
+* For more information, see the COPYING file which you should have received
+* along with this program.
+*
+-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
<itemizedlist>
<listitem>
<para>
- nom_de_variable : nom de la variable déclarée. Ce nom peut être
- un champ de Struct (e.g. <literal>x(1,2).nom</literal>)
+ <emphasis role="bold">nom_de_variable</emphasis> : nom de la variable déclarée.
+ Ce nom peut être un champ de Struct (e.g. <literal>x(1,2).nom</literal>)
ou décrire le contenu d'une Cell en utilisant la syntaxe
- <literal>x(1,2).entries</literal>. NOTEZ que pour les Cells et les
- Structs <literal>*</literal> peut être utilisé comme index.
+ <literal>x(1,2).entries</literal>.
+ <note>
+ NOTEZ que pour les Cells et les
+ Structs <literal>*</literal> peut être utilisé comme index.
+ </note>
</para>
</listitem>
<listitem>
<para>
- dimensions : dimensions de la variable déclarée séparées par des espaces,
- si une dimension est inconnue, remplacez la par <literal>?</literal>. NOTEZ que
- les dimensions des chaînes de caractère doivent être identiques aux dimensions
- Matlab e.g. <literal>1 6</literal> pour la chaîne de caractères 'chaine'.
+ <emphasis role="bold">dimensions</emphasis> : dimensions de la variable déclarée
+ séparées par des espaces,
+ si une dimension est inconnue, remplacez la par <literal>?</literal>.
+ <warning>
+ NOTEZ que les dimensions des chaînes de caractères doivent être identiques
+ aux dimensions Matlab e.g. <literal>1 6</literal> pour le mot 'chaine'.
+ </warning>
</para>
</listitem>
- <listitem>
- <para>
- type_de_données: le type de donnée de la variable qui peut être :
- </para>
- <informaltable border="1">
- <tr>
- <td>Type de donnée m2scideclare</td>
- <td>Type Scilab "équivalent"</td>
- </tr>
- <tr>
- <td>Double</td>
- <td>1</td>
- </tr>
- <tr>
- <td>Boolean</td>
- <td>4</td>
- </tr>
- <tr>
- <td>Sparse</td>
- <td>5</td>
- </tr>
- <tr>
- <td>Int</td>
- <td>8</td>
- </tr>
- <tr>
- <td>Handle</td>
- <td>9</td>
- </tr>
- <tr>
- <td>String</td>
- <td>10</td>
- </tr>
- <tr>
- <td>Struct</td>
- <td>Struct Matlab (16)</td>
- </tr>
- <tr>
- <td>Cell</td>
- <td>Cell Matlab (17)</td>
- </tr>
- <tr>
- <td>Void</td>
- <td>Sans type (0)</td>
- </tr>
- <tr>
- <td>?</td>
- <td>Type inconnu</td>
- </tr>
- </informaltable>
- </listitem>
- <listitem>
- <para>
- propriété : propriété de la variable qui peut être :
- </para>
- <informaltable border="1">
- <tr>
- <td>Propriété m2scideclare</td>
- <td>"Equivalent" Scilab</td>
- </tr>
- <tr>
- <td>Real</td>
- <td>Donnée réelle</td>
- </tr>
- <tr>
- <td>Complex</td>
- <td>Donnée complexe</td>
- </tr>
+ <listitem>.
+ <informaltable border="0">
<tr>
- <td>?</td>
- <td>Property inconnue</td>
+ <td valign="top">
+ <para>
+ <emphasis role="bold">type_de_données</emphasis>:
+ le type de donnée de la variable qui peut être :
+ </para>
+ <informaltable border="1">
+ <tr>
+ <th>Type de donnée m2scideclare</th>
+ <th>Type Scilab "équivalent"</th>
+ </tr>
+ <tr><td>Double</td> <td>1</td> </tr>
+ <tr><td>Boolean</td> <td>4</td> </tr>
+ <tr><td>Sparse</td> <td>5</td> </tr>
+ <tr><td>Int</td> <td>8</td> </tr>
+ <tr><td>Handle</td> <td>9</td> </tr>
+ <tr><td>String</td> <td>10</td> </tr>
+ <tr><td>Struct</td> <td>16</td> </tr>
+ <tr><td>Cell</td> <td>17</td> </tr>
+ <tr><td>Function</td><td>13 (macro)</td></tr>
+ <tr><td>Builtin</td> <td>130</td> </tr>
+ <tr><td>Void</td> <td>0 (undefined)</td></tr>
+ <tr><td>?</td> <td>Type inconnu</td></tr>
+ </informaltable>
+ </td>
+ <td valign="top">
+ <para>
+ <emphasis role="bold">propriété</emphasis> :
+ propriété de la variable qui peut être :
+ </para>
+ <informaltable border="1">
+ <tr><th>Propriété m2scideclare</th> <th>"Equivalent" Scilab</th></tr>
+ <tr><td>Real</td> <td>Donnée réelle</td> </tr>
+ <tr><td>Complex</td> <td>Donnée complexe</td> </tr>
+ <tr><td>?</td> <td>Property inconnue</td> </tr>
+ </informaltable>
+ <para>
+ Ce champ est ignoré pour les types de données suivants :
+ <literal>Cell</literal>, <literal>Struct</literal>,
+ <literal>String</literal> et <literal>Boolean</literal>.
+ </para>
+ </td>
</tr>
- </informaltable>
- <para>
- Ce champ est ignoré pour les types de données suivants : <literal>Cell</literal>,
- <literal>Struct</literal>, <literal>String</literal> et <literal>Boolean</literal>.
- </para>
+ </informaltable>
</listitem>
</itemizedlist>
<para>
les données inférées, en cas de conflit, les données inférées sont conservées et
un warning est affiché. Si vous êtes sûrs de vos informations, rapportez ce bug.
</para>
- <para>Voici quelques exemples :</para>
+ </refsection>
+ <refsection>
+ <title>Exemples</title>
<itemizedlist>
<listitem>
<literal>%m2scideclare var1|2 3|Double|Real</literal>
</listitem>
</itemizedlist>
</refsection>
+ <refsection role="see also">
+ <title>Voir aussi</title>
+ <simplelist type="inline">
+ <member>
+ <link linkend="Type">Type</link>
+ </member>
+ </simplelist>
+ </refsection>
</refentry>
</refsynopsisdiv>
<refsection>
<title>Arguments</title>
+ <para>
+ Pour utiliser la valeur par défaut de certains arguments d'entrée, juste omettre leur
+ valeur, comme dans <literal>mfile2sci(M_file_path, result_path, , , 0)</literal>.
+ </para>
<variablelist>
<varlistentry>
<term>M_file_path</term>
// For more information, see the COPYING file which you should have received
// along with this program.
-function operation=%contents_i_operatio(field,contlist,operation)
+function operation = %contents_i_operation(field, contlist, operation)
if field=="contents" then
- operation.out(1).infer.contents=contlist
+ operation.out(1).infer.contents = contlist
else
error(gettext("Not yet implemented."))
end
+++ /dev/null
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
-//
-// Copyright (C) 2012 - 2016 - Scilab Enterprises
-//
-// This file is hereby licensed under the terms of the GNU GPL v2.0,
-// pursuant to article 5.3.4 of the CeCILL v.2.1.
-// This file was originally licensed under the terms of the CeCILL v2.1,
-// and continues to be available under such terms.
-// For more information, see the COPYING file which you should have received
-// along with this program.
-
-function operation=%l_i_operatio(field,inslist,operation)
- if field=="dims" then
- operation.out(1).dims=inslist
- elseif field=="type" then
- operation.out(1).type=inslist
- else
- error(gettext("Not yet implemented."))
- end
-endfunction
--- /dev/null
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2002-2004 - INRIA - Vincent COUVERT
+// Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// This file is hereby licensed under the terms of the GNU GPL v2.0,
+// pursuant to article 5.3.4 of the CeCILL v.2.1.
+// This file was originally licensed under the terms of the CeCILL v2.1,
+// and continues to be available under such terms.
+// For more information, see the COPYING file which you should have received
+// along with this program.
+
+function operation = %l_i_operation(field,inslist,operation)
+ if field=="dims" then
+ operation.out(1).infer.dims = inslist
+ else
+ error(gettext("Not yet implemented."))
+ end
+endfunction
+
+/*
+Architecture of an operation tlist (here for "1+2"):
+ s: [operation] tlist with fields:
+ operator = "+"
+ operands: list:
+ (1) : [cste] tlist with fields:
+ value = 1
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ (2) : [cste] tlist with fields:
+ value = 2
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+ out: list:
+ (1) : [variable] tlist with fields:
+ name = "ans"
+ infer: [infer] tlist with fields:
+ dims: list:
+ (1) = 1
+ (2) = 1
+ type: [type] tlist with fields:
+ vtype = 1
+ property = 0
+ contents: [contents] tlist with fields:
+ index: empty list()
+ data: empty list()
+*/
// For more information, see the COPYING file which you should have received
// along with this program.
-function val=%operatio_6(field,m2scitlist)
- // File generated from %PROTO_6.g: PLEASE DO NOT EDIT !
+function val = %operation_6(field, m2scitlist)
val=[]
if field=="infer" then
- val=m2scitlist.out(1).infer
+ val = m2scitlist.out(1).infer
elseif field=="dims" then
- val=m2scitlist.out(1).infer.dims
+ val = m2scitlist.out(1).infer.dims
elseif field=="type" then
- val=m2scitlist.out(1).infer.type
+ val = m2scitlist.out(1).infer.type
elseif field=="vtype" then
- val=m2scitlist.out(1).infer.type.vtype
+ val = m2scitlist.out(1).infer.type.vtype
elseif field=="property" then
- val=m2scitlist.out(1).infer.type.property
+ val = m2scitlist.out(1).infer.type.property
elseif field=="contents" then
- val=m2scitlist.out(1).infer.contents
+ val = m2scitlist.out(1).infer.contents
else
error(msprintf(gettext("Extraction of %s from ''%s'' tlist is not yet implemented."),string(field),typeof(m2scitlist)))
end
// For more information, see the COPYING file which you should have received
// along with this program.
-function val=%operatio_e(field,m2scitlist)
- // File generated from %PROTO_e.g: PLEASE DO NOT EDIT !
+function val = %operation_e(field, m2scitlist)
val=[]
if field=="infer" then
- val=m2scitlist.out(1).infer
+ val = m2scitlist.out(1).infer
elseif field=="dims" then
- val=m2scitlist.out(1).infer.dims
+ val = m2scitlist.out(1).infer.dims
elseif field=="type" then
- val=m2scitlist.out(1).infer.type
+ val = m2scitlist.out(1).infer.type
elseif field=="vtype" then
- val=m2scitlist.out(1).infer.type.vtype
+ val = m2scitlist.out(1).infer.type.vtype
elseif field=="property" then
- val=m2scitlist.out(1).infer.type.property
+ val = m2scitlist.out(1).infer.type.property
elseif field=="contents" then
- val=m2scitlist.out(1).infer.contents
+ val = m2scitlist.out(1).infer.contents
else
error(msprintf(gettext("Extraction of %s from ''%s'' tlist is not yet implemented."),string(field),typeof(m2scitlist)))
end
// For more information, see the COPYING file which you should have received
// along with this program.
-function op=%s_i_operatio(field,cste,op)
+function op = %s_i_operation(field, cste, op)
if field=="vtype" then
- op.type.vtype=cste
+ op.type.vtype = cste
elseif field=="property" then
- op.type.property=cste
+ op.type.property = cste
else
error(gettext("Not yet implemented."))
end
// For more information, see the COPYING file which you should have received
// along with this program.
-function operation=%type_i_operatio(field,inslist,operation)
+function operation = %type_i_operation(field, inslist, operation)
if field=="type" then
- operation.out(1).type=inslist
+ operation.out(1).infer.type = inslist
else
error(gettext("Not yet implemented."))
end
sciparam()
// Scilab variable types
- Double=1;
- Boolean=4; // Boolean type can also be 6
- Sparse=5;
- Int=8;
- Handle=9;
- String=10;
- Cell=17;
- Struct=16;
- Void=0;
- Unknown=-1; // Unknown type or dimension
- SupToOne=-2; // Dimension >1
- NotNull=-3; // Dimension >0
- Complex=1 //"Complex"
- Real=0 //"Real"
- Units=["pixels","centimeters","points","inches","normalized"]
+ Double = 1;
+ Boolean = 4; // Boolean type can also be 6
+ Sparse = 5;
+ Int = 8;
+ Handle = 9;
+ String = 10;
+ Cell = 17;
+ Struct = 16;
+ Function = 13;
+ Builtin = 130;
+ Void = 0;
+ Unknown =-1; // Unknown type or dimension
+ SupToOne =-2; // Dimension >1
+ NotNull =-3; // Dimension >0
+ Complex = 1 //"Complex"
+ Real = 0 //"Real"
+ Units = ["pixels","centimeters","points","inches","normalized"]
+
+ Colon = Variable(":", Infer(list(Unknown,1),Type(Double,Real)))
global %graphics
%graphics=struct()
">=" , "log" ;
"<>" , "log" ;
":" , "imp" ;
- "rc" , "rc" ;
+ "rc" , "rc" ; // [ ; ]
"ins" , "i" ;
"ext" , "e" ;
quote , "t" ;
- "cc" , "cc" ;
+ "cc" , "cc" ; // [ , ]
"|" , "g" ;
"&" , "h" ;
"~" , "5" ;
".^" , "j" ;
"."+quote , "0" ;
- "cceol" , "cc" ] // Column Concatenation with EOL between Rows
+ "ccc" , "ccc" ; // { , }
+ "crc" , "crc" ; // { ; }
+ "cceol" , "cc" ] // Column Concatenation with EOL between Rows
[logics,ops,quote]=resume(logics,ops,quote)