From 8b44229ef44f0558ce045e46ff833fb44df913c9 Mon Sep 17 00:00:00 2001 From: jofret Date: Mon, 21 Jun 2010 06:24:38 +0000 Subject: Tagging the 2.0 release of scilab2c --- help/builder_help.sce | 10 ++ help/en_US/annotation_tag/CHAPTER | 1 + help/en_US/annotation_tag/NIN.xml | 87 ++++++++++++++ help/en_US/build_help.sce | 12 ++ help/en_US/runscicode.xml | 83 ++++++++++++++ help/en_US/scilab2c.xml | 114 +++++++++++++++++++ help/en_US/scilab2c_annotations.xml | 51 +++++++++ help/en_US/scilab2c_data_annotations.xml | 157 ++++++++++++++++++++++++++ help/en_US/scilab2c_functions_annotations.xml | 121 ++++++++++++++++++++ 9 files changed, 636 insertions(+) create mode 100644 help/builder_help.sce create mode 100644 help/en_US/annotation_tag/CHAPTER create mode 100644 help/en_US/annotation_tag/NIN.xml create mode 100644 help/en_US/build_help.sce create mode 100644 help/en_US/runscicode.xml create mode 100644 help/en_US/scilab2c.xml create mode 100644 help/en_US/scilab2c_annotations.xml create mode 100644 help/en_US/scilab2c_data_annotations.xml create mode 100644 help/en_US/scilab2c_functions_annotations.xml (limited to 'help') diff --git a/help/builder_help.sce b/help/builder_help.sce new file mode 100644 index 00000000..0d6b02bd --- /dev/null +++ b/help/builder_help.sce @@ -0,0 +1,10 @@ +// ==================================================================== +// Copyright INRIA 2008 +// This file is released into the public domain +// ==================================================================== + +help_dir = get_absolute_file_path('builder_help.sce'); +tbx_builder_help_lang("en_US", help_dir); +//tbx_builder_help_lang("fr_FR", help_dir); + +clear help_dir; diff --git a/help/en_US/annotation_tag/CHAPTER b/help/en_US/annotation_tag/CHAPTER new file mode 100644 index 00000000..c32ac0b3 --- /dev/null +++ b/help/en_US/annotation_tag/CHAPTER @@ -0,0 +1 @@ +title = Annotation TAGS diff --git a/help/en_US/annotation_tag/NIN.xml b/help/en_US/annotation_tag/NIN.xml new file mode 100644 index 00000000..32f41b99 --- /dev/null +++ b/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/help/en_US/build_help.sce b/help/en_US/build_help.sce new file mode 100644 index 00000000..783533c9 --- /dev/null +++ b/help/en_US/build_help.sce @@ -0,0 +1,12 @@ +// ==================================================================== +// Copyright INRIA 2008 +// Allan CORNET +// Simon LIPP +// This file is released into the public domain +// ==================================================================== + +help_lang_dir = get_absolute_file_path('build_help.sce'); + +tbx_build_help(TOOLBOX_TITLE, help_lang_dir); + +clear help_lang_dir; diff --git a/help/en_US/runscicode.xml b/help/en_US/runscicode.xml new file mode 100644 index 00000000..981caf4b --- /dev/null +++ b/help/en_US/runscicode.xml @@ -0,0 +1,83 @@ + + + + + $LastChangedDate$ + + + + runscicode + + Launch a scilabfunction with specific path loaded. + + + + Calling Sequence + + + runscicode(UserScilabMainFile, UserSciFilesPaths); + + + + + Parameters + + + UserScilabMainFile + + This file should contain the main scilab function to run. + The function should have the same name as the file. + + + + UserSciFilesPaths + + This is a matrix of PATH containing .sci files. + + + + + + + + Description + + Run a Scilab function with specific PATH loaded. + + This function will load all .sci files given in UserSciFilesPaths. +Then it loads UserScilabMainFile and the function corresponding to the file name is launched. + + + + Examples + + + runscicode("./mysScript.sci", []); + // Will load myScript.sci then run myScript() + runscicode("./myScript.sci", "/tmp/myScriptDependencies"); + // Will load each .sci file in /tmp/myScriptDependencies + // Then load myScript.sci and run myScript() + + + + + Authors + + + Bruno JOFRET + Raffaele NUTRICATO + + + diff --git a/help/en_US/scilab2c.xml b/help/en_US/scilab2c.xml new file mode 100644 index 00000000..c726406e --- /dev/null +++ b/help/en_US/scilab2c.xml @@ -0,0 +1,114 @@ + + + + + $LastChangedDate$ + + + + scilab2c + + Scilab to C Converter + + + + Calling Sequence + + + scilab2c(); + scilab2c(inputScript, outputPath); + scilab2c(inputScript, outputPath, pathToADditionnalFunctions); + scilab2c(inputScript, outputPath, pathToADditionnalFunctions, RunMode); + + + + + Parameters + + + inputScript + + This file should contain the scilab function we want + to translate. + + + + + outputPath + + Output Path for code genrated and logs. + + + + + pathToADditionnalFunctions + + This is the path to look in for additional user defined functions. + + + + + RunMode + + Must be "All", "Translate" or "GenLibraryStructure" + + + + + + + + + Description + + Convert a scilab function into a C File. + + + + + Examples + + + // Launch the GUI + scilab2c(); + + // Convert the function present in myScript.sci + // into a C file : 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 + + + Bruno JOFRET + Raffaele NUTRICATO + + + diff --git a/help/en_US/scilab2c_annotations.xml b/help/en_US/scilab2c_annotations.xml new file mode 100644 index 00000000..2e412827 --- /dev/null +++ b/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/help/en_US/scilab2c_data_annotations.xml b/help/en_US/scilab2c_data_annotations.xml new file mode 100644 index 00000000..f8dc32c6 --- /dev/null +++ b/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 + + + diff --git a/help/en_US/scilab2c_functions_annotations.xml b/help/en_US/scilab2c_functions_annotations.xml new file mode 100644 index 00000000..15a4d97a --- /dev/null +++ b/help/en_US/scilab2c_functions_annotations.xml @@ -0,0 +1,121 @@ + + + + + $LastChangedDate$ + + + + Scilab2C Functions Annotations + + Scilab to C Converter : Functions Annotations How To + + + + Description + + The annotation of every Scilab function is mandatory. Only the main function of the Scilab program you are translating doesn’t need any annotation. + + + The main function can not return any output argument and can not accept any input argument. + + + It is important to specify for each output argument of the Scilab function, its size and type in order to have the possibility to allocate the correct memory space at translation time. + When the size of the returned output can be estimated only at run time, as happens for find-like functions that return an output whose size is related to the condition tested by the function, + the user must be able to specify at least the maximum size that can be returned by the function. + If it is not possible then the function should dynamically allocate memory and so can not be translated by Sci2C. + + + Function annotation must specify: + + the number of input arguments. (See NIN tag) + the number of output arguments. (See NOUT tag) + the type and precision of each output argument. (See TP tag) + the size of every output argument. (See SZ tag) + the default precision for the data declared in the function body. + + + + + + Simple Example + + This will declare a function with the following informations: + + 1 input argument. + 2 output arguments. + first output argument has the same type than first input argument. + first output argument has the same width than first input argument. + first output argument has the same height than first input argument. + second output argument has the same type than first input argument. + second output argument has the same width than first input argument. + second output argument has the same height than first input argument. + + + + + Simple Example + + This will declare a function with the following informations: + + 2 input arguments. + 2 output arguments. + first output argument has the same type than first input argument. + first output argument is a row vetor. + first output argument's height is the product of the first input width by height. + second output argument has the same type than first input argument. + second output argument is a row vector. + second output argument's height is the product of the first input width by height. + + + + See Also + + + Sciab2C Annotations, + Scilab2C Code Generator + + + + + + + + Authors + + Bruno JOFRET + Raffaele NUTRICATO + + + -- cgit