diff options
author | Ankit Raj | 2017-06-21 10:26:59 +0530 |
---|---|---|
committer | Ankit Raj | 2017-06-21 10:26:59 +0530 |
commit | 958577cac90a99124cd673fde1926781d966d91f (patch) | |
tree | 134d9fe7f5b97a647cb055bb7b4c21820a749f49 /macros/CCodeGeneration/Sci2AnnotationFile.sci | |
download | Scilab2C_fossee_old-958577cac90a99124cd673fde1926781d966d91f.tar.gz Scilab2C_fossee_old-958577cac90a99124cd673fde1926781d966d91f.tar.bz2 Scilab2C_fossee_old-958577cac90a99124cd673fde1926781d966d91f.zip |
Updated Scilab2C
Diffstat (limited to 'macros/CCodeGeneration/Sci2AnnotationFile.sci')
-rw-r--r-- | macros/CCodeGeneration/Sci2AnnotationFile.sci | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/macros/CCodeGeneration/Sci2AnnotationFile.sci b/macros/CCodeGeneration/Sci2AnnotationFile.sci new file mode 100644 index 0000000..001ed25 --- /dev/null +++ b/macros/CCodeGeneration/Sci2AnnotationFile.sci @@ -0,0 +1,55 @@ +function Sci2AnnotationFile(SciFileName,ClsFileName,AnnFileName,AnnSpecifier,ReportFileName) +// function Sci2AnnotationFile(SciFileName,ClsFileName,AnnFileName,AnnSpecifier,ReportFileName) +// -------------------------------------------------------------------------------- +// #RNU_RES_B +// This function reads the .sci input file and generates the correspondig .ann +// and .acls files. +// #RNU_RES_E +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 25-Jun-2007 -- Nutricato Raffaele: Author. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),5,5); + +[tmppath,tmpfunname,tmpext] = fileparts(SciFileName); + +// --------------------------------------- +// --- Open the .sci file (read only). --- +// --------------------------------------- +inscifid = SCI2COpenFileRead(SciFileName); + +// ---------------------------------------------- +// --- Loop over the lines of the input file. --- +// ---------------------------------------------- +line_position = 0; +L_AnnSpecifierP1 = length(AnnSpecifier)+1; +while (meof(inscifid) == 0) + check_string = stripblanks(mgetl(inscifid,1)); + line_position = line_position + 1; + L_string = length(check_string); + if (L_string >= 1) + if (SCI2Cstrncmps1size(AnnSpecifier,check_string)) + tmpannotation = stripblanks(part(check_string,L_AnnSpecifierP1:L_string)); + PrintStringInfo(tmpannotation,ClsFileName,'file','y'); + end + end +end +mclose(inscifid); +// -------------------------------------------------- +// --- End loop over the lines of the input file. --- +// -------------------------------------------------- +PrintStringInfo('CLASS: '+tmpfunname,AnnFileName,'file','y'); +endfunction |