]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Fri, 5 Nov 1999 18:28:10 +0000 (18:28 +0000)
committercas <cas@opencascade.com>
Fri, 5 Nov 1999 18:28:10 +0000 (18:28 +0000)
src/EDL/EDL.cxx
src/EDL/EDL.lex
src/EDL/EDL.yacc
src/EDL/EDL_Interpretor.cxx

index 765e1637588a34cd29d47d98bca870ef6e62b0cc..598f266b99652a8666e9f5c9805cd024d08c2438 100755 (executable)
@@ -23,7 +23,7 @@ Standard_EXPORT void EDL_SetErrorMsgHandler(void (*aMsgHandler) (Standard_CStrin
 void EDL::PrintError(const EDL_Error anError, const Standard_CString anArg)
 {
   char *format;
-  char *errortext;
+  char *errortext = "";
 
   if (EDLlineno >= 0) {
     format = "%s : line %d : %s%s\n";
@@ -55,6 +55,8 @@ void EDL::PrintError(const EDL_Error anError, const Standard_CString anArg)
                   break;
   case EDL_TOOMANYINCLUDELEVEL: errortext = "Too many include levels : ";
                   break;
+  case EDL_FILENOTFOUND:  errortext = "File not found : ";
+                   break;
   }
 
   if(!EDL_ErrorMsgHandler) {
index 01c23a9291ca808d68e06c85e0ff0d812459ba41..fd6eb611a79eb1a12262d79d5359bb27e20d06f6 100755 (executable)
@@ -2,20 +2,23 @@
 %{
 #include <string.h>
 #include <stdio.h>
+#ifdef WNT
+# include <io.h>
+#else
+# include <unistd.h>
+#endif  /* WNT */
 #define yylval EDLlval
 #include <edl_rule.h>
 #include <EDL.tab.h>
 
+#ifndef YY_NO_UNPUT
+# define YY_NO_UNPUT
+#endif  /* YY_NO_UNPUT */
+
 #define MAX_CHAR     256              /* The limit of a identifier.  */
 #define MAX_STRING   (MAX_CHAR * 10)  /* The limit of a string.      */
 #define MAX_COMMENT  (MAX_CHAR * 300) /* The limit of comment line   */
 
-static char identifier[MAX_CHAR +1];
-static char integer   [MAX_CHAR +1];
-static char real      [MAX_CHAR +1];
-static char literal   [MAX_CHAR +1];
-static char string    [MAX_STRING +1];
-
 char  FileName[11][256];
 FILE *FileDesc[10];
 int   LineStack[10];
@@ -81,12 +84,12 @@ is                                { if (VerboseMode && edl_must_execute()) print
 @unset                            { if (VerboseMode && edl_must_execute()) printf("%d. @unset ",EDLlineno); return(UNSET); }
 @ifdefined                        { if (VerboseMode && edl_must_execute()) printf("%d. @ifdefined ",EDLlineno); return(IFDEFINED); }
 @ifnotdefined                     { if (VerboseMode && edl_must_execute()) printf("%d. @ifnotdefined ",EDLlineno); return(IFNOTDEFINED); }
-defined                           { if (VerboseMode && edl_must_execute()) printf(" defined ",EDLlineno); return(INSTRDEFINED); }
-notdefined                           { if (VerboseMode && edl_must_execute()) printf(" notdefined ",EDLlineno); return(INSTRNOTDEFINED); }
+defined                           { if (VerboseMode && edl_must_execute()) printf("%d. defined ",EDLlineno); return(INSTRDEFINED); }
+notdefined                           { if (VerboseMode && edl_must_execute()) printf("%d. notdefined ",EDLlineno); return(INSTRNOTDEFINED); }
 @iffile                           { if (VerboseMode && edl_must_execute()) printf("%d. @iffile ",EDLlineno); return(IFFILE); }
 @ifnotfile                        { if (VerboseMode && edl_must_execute()) printf("%d. @ifnotfile ",EDLlineno); return(IFNOTFILE); }
-file                            { if (VerboseMode && edl_must_execute()) printf(" file ",EDLlineno); return(INSTRFILE); }
-notfile                         { if (VerboseMode && edl_must_execute()) printf(" notfile ",EDLlineno); return(INSTRNOTFILE); }
+file                            { if (VerboseMode && edl_must_execute()) printf("%d file ",EDLlineno); return(INSTRFILE); }
+notfile                         { if (VerboseMode && edl_must_execute()) printf("%d notfile ",EDLlineno); return(INSTRNOTFILE); }
 @if                               { if (VerboseMode && edl_must_execute()) printf("%d. @if ",EDLlineno); return(IF); }
 then                              { if (VerboseMode && edl_must_execute()) printf(" then\n"); return(THEN); }
 @else                             { if (VerboseMode && edl_must_execute()) printf("@else\n"); return(ELSE); }
@@ -138,7 +141,6 @@ void EDL_SetFile()
 /* we need this for '@uses' clause */
 int EDLwrap()
 {
-  char c[2];
   edlstring _currentFile;
 
   if (numFileDesc < 0) {
index 987afd74dc6c235308a55a8d509d3cb912252170..a32f710cb5cf110221653e35dffe129e77245cf4 100755 (executable)
@@ -1,11 +1,14 @@
 %{
 #include <stdio.h>
+#include <stdlib.h>
 /* all parser must define this variable */
 
 #define yyv EDLv
 
+extern int  EDLlex();
+extern void EDLerror ();
 extern FILE *FileDesc[];
-extern numFileDesc;
+extern int numFileDesc;
 extern FILE *EDLin;
 /* extern int edl_must_execute(); */
 
index d8527c7927d0e5ac5e813a0124edb39d79b347cd..5788f7e73b7a8e78ae7afe238c40dc656a886d5d 100755 (executable)
@@ -24,8 +24,8 @@ extern "C" {
 #endif
 
 
-extern "C" {EDLparse();}
-extern "C" {EDLlex();}
+extern "C" {int EDLparse();}
+extern "C" {int EDLlex();}
 extern "C" {void EDL_SetFile();}
 
 #ifndef WNT
@@ -33,13 +33,13 @@ extern FILE *EDLin;
 extern int   EDLlineno;
 extern char *EDLtext;
 extern char  FileName[][256];
-extern numFileDesc;
+extern int   numFileDesc;
 #else
 extern "C" FILE *EDLin;
 extern "C" int   EDLlineno;
 extern "C" char *EDLtext;
 extern "C" char  FileName[][256];
-extern "C" numFileDesc;
+extern "C" int   numFileDesc;
 #endif  // WNT
 
 extern "C" {
@@ -136,8 +136,7 @@ EDL_Error EDL_Interpretor::Parse(const Standard_CString aFile)
 {
   GlobalInter = this;
   Standard_Boolean IsFound  = Standard_False;
-  Standard_Integer DirCount = 1,
-                   LenName  = strlen(aFile);
+  Standard_Integer DirCount = 1;
 
   Handle(TColStd_HSequenceOfAsciiString) IncludeDirectory = GlobalInter->GetIncludeDirectory();
   
@@ -145,7 +144,7 @@ EDL_Error EDL_Interpretor::Parse(const Standard_CString aFile)
     FILE *fic = 0L;
     DirCount  = 1;
 
-    if (fic = fopen(aFile,"r")) {
+    if (   (  fic = fopen ( aFile, "r" )  ) != NULL   ) {
       IsFound = Standard_True;
     }
 
@@ -162,7 +161,7 @@ EDL_Error EDL_Interpretor::Parse(const Standard_CString aFile)
       if ( GetFileAttributes(tmpName) != 0xFFFFFFFF ) 
 #endif
       {
-       if (fic = fopen(tmpName,"r")) {
+       if (   (  fic = fopen ( tmpName, "r" )  ) != NULL   ) {
          IsFound = Standard_True;
        }
       }
@@ -359,8 +358,7 @@ Standard_Boolean EDL_Interpretor::IsFile(const Standard_CString aFileName) const
     TCollection_AsciiString  fname(aFileName);
     
     Standard_Boolean IsFound  = Standard_False;
-    Standard_Integer DirCount = 1,
-                     LenName  = fname.Length();
+    Standard_Integer DirCount = 1;
 
     Handle(TColStd_HSequenceOfAsciiString) IncludeDirectory = GetIncludeDirectory();
 
@@ -1661,12 +1659,12 @@ void edl_close_file(const edlstring varname)
 #ifndef WNT
   extern FILE *FileDesc[];
   extern int   LineStack[];
-  extern numFileDesc;
+  extern int   numFileDesc;
   extern FILE *EDLin;
 #else
   extern "C" FILE *FileDesc[];
   extern "C" int   LineStack[];
-  extern "C" numFileDesc;
+  extern "C" int   numFileDesc;
   extern "C" FILE *EDLin;
 #endif  // WNT
 
@@ -1691,8 +1689,7 @@ void edl_uses_var(const edlstring var)
 void edl_uses(const edlstring filename) 
 {
   Standard_Boolean IsFound  = Standard_False;
-  Standard_Integer DirCount = 1,
-                   LenName  = filename.length;
+  Standard_Integer DirCount = 1;
 
   Handle(TColStd_HSequenceOfAsciiString) IncludeDirectory = GlobalInter->GetIncludeDirectory();