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";
break;
case EDL_TOOMANYINCLUDELEVEL: errortext = "Too many include levels : ";
break;
+ case EDL_FILENOTFOUND: errortext = "File not found : ";
+ break;
}
if(!EDL_ErrorMsgHandler) {
%{
#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];
@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); }
/* we need this for '@uses' clause */
int EDLwrap()
{
- char c[2];
edlstring _currentFile;
if (numFileDesc < 0) {
%{
#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(); */
#endif
-extern "C" {EDLparse();}
-extern "C" {EDLlex();}
+extern "C" {int EDLparse();}
+extern "C" {int EDLlex();}
extern "C" {void EDL_SetFile();}
#ifndef WNT
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" {
{
GlobalInter = this;
Standard_Boolean IsFound = Standard_False;
- Standard_Integer DirCount = 1,
- LenName = strlen(aFile);
+ Standard_Integer DirCount = 1;
Handle(TColStd_HSequenceOfAsciiString) IncludeDirectory = GlobalInter->GetIncludeDirectory();
FILE *fic = 0L;
DirCount = 1;
- if (fic = fopen(aFile,"r")) {
+ if ( ( fic = fopen ( aFile, "r" ) ) != NULL ) {
IsFound = Standard_True;
}
if ( GetFileAttributes(tmpName) != 0xFFFFFFFF )
#endif
{
- if (fic = fopen(tmpName,"r")) {
+ if ( ( fic = fopen ( tmpName, "r" ) ) != NULL ) {
IsFound = Standard_True;
}
}
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();
#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
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();