/usr/share/netgen/libsrc/csg/csgparser.hpp is in netgen-headers 4.9.13.dfsg-8build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | #ifndef _CSGPARSER_HPP
#define _CSGPARSER_HPP
namespace netgen
{
enum TOKEN_TYPE
{
TOK_MINUS = '-', TOK_LP = '(', OK_RP = ')', TOK_LSP = '[', TOK_RSP = ']',
TOK_EQU = '=', TOK_COMMA = ',', TOK_SEMICOLON = ';',
TOK_NUM = 100, TOK_STRING, TOK_NAMED_SOLID, TOK_PRIMITIVE,
TOK_OR, TOK_AND, TOK_NOT,
TOK_SINGULAR, TOK_EDGE, TOK_POINT, TOK_FACE, TOK_IDENTIFY, TOK_CLOSESURFACES,
TOK_CLOSEEDGES, TOK_PERIODIC,
TOK_SOLID, TOK_RECO, TOK_TLO, TOK_CURVE2D, TOK_CURVE3D, TOK_BOUNDINGBOX,
TOK_BOUNDARYCONDITION, TOK_BOUNDARYCONDITIONNAME,
TOK_DEFINE, TOK_CONSTANT,
TOK_END };
struct kwstruct
{
TOKEN_TYPE kw;
const char * name;
};
enum PRIMITIVE_TYPE
{
TOK_SPHERE = 1, TOK_CYLINDER, TOK_PLANE, TOK_ELLIPTICCYLINDER,
TOK_ELLIPSOID, TOK_CONE,
TOK_ORTHOBRICK, TOK_POLYHEDRON,
TOK_TORUS,
TOK_TUBE, TOK_GENCYL, TOK_EXTRUSION, TOK_REVOLUTION,
TOK_TRANSLATE, TOK_MULTITRANSLATE, TOK_ROTATE, TOK_MULTIROTATE
};
struct primstruct
{
PRIMITIVE_TYPE kw;
const char * name;
};
class CSGScanner
{
TOKEN_TYPE token;
PRIMITIVE_TYPE prim_token;
double num_value;
string string_value;
int linenum;
istream * scanin;
public:
CSGScanner (istream & ascanin);
TOKEN_TYPE GetToken() const
{ return token; }
double GetNumValue() const
{ return num_value; }
const string & GetStringValue() const
{ return string_value; }
char GetCharValue() const
{ return string_value[0]; }
PRIMITIVE_TYPE GetPrimitiveToken() const
{ return prim_token; }
void ReadNext();
/*
CSGScanner & Parse (char ch);
CSGScanner & Parse (int & i);
CSGScanner & Parse (double & d);
CSGScanner & Parse (Point<3> & p);
CSGScanner & Parse (Vec<3> & p);
*/
void Error (const string & err);
};
CSGScanner & operator>> (CSGScanner & scan, char ch);
CSGScanner & operator>> (CSGScanner & scan, double & d);
CSGScanner & operator>> (CSGScanner & scan, int & i);
CSGScanner & operator>> (CSGScanner & scan, Point<3> & p);
CSGScanner & operator>> (CSGScanner & scan, Vec<3> & v);
}
#endif
|