Files
OCCT/src/StepFile/stepread.cxx
imn 68922bccc4 0027342: STEP - support C++ streams for import / export
- STEP low-level parser is converted to C++; required minimal version of flex is elevated to 2.5.37.
- Added possibility to import STEP from stream, see new method XSControl_Reader::ReadStream() (now implemented in STEP only).
- Parsers ported to win_flex_bison 2.5.23 (flex 2.6.4, bison 3.7.1)
- Added support of C++ flex and bison scanners in in CMake scripts
- Some code clean-up in StepFile and around (unused files and functions are eliminated)
- Option to read from stream is added in DRAW command testreadstep for testing ReadStream() function
- Added test bugs step bug27342
2020-09-28 10:46:04 +03:00

46 lines
1.3 KiB
C++

/*
Copyright (c) 1999-2014 OPEN CASCADE SAS
This file is part of Open CASCADE Technology software library.
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License version 2.1 as published
by the Free Software Foundation, with special exception defined in the file
OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
distribution for complete text of the license and disclaimer of any warranty.
Alternatively, this file may be used under the terms of Open CASCADE
commercial license or contractual agreement.
*/
/*
pdn PRO16162: do restart in order to restore after possible crash or wrong data
rln 10.01.99 - transmission of define's into this file
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include "recfile.ph"
void rec_debfile();
void rec_finfile();
/*
Lecture d'un fichier ia grammaire lex-yacc
Appel : i = stepread() ; i est la valeur retournee par yyparse
(0 si OK, 1 si erreur)
*/
int stepread(std::istream& theStream)
{
int aLetat = 0;
rec_debfile();
step::scanner aScanner(&theStream);
aScanner.yyrestart(theStream);
step::parser aParser(&aScanner);
aLetat = aParser.parse();
rec_finfile();
return aLetat;
}