2 Copyright (c) 1999-2012 OPEN CASCADE SAS
4 The content of this file is subject to the Open CASCADE Technology Public
5 License Version 6.5 (the "License"). You may not use the content of this file
6 except in compliance with the License. Please obtain a copy of the License
7 at http://www.opencascade.org and read it completely before using this file.
9 The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 The Original Code and all software distributed under the License is
13 distributed on an "AS IS" basis, without warranty of any kind, and the
14 Initial Developer hereby disclaims all such warranties, including without
15 limitation, any warranties of merchantability, fitness for a particular
16 purpose or non-infringement. Please see the License for the specific terms
17 and conditions governing the rights and limitations under the License.
21 /* pdn PRO16162: do restart in order to restore after possible crash or wrong data
23 /*rln 10.01.99 - transmission of define's into this file
30 # include "recfile.ph"
34 Ce programme substitue au yyerror standard, qui fait "exit" (brutal !)
35 une action plus adaptee a un fonctionnement en process :
37 Affichage de la ligne qui a provoque l' erreur,
38 Preparation d'un eventuel appel suivant (vu qu on ne fait plus exit),
39 en pour le retour, on s'arrange pour lever une exception
40 (c-a-d qu on provoque un plantage)
42 Adaptation pour flex (flex autorise d avoir plusieurs lex dans un meme
43 executable) : les fonctions et variables sont renommees; et la
48 extern int steplineno;
50 extern void StepFile_Interrupt (char* nomfic); /* rln 13.09.00 port on HP*/
53 void steprestart(FILE *input_file);
56 void steperror (char *mess)
59 if (steplineno == lastno) return;
61 sprintf (newmess,"At line %d, %s",steplineno+1,mess);
67 StepFile_Interrupt(newmess);
70 /* But de ce mini-programme : appeler yyparse et si besoin preciser un
72 StepFile_Error redefinit yyerror pour ne pas stopper (s'y reporter)
75 extern FILE* stepin ; /* input de yyparse (executeur de lex-yacc) */
76 extern int steplineno; /* compteur de ligne lex (pour erreurs) */
79 /* Designation d'un fichier de lecture
80 (par defaut, c'est l'entree standard)
82 Appel : iflag = stepread_setinput ("...") ou (char[] ...) ;
83 stepread_setinput ("") [longueur nulle] laisse en standard
84 iflag retourne vaut 0 si c'est OK, 1 sinon
87 FILE* stepread_setinput (char* nomfic)
90 if (strlen(nomfic) == 0) return stepin ;
91 newin = fopen(nomfic,"r") ;
95 stepin = newin ; return newin ;
99 void stepread_endinput (FILE* infic, char* nomfic)
102 if (strlen(nomfic) == 0) return;
106 /* Lecture d'un fichier ia grammaire lex-yacc
107 Appel : i = stepread() ; i est la valeur retournee par yyparse
108 (0 si OK, 1 si erreur)
117 letat = stepparse() ;
122 int stepwrap () { return 1; }