0027342: STEP - support C++ streams for import / export
[occt.git] / src / StepFile / stepread.cxx
CommitLineData
68922bcc 1/*
2 Copyright (c) 1999-2014 OPEN CASCADE SAS
3
4 This file is part of Open CASCADE Technology software library.
5
6 This library is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License version 2.1 as published
8 by the Free Software Foundation, with special exception defined in the file
9 OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 distribution for complete text of the license and disclaimer of any warranty.
11
12 Alternatively, this file may be used under the terms of Open CASCADE
13 commercial license or contractual agreement.
14*/
15
16/*
17 pdn PRO16162: do restart in order to restore after possible crash or wrong data
18 rln 10.01.99 - transmission of define's into this file
19*/
20
21#include <stdlib.h>
22#include <stdio.h>
23#include <string.h>
24#include <iostream>
25#include "recfile.ph"
26
27void rec_debfile();
28void rec_finfile();
29
30/*
31 Lecture d'un fichier ia grammaire lex-yacc
32 Appel : i = stepread() ; i est la valeur retournee par yyparse
33 (0 si OK, 1 si erreur)
34*/
35
36int stepread(std::istream& theStream)
37{
38 int aLetat = 0;
39 rec_debfile();
40 step::scanner aScanner(&theStream);
41 aScanner.yyrestart(theStream);
42 step::parser aParser(&aScanner);
43 aLetat = aParser.parse();
44 rec_finfile();
45 return aLetat;
46}