symbolOpNode.h
Ir a la documentación de este archivo.
1 //symbolOpNode.h
2 //-------------------------------------------------------------------------------------------
3 /*
4  * Fco. Javier Bohórquez Ogalla
5  * 75766599-E
6  * Puerto Real (Cádiz)
7  * powersgame@gmail.com
8  */
9 //-------------------------------------------------------------------------------------------
10 
11 //-------------------------------------------------------------------------------------------
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
26  * MA 02110-1301, USA.
27  */
28 //-------------------------------------------------------------------------------------------
29 
30 //-------------------------------------------------------------------------------------------
40 //-------------------------------------------------------------------------------------------
41 
42 //-------------------------------------------------------------------------------------------
43 #ifndef _RUN_OPERATORS_SYMBOLOPNODE_
44 #define _RUN_OPERATORS_SYMBOLOPNODE_
45 
46 #include "../tree/typeNode.h"
47 //-------------------------------------------------------------------------------------------
48 
49 //-------------------------------------------------------------------------------------------
65 class asigNode :
66  public nexpNode {
67  public:
74  asigNode (runNode* node1, runNode* node2);
82  void run ();
94  void runLevel ();
99  void setValue (runNode* node);
104  runNode* getLeft ();
109  runNode* getRight ();
114  bool is_runlist () const;
115  private:
116  bool isRefNode (runNode* node);
117  vector<nexpNode*> nexp_;
118  runNode *node1_, *node2_;
119 };
120 //----------------------------------------------------------------------
121 
122 //----------------------------------------------------------------------
133 class asigrefNode :
134  public nexpNode {
135  public:
142  asigrefNode (runNode* node1, runNode* node2);
149  void run ();
154  void setValue (runNode* node);
155  private:
156  runNode *node1_, *node2_;
157 };
158 //----------------------------------------------------------------------
159 
160 //----------------------------------------------------------------------
168 class getRefNode :
169  public nexpNode {
170  public:
175  getRefNode (runNode* node);
180  void run ();
181  private:
182  runNode *node_;
183 };
184 //----------------------------------------------------------------------
185 
186 //----------------------------------------------------------------------
198 class getNode:
199  public nexpNode {
200  public:
207  getNode (runNode* array, runNode* key, bool resolv = true);
213  void run ();
218  void noderef (runNode* node);
223  void setFunctionCall ();
230  bool getFunctionCall ();
235  runNode* getKey ();
236  private:
237  void run_case_array (arrayNode* array, runNode* key);
238  void run_case_str (strNode* str, runNode* num);
239  void setNodeValue (arrayNode *array, runNode * key);
240  void setDefaultValue (symbols *map, runNode * key);
241  refNode * noderefAnidate ();
242  runNode * array_, *key_;
243  short unsigned int type_;
244  bool exec_, is_this_node_, resolv_, is_const_, functioncall_;
245  getNode *next_;
246 };
247 //----------------------------------------------------------------------
248 
249 //----------------------------------------------------------------------
266  public runNode {
267  public:
272  void run ();
273 };
274 //----------------------------------------------------------------------
275 
276 //----------------------------------------------------------------------
287  public nexpNode {
288  public:
294  getNode_strInterface (stringNode* node, bool is_const = false);
299  void noderef (runNode* node);
304  runNode* nodeval () const;
310  int getn () const;
316  void setn ( int n);
321  void run ();
322  private:
323  string* strref_;
324  runNode* str_;
325  int refn_;
326  bool is_const_;
327 };
328 //----------------------------------------------------------------------
329 
330 //----------------------------------------------------------------------
339 class getEnvNode : public stringNode {
340  public:
345  getEnvNode (runNode* node);
352  void run ();
353  private:
354  runNode *node_;
355 };
356 //----------------------------------------------------------------------
357 
358 //----------------------------------------------------------------------
366 class getclassNode : public stringNode {
367  public:
372  getclassNode (runNode* node);
378  void run ();
379  private:
380  runNode *node_;
381 };
382 //-------------------------------------------------------------------------------------------
383 
384 //-------------------------------------------------------------------------------------------
385 #endif
386 //-------------------------------------------------------------------------------------------
387 //Fco. Javier Bohórquez Ogalla
Nodo cadena de caracteres.
Definition: typeNode.h:184
Nodo asignación.
Definition: symbolOpNode.h:65
int getn() const
Definition: symbolOpNode.cpp:617
void run()
Definition: symbolOpNode.cpp:174
static runNode * resolv(runNode *node)
Definition: expNode.cpp:211
void run()
Definition: symbolOpNode.cpp:552
asigrefNode(runNode *node1, runNode *node2)
Definition: symbolOpNode.cpp:125
getRefNode(runNode *node)
Definition: symbolOpNode.cpp:172
void run()
Definition: symbolOpNode.cpp:205
void noderef(runNode *node)
Definition: symbolOpNode.cpp:572
Nodo operador de acceso a final de secuencia.
Definition: symbolOpNode.h:265
Nodo interfaz de acceso a cadena de caracteres.
Definition: symbolOpNode.h:286
Nodo operador obtener clase.
Definition: symbolOpNode.h:366
getclassNode(runNode *node)
Definition: symbolOpNode.cpp:652
void runLevel()
Definition: symbolOpNode.cpp:71
Tabla de símbolos.
Definition: symbols.h:65
void run()
Definition: symbolOpNode.cpp:626
void setValue(runNode *node)
Definition: symbolOpNode.cpp:97
getNode_strInterface(stringNode *node, bool is_const=false)
Definition: symbolOpNode.cpp:548
void setn(int n)
Definition: symbolOpNode.cpp:613
Nodo array.
Definition: typeNode.h:403
Nodo ejecutable.
Definition: runTree.h:123
void run()
Definition: symbolOpNode.cpp:654
runNode * getKey()
Definition: symbolOpNode.cpp:528
void run()
Definition: symbolOpNode.cpp:127
void run()
Definition: symbolOpNode.cpp:42
bool getFunctionCall()
Definition: symbolOpNode.cpp:514
asigNode(runNode *node1, runNode *node2)
Definition: symbolOpNode.cpp:40
Node operador acceso a variable de entorno.
Definition: symbolOpNode.h:339
void setFunctionCall()
Definition: symbolOpNode.cpp:510
Nodo asignación.
Definition: symbolOpNode.h:133
getNode(runNode *array, runNode *key, bool resolv=true)
Definition: symbolOpNode.cpp:203
Nodo de acceso.
Definition: symbolOpNode.h:198
void run()
Definition: symbolOpNode.cpp:539
Nodo operador obtener referecia.
Definition: symbolOpNode.h:168
void setValue(runNode *node)
Definition: symbolOpNode.cpp:156
getEnvNode(runNode *node)
Definition: symbolOpNode.cpp:624
Nodo referencia.
Definition: runTree.h:279
Nodos cadenas de texto.
Definition: expNode.h:418
runNode * getRight()
Definition: symbolOpNode.cpp:114
void noderef(runNode *node)
Definition: symbolOpNode.cpp:418
bool is_runlist() const
Definition: symbolOpNode.cpp:118
runNode * getLeft()
Definition: symbolOpNode.cpp:110
Nodo expresión de tipo no definido.
Definition: expNode.h:164
runNode * nodeval() const
Definition: symbolOpNode.cpp:558