summaryrefslogtreecommitdiff
path: root/2.3-1/macros/ASTManagement
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/macros/ASTManagement')
-rw-r--r--2.3-1/macros/ASTManagement/AST2Ccode.sci2
-rw-r--r--2.3-1/macros/ASTManagement/AST_HandleCC.sci43
-rw-r--r--2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci9
-rw-r--r--2.3-1/macros/ASTManagement/AST_HandleFunCC.sci48
-rw-r--r--2.3-1/macros/ASTManagement/AST_HandleFunRC.sci48
-rw-r--r--2.3-1/macros/ASTManagement/libbin1864 -> 2136 bytes
6 files changed, 43 insertions, 107 deletions
diff --git a/2.3-1/macros/ASTManagement/AST2Ccode.sci b/2.3-1/macros/ASTManagement/AST2Ccode.sci
index 8dd07589..563f3133 100644
--- a/2.3-1/macros/ASTManagement/AST2Ccode.sci
+++ b/2.3-1/macros/ASTManagement/AST2Ccode.sci
@@ -1,5 +1,5 @@
function AST2Ccode(FileInfoDatFile)
-// function AST2Ccode(FileInfoDatFi
+// function AST2Ccode(FileInfoDatFile)
// -----------------------------------------------------------------
// Read the AST and call the corresponding handlers.
//
diff --git a/2.3-1/macros/ASTManagement/AST_HandleCC.sci b/2.3-1/macros/ASTManagement/AST_HandleCC.sci
index 0b9e4d9c..cc411549 100644
--- a/2.3-1/macros/ASTManagement/AST_HandleCC.sci
+++ b/2.3-1/macros/ASTManagement/AST_HandleCC.sci
@@ -1,36 +1,15 @@
+// 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: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function [RhsNames,RhsScope,NRhs] = AST_HandleCC(FileInfo,SharedInfo)
-// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Handles the EndFuncall, EndOperation and EndEqual tags of the AST.
-// ASTFunType can be 'Funcall', 'Operation', 'Equal'
-// Structure of Funcall:
-// overloading function for "funcall" type tlist string function
-// this is a node of the AST
-// fields:
-// rhs : a list
-// name : string, the name of the function
-// lhsnb: number, the number of function lhs
-// txt=['Funcall : '+F.name
-// ' #lhs : '+string(F.lhsnb)
-// ' Rhs : '
-// ' '+objectlist2string(F.rhs)
-// 'EndFuncall'
-// ]
-// #RNU_RES_E
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 11-Apr-2007 -- Raffaele Nutricato: Author.
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
SCI2CNInArgCheck(argn(2),2,2)
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci
index ca8caab2..807b8bab 100644
--- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci
+++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci
@@ -138,6 +138,10 @@ NOutArg_mod = NOutArg
ASTFunName='modk';
end
+ if ASTFunName == '%sn'
+ ASTFunName='modsn';
+ end
+
if (ASTFunName == 'OpEqual')
FunTypeAnnot = '';
FunSizeAnnot = '';
@@ -453,12 +457,12 @@ NOutArg_mod = NOutArg
//#RNU_RES_E
//disp(OutArg,InArg,ASTFunName)
+
CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg_mod);
//#RNU_RES_B
PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y');
if(IsArduinoFunction(ASTFunName))
- //disp(ASTFunName)
if(IsArduinoSetupFunction(ASTFunName))
//If current function is an arduino setup function (like 'dc_motor_setup'), it
//should not be converted and inserted here. It is inserted in a list now and
@@ -479,7 +483,8 @@ NOutArg_mod = NOutArg
else
LibTypeInfo = 'USER2C';
end
-
+
+
//#RNU_RES_B
// ------------------------------------------------------------------------------------
// --- Check whether the function has been already called in the current .sci file. ---
diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci b/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci
index 40155bac..1942c749 100644
--- a/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci
+++ b/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci
@@ -1,36 +1,16 @@
+// 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: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
function [FileInfo,SharedInfo] = AST_HandleFunCC(NCol,FileInfo,SharedInfo)
-// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Handles the EndFuncall, EndOperation and EndEqual tags of the AST.
-// ASTFunType can be 'Funcall', 'Operation', 'Equal'
-// Structure of Funcall:
-// overloading function for "funcall" type tlist string function
-// this is a node of the AST
-// fields:
-// rhs : a list
-// name : string, the name of the function
-// lhsnb: number, the number of function lhs
-// txt=['Funcall : '+F.name
-// ' #lhs : '+string(F.lhsnb)
-// ' Rhs : '
-// ' '+objectlist2string(F.rhs)
-// 'EndFuncall'
-// ]
-// #RNU_RES_E
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 11-Apr-2007 -- Ukasha Noor: Author.
-//
-// Copyright 2017 Ukasha Noor.
-// Contact: ukashanoor.iiitk@gmail.com
-// -----------------------------------------------------------------
SCI2CNInArgCheck(argn(2),3,3)
@@ -85,15 +65,12 @@ while (RhsField ~= 'Expression:')
if RhsField <> 'Operands:'
[InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField);
end
- //disp(InputArgumentNames(NInArg));
//InArg(NInArg) = RhsField;
RhsField = AST_PopASTStack();
end
InputArgumentNames = SCI2Cflipud(InputArgumentNames);
InputArgumentScope = SCI2Cflipud(InputArgumentScope);
-disp(NInArg);
-
// -------------------------------------
// --- Generate the InArg structure. ---
@@ -114,7 +91,6 @@ for counteroutputargs = 1:NOutArg
OutArg(counteroutputargs).Name=OutputArgumentNames(counteroutputargs);
OutArg(counteroutputargs).Scope=OutputArgumentScope(counteroutputargs);
end
-disp(NOutArg);
// ------------------------
// --- Print Some Info. ---
diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci b/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci
index c08c17e7..d3169249 100644
--- a/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci
+++ b/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci
@@ -1,36 +1,15 @@
+// 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: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function [FileInfo,SharedInfo] = AST_HandleFunRC(FileInfo,SharedInfo)
-// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
-// -----------------------------------------------------------------
-// #RNU_RES_B
-// Handles the EndFuncall, EndOperation and EndEqual tags of the AST.
-// ASTFunType can be 'Funcall', 'Operation', 'Equal'
-// Structure of Funcall:
-// overloading function for "funcall" type tlist string function
-// this is a node of the AST
-// fields:
-// rhs : a list
-// name : string, the name of the function
-// lhsnb: number, the number of function lhs
-// txt=['Funcall : '+F.name
-// ' #lhs : '+string(F.lhsnb)
-// ' Rhs : '
-// ' '+objectlist2string(F.rhs)
-// 'EndFuncall'
-// ]
-// #RNU_RES_E
-//
-// Input data:
-// //NUT: add description here
-//
-// Output data:
-// //NUT: add description here
-//
-// Status:
-// 11-Apr-2007 -- Ukasha Noor: Author.
-//
-// Copyright 2017 Ukasha Noor.
-// Contact: ukashanoor.iiitk@gmail.com
-// -----------------------------------------------------------------
SCI2CNInArgCheck(argn(2),2,2)
@@ -85,15 +64,12 @@ while (RhsField ~= 'Expression:')
if RhsField <> 'Operands:'
[InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField);
end
- //disp(InputArgumentNames(NInArg));
//InArg(NInArg) = RhsField;
RhsField = AST_PopASTStack();
end
InputArgumentNames = SCI2Cflipud(InputArgumentNames);
InputArgumentScope = SCI2Cflipud(InputArgumentScope);
-disp(NInArg);
-
// -------------------------------------
// --- Generate the InArg structure. ---
@@ -114,7 +90,7 @@ for counteroutputargs = 1:NOutArg
OutArg(counteroutputargs).Name=OutputArgumentNames(counteroutputargs);
OutArg(counteroutputargs).Scope=OutputArgumentScope(counteroutputargs);
end
-disp(NOutArg);
+
// ------------------------
// --- Print Some Info. ---
diff --git a/2.3-1/macros/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib
index 7cb0b9df..4e309a25 100644
--- a/2.3-1/macros/ASTManagement/lib
+++ b/2.3-1/macros/ASTManagement/lib
Binary files differ