OOFEM 3.0
Loading...
Searching...
No Matches
parser.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef parser_h
36#define parser_h
37
38#include "oofemcfg.h"
39#include "floatarray.h"
40
41namespace oofem {
42#define Parser_CMD_LENGTH 1024
43#define Parser_TBLSZ 23
44
56{
57public:
60 no_of_errors = 0;
61 for ( int i = 0; i < Parser_TBLSZ; i++ ) {
62 table [ i ] = 0;
63 }
64 }
66 reset();
67 }
68
69 double eval(const char *string, int &err);
70 void eval(const char *string, FloatArray& answer, const char* name, int &err);
71 void setVariableValue(const char *name, int indx, double value);
72
73 void reset();
74
75private:
82
85
86 struct name {
87 char *string;
89
90 int size = -1; // nonzero size indicates array context (and array size), zero scalar context, negative not yet defined
93 };
95 double number_value =0.0;
97 const char *parsedLine= nullptr;
98
99 name *look(const char *p, int ins = 0);
100 inline name *insert(const char *s) { return look(s, 1); }
101 void error(const char *s);
102 double expr(bool get);
103 double term(bool get);
104 double prim(bool get);
105 double agr(bool get);
107
108 double getVariableValue(const char *name, int indx);
109};
110} // end namespace oofem
111#endif // parser_h
name * insert(const char *s)
Definition parser.h:100
double term(bool get)
Definition parser.C:68
Token_value curr_tok
Definition parser.h:84
int no_of_errors
Definition parser.h:83
double agr(bool get)
Definition parser.C:238
void reset()
Definition parser.C:453
@ HEAVISIDE_FUNC
Definition parser.h:78
@ HEAVISIDE_FUNC1
Definition parser.h:78
double number_value
Definition parser.h:95
void error(const char *s)
double expr(bool get)
Definition parser.C:44
name * look(const char *p, int ins=0)
Definition parser.C:383
Token_value get_token()
Definition parser.C:261
name * table[Parser_TBLSZ]
Definition parser.h:94
double getVariableValue(const char *name, int indx)
Definition parser.C:494
char string_value[Parser_CMD_LENGTH]
Definition parser.h:96
const char * parsedLine
Definition parser.h:97
double prim(bool get)
Definition parser.C:113
#define OOFEM_EXPORT
Definition oofemcfg.h:7
#define Parser_CMD_LENGTH
Definition parser.h:42
#define Parser_TBLSZ
Definition parser.h:43
FloatArray arrayValue
Definition parser.h:92
double doubleValue
Definition parser.h:91

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011