summaryrefslogtreecommitdiff
path: root/macros/CCodeGeneration
diff options
context:
space:
mode:
authoryash11122017-07-07 22:34:47 +0530
committeryash11122017-07-07 22:34:47 +0530
commit2340409c98f9b15bb23944b991e97a1aa4e88ce0 (patch)
tree8fa462e65aca52e5e933dee026a78c31baf0181c /macros/CCodeGeneration
parentf577f255fd5c1d30bc770e9b053823ada8684528 (diff)
parent69c573fe2e59236f063aaa94dcd44b556f945cbc (diff)
downloadScilab2C_fossee_old-2340409c98f9b15bb23944b991e97a1aa4e88ce0.tar.gz
Scilab2C_fossee_old-2340409c98f9b15bb23944b991e97a1aa4e88ce0.tar.bz2
Scilab2C_fossee_old-2340409c98f9b15bb23944b991e97a1aa4e88ce0.zip
1.Sci2cDeps updated 2.Windows compatibility resolved
Diffstat (limited to 'macros/CCodeGeneration')
-rw-r--r--macros/CCodeGeneration/C_GenerateMkfle_arduino.sci15
-rw-r--r--macros/CCodeGeneration/C_IfExpression.sci24
-rw-r--r--macros/CCodeGeneration/C_WhileExpression.sci16
-rw-r--r--macros/CCodeGeneration/GetClsFileName.sci12
-rw-r--r--macros/CCodeGeneration/JoinDeclarAndCcode.sci7
-rw-r--r--macros/CCodeGeneration/names3
6 files changed, 77 insertions, 0 deletions
diff --git a/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci b/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci
index b43eb44..2b9ca6c 100644
--- a/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci
+++ b/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci
@@ -1,3 +1,18 @@
+<<<<<<< HEAD
+=======
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// Author: Yash Pratap Singh Tomar
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
function C_GenerateMkfle_arduino(FileInfo,SharedInfo)
PrintStringInfo('ARDUINO_DIR = /usr/share/arduino',FileInfo.MakefileFilename,'file','y','y');
diff --git a/macros/CCodeGeneration/C_IfExpression.sci b/macros/CCodeGeneration/C_IfExpression.sci
index 359b788..23be452 100644
--- a/macros/CCodeGeneration/C_IfExpression.sci
+++ b/macros/CCodeGeneration/C_IfExpression.sci
@@ -1,4 +1,8 @@
+<<<<<<< HEAD
function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,FileInfo,SharedInfo)
+=======
+function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo)
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo)
// -----------------------------------------------------------------
// //NUT: add description here
@@ -19,6 +23,7 @@ function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,Fi
// ------------------------------
// --- Check input arguments. ---
// ------------------------------
+<<<<<<< HEAD
SCI2CNInArgCheck(argn(2),7,7);
//global SCI2CSTACK
@@ -29,6 +34,14 @@ SCI2CNInArgCheck(argn(2),7,7);
//if ((NIfCondArg ~= 1) & (ASTIfExpType~='else'))
// error(9999, 'Cannot manage ""if/elseif"" with a number of condition variables not equal to 1.');
//end
+=======
+SCI2CNInArgCheck(argn(2),5,5);
+
+// --- Check NIfCondArg value. ---
+if ((NIfCondArg ~= 1) & (ASTIfExpType~='else'))
+ error(9999, 'Cannot manage ""if/elseif"" with a number of condition variables not equal to 1.');
+end
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// -----------------------
// --- Initialization. ---
@@ -41,7 +54,11 @@ CPass1FileName = FileInfo.Funct(nxtscifunnumber).CPass1FileName;
// #RNU_RES_B
PrintStringInfo(' ',ReportFileName,'file','y');
+<<<<<<< HEAD
PrintStringInfo('***Generating C code***'+ string(NIfCondArg),ReportFileName,'file','y');
+=======
+PrintStringInfo('***Generating C code***',ReportFileName,'file','y');
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// #RNU_RES_E
// ---------------------------
// --- End Initialization. ---
@@ -70,6 +87,7 @@ if SCI2Cstrncmps1size(ASTIfExpType,'else')
SharedInfo = C_IfElseBlocks(FileInfo,SharedInfo,'out');
end
+<<<<<<< HEAD
i=1;
k=1;
CCall ='';
@@ -87,6 +105,12 @@ if (ASTIfExpType~='else')
i = i + 1;
end
CCall = CCall+')';
+=======
+CCall ='';
+CCall = CCall+CFunName;
+if (ASTIfExpType~='else')
+ CCall = CCall+'('+IfCondArg(1)+')';
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
end
PrintStringInfo(' '+CCall,ReportFileName,'file','y');
PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y');
diff --git a/macros/CCodeGeneration/C_WhileExpression.sci b/macros/CCodeGeneration/C_WhileExpression.sci
index 368ccff..c63b9e8 100644
--- a/macros/CCodeGeneration/C_WhileExpression.sci
+++ b/macros/CCodeGeneration/C_WhileExpression.sci
@@ -1,4 +1,8 @@
+<<<<<<< HEAD
function SharedInfo = C_WhileExpression(IfCondArg,NIfCondArg,Op,NOp,FileInfo,SharedInfo)
+=======
+function SharedInfo = C_WhileExpression(FileInfo,SharedInfo)
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// function SharedInfo = C_WhileExpression(FileInfo,SharedInfo)
// -----------------------------------------------------------------
// //NUT: add description here
@@ -19,7 +23,11 @@ function SharedInfo = C_WhileExpression(IfCondArg,NIfCondArg,Op,NOp,FileInfo,Sha
// ------------------------------
// --- Check input arguments. ---
// ------------------------------
+<<<<<<< HEAD
SCI2CNInArgCheck(argn(2),6,6);
+=======
+SCI2CNInArgCheck(argn(2),2,2);
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// -----------------------
// --- Initialization. ---
@@ -63,7 +71,11 @@ for cntstr = 1:NumCStrings
// Epilogue
if (length(C_Strings(cntstr)) == 0)
C_Strings(cntstr) = ' '; // RNU for Bruno: If I don't do that I get a PrintStringInfo error related to mputstr.
+<<<<<<< HEAD
// Function not defined for given argument type(s),
+=======
+ // Function not defined for given argument type(s),
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// check arguments or define function %0_mputstr for overloading.
end
PrintStringInfo(C_Strings(cntstr),CPass1WhileEpilFileName ,'file','y','n');
@@ -76,6 +88,7 @@ PrintStringInfo('}',CPass1WhileEpilFileName ,'file','y');
// ------------------------------
// --- Insert for expression. ---
// ------------------------------
+<<<<<<< HEAD
//CCall = 'while('+SharedInfo.WhileExpr.CondVar+')';
//PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y');
@@ -97,6 +110,9 @@ CCall = CCall+'while';
CCall = CCall+')';
PrintStringInfo(' '+CCall,ReportFileName,'file','y');
+=======
+CCall = 'while('+SharedInfo.WhileExpr.CondVar+')';
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y');
// -------------------
diff --git a/macros/CCodeGeneration/GetClsFileName.sci b/macros/CCodeGeneration/GetClsFileName.sci
index 4220410..619c493 100644
--- a/macros/CCodeGeneration/GetClsFileName.sci
+++ b/macros/CCodeGeneration/GetClsFileName.sci
@@ -45,7 +45,10 @@ if SCI2Cfileexist(FileInfo.USER2CLibCAnnFun,tmpannfilename)
// #RNU_RES_B
// It is a C function of the USER2C library.
// #RNU_RES_E
+<<<<<<< HEAD
PrintStringInfo('cUser2c',ReportFileName,'file','y');
+=======
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
FlagFoundAnnFile = 1;
AnnFileName = fullfile(FileInfo.USER2CLibCAnnFun,tmpannfilename);
SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName);
@@ -54,7 +57,10 @@ elseif SCI2Cfileexist(FileInfo.USER2CLibSCIAnnFun,tmpannfilename)
// #RNU_RES_B
// It is a scilab function of the USER2C library.
// #RNU_RES_E
+<<<<<<< HEAD
PrintStringInfo('fUser2c',ReportFileName,'file','y');
+=======
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
FlagFoundAnnFile = 1;
AnnFileName = fullfile(FileInfo.USER2CLibSCIAnnFun,tmpannfilename);
SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName);
@@ -63,7 +69,10 @@ elseif (SCI2Cfileexist(FileInfo.SCI2CLibCAnnFun,tmpannfilename))
// #RNU_RES_B
// It is a C function of the SCI2C library.
// #RNU_RES_E
+<<<<<<< HEAD
PrintStringInfo('csci2c',ReportFileName,'file','y');
+=======
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
FlagFoundAnnFile = 1;
AnnFileName = fullfile(FileInfo.SCI2CLibCAnnFun,tmpannfilename);
SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName);
@@ -72,7 +81,10 @@ elseif (SCI2Cfileexist(FileInfo.SCI2CLibSCIAnnFun,tmpannfilename))
// #RNU_RES_B
// It is a scilab function of the SCI2C library.
// #RNU_RES_E
+<<<<<<< HEAD
PrintStringInfo('fsci2c',ReportFileName,'file','y');
+=======
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
FlagFoundAnnFile = 1;
AnnFileName = fullfile(FileInfo.SCI2CLibSCIAnnFun,tmpannfilename);
SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName);
diff --git a/macros/CCodeGeneration/JoinDeclarAndCcode.sci b/macros/CCodeGeneration/JoinDeclarAndCcode.sci
index 35607f6..4a2906c 100644
--- a/macros/CCodeGeneration/JoinDeclarAndCcode.sci
+++ b/macros/CCodeGeneration/JoinDeclarAndCcode.sci
@@ -146,10 +146,17 @@ PrintStringInfo('** --- C code. ---',CPass2FileName,'file','y');
PrintStringInfo('** ---------------',CPass2FileName,'file','y');
PrintStringInfo('*/',CPass2FileName,'file','y');
+<<<<<<< HEAD
//if((SharedInfo.Target == "RPi") & (nxtscifunname == SharedInfo.SCIMainFunName))
//Add wiringPiSetup() function as it is required
// PrintStringInfo('wiringPiSetup();',CPass2FileName,'file','y');
//end
+=======
+if((SharedInfo.Target == "RPi") & (nxtscifunname == SharedInfo.SCIMainFunName))
+ //Add wiringPiSetup() function as it is required
+ PrintStringInfo('wiringPiSetup();',CPass2FileName,'file','y');
+end
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// --- Copy the remaining part of V1 in V2. ---
while (~meof(CPass1V1FileFid))
// #RNU_RES_B
diff --git a/macros/CCodeGeneration/names b/macros/CCodeGeneration/names
index 56caa81..96b24bd 100644
--- a/macros/CCodeGeneration/names
+++ b/macros/CCodeGeneration/names
@@ -2,7 +2,10 @@ C_FinalizeCode
C_ForExpression
C_Funcall
C_GenDeclarations
+<<<<<<< HEAD
C_GenDeclarations_Dup
+=======
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
C_GenerateFunName
C_GenerateLaunchScript
C_GenerateMakefile