From 57a66eab31b5b2a57b0eac329ea8e695e2487911 Mon Sep 17 00:00:00 2001
From: jofret
Date: Thu, 17 Jun 2010 16:28:38 +0000
Subject: Start converting documentation
---
scilab2c/help/en_US/annotation_tag/CHAPTER | 1 +
scilab2c/help/en_US/annotation_tag/NIN.xml | 87 ++++++++++++
scilab2c/help/en_US/scilab2c.xml | 32 +++--
scilab2c/help/en_US/scilab2c_annotations.xml | 51 +++++++
scilab2c/help/en_US/scilab2c_data_annotations.xml | 157 ++++++++++++++++++++++
5 files changed, 318 insertions(+), 10 deletions(-)
create mode 100644 scilab2c/help/en_US/annotation_tag/CHAPTER
create mode 100644 scilab2c/help/en_US/annotation_tag/NIN.xml
create mode 100644 scilab2c/help/en_US/scilab2c_annotations.xml
create mode 100644 scilab2c/help/en_US/scilab2c_data_annotations.xml
diff --git a/scilab2c/help/en_US/annotation_tag/CHAPTER b/scilab2c/help/en_US/annotation_tag/CHAPTER
new file mode 100644
index 00000000..c32ac0b3
--- /dev/null
+++ b/scilab2c/help/en_US/annotation_tag/CHAPTER
@@ -0,0 +1 @@
+title = Annotation TAGS
diff --git a/scilab2c/help/en_US/annotation_tag/NIN.xml b/scilab2c/help/en_US/annotation_tag/NIN.xml
new file mode 100644
index 00000000..32f41b99
--- /dev/null
+++ b/scilab2c/help/en_US/annotation_tag/NIN.xml
@@ -0,0 +1,87 @@
+
+
+
+
+ $LastChangedDate$
+
+
+
+ NIN annotation tag
+ Scilab2C Function annotation : NIN
+
+
+
+ Calling Sequence
+
+
+ //SCI2C: NIN= number
+
+
+
+
+ Parameters
+
+
+ number
+
+ Specifies the number of input arguments
+
+
+
+
+
+
+
+ Description
+ This annotation must be placed before a user function to allow Scilab2C to convert it.
+
+
+
+ Examples
+
+
+
+
+
+
+
+
+
+
+
+
+ Authors
+
+
+ Bruno JOFRET
+ Raffaele NUTRICATO
+
+
+
diff --git a/scilab2c/help/en_US/scilab2c.xml b/scilab2c/help/en_US/scilab2c.xml
index a48273e2..c726406e 100644
--- a/scilab2c/help/en_US/scilab2c.xml
+++ b/scilab2c/help/en_US/scilab2c.xml
@@ -28,9 +28,9 @@
scilab2c();
- scilab2c("PATH/script_to_translate.sci", "PATH/generated_c_code.c");
- scilab2c("PATH/script_to_translate.sci", "PATH/generated_c_code.c", "PATH_TO_ADDITIONNAL_FUNCTIONS");
- scilab2c("PATH/script_to_translate.sci", "PATH/generated_c_code.c", "PATH_TO_ADDITIONNAL_FUNCTIONS", RunMode);
+ scilab2c(inputScript, outputPath);
+ scilab2c(inputScript, outputPath, pathToADditionnalFunctions);
+ scilab2c(inputScript, outputPath, pathToADditionnalFunctions, RunMode);
@@ -38,7 +38,7 @@
Parameters
- PATH/script_to_translate.sci
+ inputScriptThis file should contain the scilab function we want
to translate.
@@ -46,14 +46,14 @@
- PATH/generated_c_code.c
+ outputPath
- This file will contain the C code translate from the script.
+ Output Path for code genrated and logs.
- PATH_TO_ADDITIONNAL_FUNCTIONS
+ pathToADditionnalFunctionsThis is the path to look in for additional user defined functions.
@@ -63,7 +63,6 @@
RunModeMust be "All", "Translate" or "GenLibraryStructure"
- //FIXME : Must explain here which parameter does what ?
@@ -76,7 +75,6 @@
Convert a scilab function into a C File.
- //FIXME : Add more informations here
@@ -85,12 +83,26 @@
// Launch the GUI
scilab2c();
+
// Convert the function present in myScript.sci
// into a C file : myMain.c
- scilab2c("./mysScript.sci", "./myMain.c");
+ scilab2c("./mysScript.sci", "./");
+
+ // Example in unit_tests
+ global SCI2CHOME
+ scilab2c(SCI2CHOME+"/tests/unit_tests/test000_TrigonIdentity/scilabcode/mainfunction.sci", TMPDIR);
+
+ See Also
+
+
+ Sciab2C Annotations
+
+
+
+
Authors
diff --git a/scilab2c/help/en_US/scilab2c_annotations.xml b/scilab2c/help/en_US/scilab2c_annotations.xml
new file mode 100644
index 00000000..66db6d88
--- /dev/null
+++ b/scilab2c/help/en_US/scilab2c_annotations.xml
@@ -0,0 +1,51 @@
+
+
+
+
+ $LastChangedDate$
+
+
+
+ Scilab2C Annotations
+
+ Scilab to C Converter : Annotations How To
+
+
+
+ Introduction
+
+ Both data and functions declared into the Scilab source code must be annotated in order make the translator able to extract size, precision and type of data and of input and output function arguments.
+
+
+
+
+ See Also
+
+
+ Scilab2C Code Generator,
+ Data annotations,
+ Functions annotations
+
+
+
+
+
+ Authors
+
+ Bruno JOFRET
+ Raffaele NUTRICATO
+
+
+
diff --git a/scilab2c/help/en_US/scilab2c_data_annotations.xml b/scilab2c/help/en_US/scilab2c_data_annotations.xml
new file mode 100644
index 00000000..f8dc32c6
--- /dev/null
+++ b/scilab2c/help/en_US/scilab2c_data_annotations.xml
@@ -0,0 +1,157 @@
+
+
+
+
+ $LastChangedDate$
+
+
+
+ Scilab2C Data Annotations
+
+ Scilab to C Converter : Data Annotations How To
+
+
+
+ Description
+
+ Data annotations are used to define the size, type and precisions of variables and numbers used in the Scilab code.
+
+
+ By default Sci2C assumes the double precision, which is the default precision used by the Scilab language.
+ Actually the whole Scilab software only works with double precision. Pay attention that the computation done in Scilab and the C code generated with single precision can differ.
+
+
+ It is possible to force a default precision for each source file, by using a dedicated annotation that must be inserted after the function annotation section (Cf. Function Annotation.):
+
+
+ This annotation specifies the default precision for all the data used in the function body.
+ Allowed settings for precision are:
+
+
+
+
+ If not otherwise specified, the precision of the data will be float single and float double, respectively.
+
+
+
+ It is also possible to force some variable having a certain type using functions :
+
+ float: forces a variable or a number or a matrix of numbers to be real float.
+ double: forces a variable or a number or a matrix of numbers to be real double.
+ floatcomplex: forces a variable or a number or a matrix of numbers to be complex float.
+ doublecomplex: forces a variable or a number or a matrix of numbers to be complex double.
+
+
+
+
+
+
+ Example 1
+
+ This will generate a C code with the y variable declared as a scalar, real, float.
+
+
+
+ Example 2
+
+ Assuming is not present, the default precision will be
+ This will generate a C code with
+
+
+ x as scalar real double.
+
+
+ y as 10 by 3 matrix of real double filled with zeros.
+
+
+ z as scalar real double. In this case the double specifier is redundant.
+
+
+
+
+
+
+ Example 3
+
+ This will generate a C code with
+
+
+ x as scalar real float.
+
+
+ y as 10 by 3 matrix of real float filled with zeros. In this case the float specifier is redundant.
+
+
+ z as scalar real double.
+
+
+
+
+
+
+ Example 4
+
+ This will generate a C code with
+
+
+ x as scalar real double.
+
+
+ y as scalar real double.
+
+
+ z as scalar real double. According to the behaviour of + operator and due to the fact that x
+ and y are both in double precision, Scilab2C will set z with double precision.
+
+
+
+
+
+ See Also
+
+
+ Sciab2C Annotations,
+ Scilab2C Code Generator
+
+
+
+
+
+
+
+ Authors
+
+ Bruno JOFRET
+ Raffaele NUTRICATO
+
+
+
--
cgit