diff options
Diffstat (limited to 'macros/ASTManagement')
-rw-r--r-- | macros/ASTManagement/AST_CheckCommonInOutArgs.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_CheckLastFunc.sci | 4 | ||||
-rw-r--r-- | macros/ASTManagement/AST_CheckLineLength.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_ExtractNameAndScope.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_GetFuncallPrm.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_GetPrecAndLhsArg.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_HandleEndGenFun.sci | 4 | ||||
-rw-r--r-- | macros/ASTManagement/AST_HandleHeader.sci | 8 | ||||
-rw-r--r-- | macros/ASTManagement/AST_HandleWhileStatem.sci | 5 | ||||
-rw-r--r-- | macros/ASTManagement/AST_ParseEqualStruct.sci | 12 | ||||
-rw-r--r-- | macros/ASTManagement/AST_ParseFuncallStruct.sci | 4 | ||||
-rw-r--r-- | macros/ASTManagement/AST_ParseIfExprStruct.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_ParseOperStruct.sci | 4 | ||||
-rw-r--r-- | macros/ASTManagement/AST_PopASTStack.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/AST_ReadASTHeader.sci | 10 | ||||
-rw-r--r-- | macros/ASTManagement/GenOutArgNames.sci | 2 | ||||
-rw-r--r-- | macros/ASTManagement/Operator2FunName.sci | 18 |
17 files changed, 43 insertions, 42 deletions
diff --git a/macros/ASTManagement/AST_CheckCommonInOutArgs.sci b/macros/ASTManagement/AST_CheckCommonInOutArgs.sci index 952514cc..8e3afdcf 100644 --- a/macros/ASTManagement/AST_CheckCommonInOutArgs.sci +++ b/macros/ASTManagement/AST_CheckCommonInOutArgs.sci @@ -82,7 +82,7 @@ if (ncommonstrings > 0) PrintStringInfo('SCI2CERROR: // The previous line must be rewritten as:',ReportFileName,'both','y'); PrintStringInfo('SCI2CERROR: function e = myfun(a,b,c,d) // Not Allowed',ReportFileName,'both','y'); PrintStringInfo(' ',ReportFileName,'both','y'); - SCI2Cerror(' '); + error(9999, 'SCI2CERROR: Found '+string(ncommonstrings)+' input/output 2-D arguments with the same name.'); end endfunction diff --git a/macros/ASTManagement/AST_CheckLastFunc.sci b/macros/ASTManagement/AST_CheckLastFunc.sci index 0fff6b22..508435b7 100644 --- a/macros/ASTManagement/AST_CheckLastFunc.sci +++ b/macros/ASTManagement/AST_CheckLastFunc.sci @@ -53,9 +53,9 @@ if ((SearchLevel == 0) & (LhsField == 'Lhs :')) while(LhsField ~= 'EndEqual') NLhsArg = NLhsArg + 1; if (LhsField == '<EOL>') - SCI2Cerror('Found <EOL> before EndEqual'); + error(9999, 'Found <EOL> before EndEqual'); elseif (LhsField == 'EndProgram') - SCI2Cerror('Found EndProgram before EndEqual'); + error(9999, 'Found EndProgram before EndEqual'); end if (LhsField == 'Operation') // if (LhsField == 'Operator: ins') diff --git a/macros/ASTManagement/AST_CheckLineLength.sci b/macros/ASTManagement/AST_CheckLineLength.sci index d74cf26b..3973b188 100644 --- a/macros/ASTManagement/AST_CheckLineLength.sci +++ b/macros/ASTManagement/AST_CheckLineLength.sci @@ -22,6 +22,8 @@ function AST_CheckLineLength(instring) // ------------------------------ SCI2CNInArgCheck(argn(2),1,1); +// TODO : Remove me + //if length(instring) > 77 // SCI2Cerror('Line too long: please reduce the length of the current line.'); //end diff --git a/macros/ASTManagement/AST_ExtractNameAndScope.sci b/macros/ASTManagement/AST_ExtractNameAndScope.sci index 7e71f75a..53830cfc 100644 --- a/macros/ASTManagement/AST_ExtractNameAndScope.sci +++ b/macros/ASTManagement/AST_ExtractNameAndScope.sci @@ -87,7 +87,7 @@ elseif (SCI2Cstrncmps1size(tagname(7),ASTField)) ArgName = '<empty>'; ArgScope = 'None'; else - SCI2Cerror('Argument specifier not found in the AST field: '+ASTField); + error(9999, 'Argument specifier not found in the AST field: '+ASTField); end endfunction diff --git a/macros/ASTManagement/AST_GetFuncallPrm.sci b/macros/ASTManagement/AST_GetFuncallPrm.sci index aa5ab62c..e7c1581c 100644 --- a/macros/ASTManagement/AST_GetFuncallPrm.sci +++ b/macros/ASTManagement/AST_GetFuncallPrm.sci @@ -48,7 +48,7 @@ elseif (ASTFunType=='Operation') elseif (ASTFunType=='Equal') [FunctionName,InArg,NInArg,OutArg,NOutArg] = AST_ParseEqualStruct(FileInfo,SharedInfo); else - SCI2CerrorFile('Unknown Function type: '+ASTFunType+'.',ReportFileName); + error(9999, 'Unknown Function type: '+ASTFunType+'.'); end endfunction diff --git a/macros/ASTManagement/AST_GetPrecAndLhsArg.sci b/macros/ASTManagement/AST_GetPrecAndLhsArg.sci index feb8a6ec..07ad3b0a 100644 --- a/macros/ASTManagement/AST_GetPrecAndLhsArg.sci +++ b/macros/ASTManagement/AST_GetPrecAndLhsArg.sci @@ -88,7 +88,7 @@ if (NLhsArg > 0) // #RNU_RES_E SharedInfo.SkipNextEqual = 1; // 1 = the next equal in the AST will not produce C code. if (NLhsArg ~= NOutArg) - SCI2CerrorFile('NLhsArg='+string(NLhsArg)+' must be equal to NOutArg='+string(NOutArg)+'.',ReportFileName); + error(9999, 'NLhsArg='+string(NLhsArg)+' must be equal to NOutArg='+string(NOutArg)+'.'); end else // #RNU_RES_B diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci index 2c3bbfb9..69fbb82e 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -92,14 +92,14 @@ elseif (ASTFunName == 'global') PrintStringInfo('SCI2CERROR: global var1; //ALLOWED',ReportFileName,'both','y'); PrintStringInfo('SCI2CERROR: global var2; //ALLOWED',ReportFileName,'both','y'); PrintStringInfo(' ',ReportFileName,'both','y'); - SCI2Cerror(' '); + error(9999, 'SCI2CERROR: Multiple declaration of global variables is not allowed.'); end if (NOutArg ~= 1) PrintStringInfo(' ',ReportFileName,'both','y'); PrintStringInfo('SCI2CERROR: Unexpected number of output arguments for global function.',ReportFileName,'both','y'); PrintStringInfo('SCI2CERROR: Please report this error to: http://forge.scilab.org/index.php/p/scilab2c/issues/',ReportFileName,'both','y'); PrintStringInfo(' ',ReportFileName,'both','y'); - SCI2Cerror(' '); + error(9999, 'SCI2CERROR: Unexpected number of output arguments for global function.'); end end diff --git a/macros/ASTManagement/AST_HandleHeader.sci b/macros/ASTManagement/AST_HandleHeader.sci index 7439b784..661c740f 100644 --- a/macros/ASTManagement/AST_HandleHeader.sci +++ b/macros/ASTManagement/AST_HandleHeader.sci @@ -30,8 +30,8 @@ ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; FunctionName = ASTHeader.Name; if (mtlb_strcmp(ASTHeader.Name,SharedInfo.NextSCIFunName) == %F) - SCI2CerrorFile('Very strange! AST Name field ""'+ASTHeader.Name+... - '""is different from function name ""'+SharedInfo.NextSCIFunName+'"".',ReportFileName); + error(9999, 'Very strange! AST Name field ""'+ASTHeader.Name+... + '""is different from function name ""'+SharedInfo.NextSCIFunName+'"".'); end // --------------------------- // --- End Initialization. --- @@ -136,7 +136,7 @@ if (NInArgDat == NInArg) end end else - SCI2CerrorFile('Number of input arguments specified in AST is different from the number specified in .dat file.',ReportFileName); + error(9999, 'Number of input arguments specified in AST is different from the number specified in .dat file.'); end @@ -149,7 +149,7 @@ else PrintStringInfo('N. of output arguments found in the AST: '+string(NOutArg),ReportFileName,'both','y'); PrintStringInfo('N. of output arguments found in the call (FunInfo structure): '+string(SharedInfo.CurrentFunInfo.NOutArg),ReportFileName,'both','y'); //#RNU_RES_E - SCI2CerrorFile('Number of output arguments specified in AST is different from the number specified in .dat file.',ReportFileName); + error(9999, 'Number of output arguments specified in AST is different from the number specified in .dat file.'); end //#RNU_RES_B //NUT: using approach 1: Setting for input and output arguments symbolic sizes. diff --git a/macros/ASTManagement/AST_HandleWhileStatem.sci b/macros/ASTManagement/AST_HandleWhileStatem.sci index 45d434f0..79fb516d 100644 --- a/macros/ASTManagement/AST_HandleWhileStatem.sci +++ b/macros/ASTManagement/AST_HandleWhileStatem.sci @@ -86,8 +86,7 @@ if(SharedInfo.WhileExpr.CondVar == '') PrintStringInfo('SCI2CERROR: Expected a variable or number in the AST while expression.','','stdout','y'); PrintStringInfo('SCI2CERROR: Report this error to http://forge.scilab.org/index.php/p/scilab2c/issues/.','','stdout','y'); PrintStringInfo(' ',ReportFileName,'both','y'); - SCI2Cerror(' '); - SCI2Cerror('Expected a conditional variable in the while expression'); + error(9999, 'Expected a conditional variable in the while expression'); end SharedInfo.WhileExpr.CondVar = ArgName; @@ -98,7 +97,7 @@ if(SharedInfo.WhileExpr.CondVar == '') AST_PushASTStack(Pop1); elseif (SharedInfo.WhileExpr.DimCondVar > 0) - SCI2CerrorFile('Cannot manage while with matrix conditions',ReportFileName); + error(9999, 'Cannot manage while with matrix conditions'); end SharedInfo = C_WhileExpression(FileInfo,SharedInfo); diff --git a/macros/ASTManagement/AST_ParseEqualStruct.sci b/macros/ASTManagement/AST_ParseEqualStruct.sci index 3d917682..fa76a01d 100644 --- a/macros/ASTManagement/AST_ParseEqualStruct.sci +++ b/macros/ASTManagement/AST_ParseEqualStruct.sci @@ -60,9 +60,9 @@ while (LhsField ~= 'Lhs :') [OutputArgumentNames(NOutArg),OutputArgumentScope(NOutArg)] = AST_ExtractNameAndScope(LhsField); LhsField = AST_PopASTStack(); if (LhsField == 'Expression:') - SCI2Cerror('Found Expression: before Lhs'); + error(9999, 'Found Expression: before Lhs'); elseif (LhsField == 'Equal') - SCI2Cerror('Found Equal before Lhs'); + error(9999, 'Found Equal before Lhs'); end end OutputArgumentNames = SCI2Cflipud(OutputArgumentNames); @@ -79,7 +79,7 @@ while (ExprField ~= 'Expression:') [InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(ExprField); ExprField = AST_PopASTStack(); if (ExprField == 'Equal') - SCI2Cerror('Found Equal before Lhs'); + error(9999, 'Found Equal before Lhs'); end end InputArgumentNames = SCI2Cflipud(InputArgumentNames); @@ -92,7 +92,7 @@ InputArgumentScope = SCI2Cflipud(InputArgumentScope); //#RNU_RES_E FunctionName = AST_PopASTStack(); if (FunctionName ~= 'Equal') then - SCI2Cerror('Problems with Equal, Expected Equal tag.'); + error(9999, 'Problems with Equal, Expected Equal tag.'); end FunctionName = 'OpEqual'; @@ -138,7 +138,7 @@ if (SharedInfo.Equal.Nins > 0) //#RNU_RES_E end if (NInArg ~= SharedInfo.Equal.Nins) - SCI2CerrorFile('Number of input arguments must be equal to number of ins functions.',ReportFileName); + error(9999, 'Number of input arguments must be equal to number of ins functions.'); end else //#RNU_RES_B @@ -161,7 +161,7 @@ else //#RNU_RES_E end if (NInArg ~= NOutArg) - SCI2CerrorFile('Number of input arguments must be equal to number of output arguments.',ReportFileName); + error(9999, 'Number of input arguments must be equal to number of output arguments.'); end end diff --git a/macros/ASTManagement/AST_ParseFuncallStruct.sci b/macros/ASTManagement/AST_ParseFuncallStruct.sci index 5840c05e..647a70d7 100644 --- a/macros/ASTManagement/AST_ParseFuncallStruct.sci +++ b/macros/ASTManagement/AST_ParseFuncallStruct.sci @@ -62,9 +62,9 @@ while (RhsField ~= 'Rhs :') [InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField); RhsField = AST_PopASTStack(); if (RhsField == '#lhs :') - SCI2Cerror('Found #lhs before Rhs'); + error(9999, 'Found #lhs before Rhs'); elseif (RhsField == 'Funcall :') - SCI2Cerror('Found Funcall before Rhs'); + error(9999, 'Found Funcall before Rhs'); end end if (stripblanks(InputArgumentNames(NInArg)) == '<empty>') diff --git a/macros/ASTManagement/AST_ParseIfExprStruct.sci b/macros/ASTManagement/AST_ParseIfExprStruct.sci index 12ad077a..a7da0128 100644 --- a/macros/ASTManagement/AST_ParseIfExprStruct.sci +++ b/macros/ASTManagement/AST_ParseIfExprStruct.sci @@ -76,7 +76,7 @@ elseif (ASTIfExpType=='elseif') flagendpop = 1; end else - SCI2CerrorFile('Unknown ASTIfExpType ""'+ASTIfExpType+'"".',ReportFileName); + error(9999, 'Unknown ASTIfExpType ""'+ASTIfExpType+'"".'); end while (flagendpop == 0) diff --git a/macros/ASTManagement/AST_ParseOperStruct.sci b/macros/ASTManagement/AST_ParseOperStruct.sci index 179c5578..a77317bd 100644 --- a/macros/ASTManagement/AST_ParseOperStruct.sci +++ b/macros/ASTManagement/AST_ParseOperStruct.sci @@ -72,7 +72,7 @@ while (RhsField ~= 'Operands:') [InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField); RhsField = AST_PopASTStack(); if (RhsField == 'Operation') - SCI2Cerror('Found Operation before Rhs'); + error(9999, 'Found Operation before Rhs'); end end @@ -90,7 +90,7 @@ InputArgumentScope = SCI2Cflipud(InputArgumentScope); //#RNU_RES_E OperationField = AST_PopASTStack(); if (OperationField ~= 'Operation') then - SCI2Cerror('Problems with Operation, Expected Operation tag.'); + error(9999, 'Problems with Operation, Expected Operation tag.'); end // -------------------------------------------- diff --git a/macros/ASTManagement/AST_PopASTStack.sci b/macros/ASTManagement/AST_PopASTStack.sci index bff1d9fa..34857499 100644 --- a/macros/ASTManagement/AST_PopASTStack.sci +++ b/macros/ASTManagement/AST_PopASTStack.sci @@ -26,7 +26,7 @@ global StackPosition; global STACKDEDUG; if StackPosition == 1 - SCI2Cerror('Stack empty. Cannot pop from stack.'); + error(9999, 'Stack empty. Cannot pop from stack.'); end stackelement = SCI2CSTACK(StackPosition,1); diff --git a/macros/ASTManagement/AST_ReadASTHeader.sci b/macros/ASTManagement/AST_ReadASTHeader.sci index 3df6cd28..7a52b1f2 100644 --- a/macros/ASTManagement/AST_ReadASTHeader.sci +++ b/macros/ASTManagement/AST_ReadASTHeader.sci @@ -38,7 +38,7 @@ if STACKDEDUG == 1 disp('Read AST Line: '+treeline); end if (SCI2Cstrncmps1size('Program',treeline) == %F) - SCI2CerrorFile('Expected ""Program"" label in the AST',ReportFileName); + error(9999, 'Expected ""Program"" label in the AST'); end tline = mgetl(fidAST,1); @@ -48,7 +48,7 @@ if STACKDEDUG == 1 disp('Read AST Line: '+treeline); end if (SCI2Cstrncmps1size('Name : ',treeline) == %F) - SCI2CerrorFile('Expected ""Name : "" label in the AST',ReportFileName); + error(9999, 'Expected ""Name : "" label in the AST'); else ASTHeader.Name = stripblanks(part(treeline,length('Name : ')+1:length(treeline))); end @@ -60,7 +60,7 @@ if STACKDEDUG == 1 disp('Read AST Line: '+treeline); end if (SCI2Cstrncmps1size('Outputs: ',treeline) == %F) - SCI2CerrorFile('Expected ""Outputs: "" label in the AST',ReportFileName); + error(9999, 'Expected ""Outputs: "" label in the AST'); else ASTHeader.Outputs = stripblanks(part(treeline,length('Outputs: ')+1:length(treeline))); end @@ -72,7 +72,7 @@ if STACKDEDUG == 1 disp('Read AST Line: '+treeline); end if (SCI2Cstrncmps1size('Inputs : ',treeline) == %F) - SCI2CerrorFile('Expected ""Inputs : "" label in the AST',ReportFileName); + error(9999, 'Expected ""Inputs : "" label in the AST'); else ASTHeader.Inputs = stripblanks(part(treeline,length('Inputs : ')+1:length(treeline))); end @@ -84,7 +84,7 @@ if STACKDEDUG == 1 disp('Read AST Line: '+treeline); end if (SCI2Cstrncmps1size('Statements ',treeline) == %F) - SCI2CerrorFile('Expected ""Statements "" label in the AST',ReportFileName); + error(9999, 'Expected ""Statements "" label in the AST'); end endfunction diff --git a/macros/ASTManagement/GenOutArgNames.sci b/macros/ASTManagement/GenOutArgNames.sci index d31d4ca5..0e683835 100644 --- a/macros/ASTManagement/GenOutArgNames.sci +++ b/macros/ASTManagement/GenOutArgNames.sci @@ -49,7 +49,7 @@ if (NLhsArg > 0) PrintStringInfo('Using Equal Lhs names.',ReportFileName,'file','y'); //#RNU_RES_E if (NLhsArg ~= NOutArg) - SCI2CerrorFile('NLhsArg='+string(NLhsArg)+' must be equal to NOutArg='+string(NOutArg)+'.',ReportFileName); + error(9999, 'NLhsArg='+string(NLhsArg)+' must be equal to NOutArg='+string(NOutArg)+'.'); end for counteroutputargs = 1:NOutArg OutArg(counteroutputargs).Name=LhsArg(counteroutputargs).Name; diff --git a/macros/ASTManagement/Operator2FunName.sci b/macros/ASTManagement/Operator2FunName.sci index 1ca5825b..1aa934cb 100644 --- a/macros/ASTManagement/Operator2FunName.sci +++ b/macros/ASTManagement/Operator2FunName.sci @@ -41,20 +41,20 @@ elseif (OperatorName == '.*') FunName = FuncPrefix+'DotStar'+FuncSuffix;
elseif (OperatorName == '*.')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == '.*.')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == '/')
FunName = FuncPrefix+'Slash'+FuncSuffix;
elseif (OperatorName == './')
FunName = FuncPrefix+'DotSlash'+FuncSuffix;
elseif (OperatorName == '/.')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == './.')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == '.\')
FunName = FuncPrefix+'DotBackSlash'+FuncSuffix;
elseif (OperatorName == '\')
@@ -63,13 +63,13 @@ elseif (OperatorName == '\') FunName = FuncPrefix+'BackSlash'+FuncSuffix;
elseif (OperatorName == '.\')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == '\.')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == '.\.')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
elseif (OperatorName == '^')
FunName = FuncPrefix+'Hat'+FuncSuffix;
elseif (OperatorName == '.^')
@@ -110,10 +110,10 @@ elseif (OperatorName == 'ext') FunName = 'OpExt';
elseif (OperatorName == 'cceol')
PrintStringInfo('SCI2CERROR: Operator ""'+OperatorName+'"" not supported.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Operator ""'+OperatorName+'"" not supported.');
else
PrintStringInfo('SCI2CERROR: Unknown Operator ""'+OperatorName+'.','','stout','y');
- SCI2Cerror(' ');
+ error(9999, 'SCI2CERROR: Unknown Operator ""'+OperatorName+'.');
end
endfunction
|