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 --- macros/SymbolTable/ST_Set.sci | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 macros/SymbolTable/ST_Set.sci (limited to 'macros/SymbolTable/ST_Set.sci') diff --git a/macros/SymbolTable/ST_Set.sci b/macros/SymbolTable/ST_Set.sci new file mode 100644 index 00000000..778f91aa --- /dev/null +++ b/macros/SymbolTable/ST_Set.sci @@ -0,0 +1,49 @@ +function ST_Set(TBName,TBType,TBSize,TBValue,TBFindLike,TBDimension,SymbolTableFileName) +// function ST_Set(TBName,TBType,TBSize,TBValue,TBFindLike,TBDimension,SymbolTableFileName) +// ----------------------------------------------------------------- +// Set function for the symbol table. +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),7,7); + +// --- Load symbol table. --- +SCI2CSymbolTable = ST_Load(SymbolTableFileName); + +// --- Find symbol position (If exists). --- +[TBFlagfound,TBPosition] = ST_FindPos(TBName,SymbolTableFileName); + +if (TBFlagfound == 0) + TBPosition = max(size(SCI2CSymbolTable))+1; +end + +// --- Update symbol table. --- +SCI2CSymbolTable(TBPosition).Name = TBName; // string. +SCI2CSymbolTable(TBPosition).Type = TBType; // char. +SCI2CSymbolTable(TBPosition).Size = TBSize; // structure of two strings (Size(1) and Size(2)). +SCI2CSymbolTable(TBPosition).Value = TBValue; // int/real/complex number. %nan when the value is not available or isn't a scalar. +SCI2CSymbolTable(TBPosition).FindLike = TBFindLike; // int number. FindLike = 1, when the symbol comes from a find-like function. + // FindLike = -1 when the function is not find-like but it is making use of input arguments that are find-like. + // FindLike = 0 in all other cases. +SCI2CSymbolTable(TBPosition).Dimension = TBDimension; // int number. + +// --- Save symbol table. --- +ST_Save(SymbolTableFileName,SCI2CSymbolTable); + +endfunction -- cgit