yast2-core
YStatement.h
Go to the documentation of this file.
1 /*---------------------------------------------------------*- c++ -*---\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: YStatement.h
14 
15  Author: Klaus Kaempf <kkaempf@suse.de>
16  Stanislav Visnovsky <visnov@suse.cz>
17  Maintainer: Stanislav Visnovsky <visnov@suse.cz>
18 
19 /-*/
20 // -*- c++ -*-
21 
22 #ifndef YStatement_h
23 #define YStatement_h
24 
25 #include <string>
26 using std::string;
27 
28 #include "ycp/YCode.h"
29 #include "ycp/SymbolTable.h"
30 #include "ycp/YSymbolEntry.h"
31 #include "ycp/Import.h"
32 #include "ycp/ycpless.h"
33 
34 class YBlock; // forward declaration for YDo, YRepeat
35 
36 //-------------------------------------------------------------------
37 
38 // FIXME bad inheritance
59 
60 //-------------------------------------------------------------------
65 class YStatement : public YCode
66 {
68  int m_line; // line number
69 public:
70  YStatement (int line = 0);
72  ~YStatement () {};
73  virtual string toString () const;
74  std::ostream & toStream (std::ostream & str) const;
75  std::ostream & toXml (std::ostream & str, int indent ) const;
77  virtual bool isStatement () const { return true; }
78  int line () const { return m_line; };
79  virtual YCPValue evaluate (bool cse = false);
80  constTypePtr type () const { return Type::Void; };
81 };
82 
83 
84 //-------------------------------------------------------------------
89 class YSBreak : public YStatement
90 {
92 public:
93  YSBreak (int line = 0); // statement
95  virtual ykind kind () const { return ysBreak; }
96  string toString () const;
97  std::ostream & toStream (std::ostream & str) const;
98  std::ostream & toXml (std::ostream & str, int indent ) const;
99  YCPValue evaluate (bool cse = false);
100 };
101 
102 
103 //-------------------------------------------------------------------
108 class YSContinue : public YStatement
109 {
111 public:
112  YSContinue (int line = 0); // statement
114  virtual ykind kind () const { return ysContinue; }
115  string toString () const;
116  std::ostream & toStream (std::ostream & str) const;
117  std::ostream & toXml (std::ostream & str, int indent ) const;
118  YCPValue evaluate (bool cse = false);
119 };
120 
121 
122 //-------------------------------------------------------------------
127 class YSExpression : public YStatement
128 {
130  YCodePtr m_expr;
131 public:
132  YSExpression (YCodePtr expr, int line = 0); // statement
134  ~YSExpression ();
135  virtual ykind kind () const { return ysExpression; }
136  string toString () const;
137  std::ostream & toStream (std::ostream & str) const;
138  std::ostream & toXml (std::ostream & str, int indent ) const;
139  YCPValue evaluate (bool cse = false);
140  constTypePtr type () const { return Type::Void; };
141 };
142 
143 
144 //-------------------------------------------------------------------
149 class YSBlock : public YStatement
150 {
151  REP_BODY(YSBlock);
152  YBlockPtr m_block;
153 public:
154  YSBlock (YBlockPtr block, int line = 0);
156  ~YSBlock ();
157  virtual ykind kind () const { return ysBlock; }
158  string toString () const;
159  std::ostream & toStream (std::ostream & str) const;
160  std::ostream & toXml (std::ostream & str, int indent ) const;
161  YCPValue evaluate (bool cse = false);
162  constTypePtr type () const { return Type::Void; };
163 };
164 
165 
166 //-------------------------------------------------------------------
171 class YSReturn : public YStatement
172 {
174  YCodePtr m_value;
175 public:
176  YSReturn (YCodePtr value, int line = 0);
178  ~YSReturn ();
179  virtual ykind kind () const { return ysReturn; }
180  void propagate (constTypePtr from, constTypePtr to);
181  YCodePtr value () const; // needed in YBlock::justReturn
182  void clearValue (); // needed if justReturn triggers
183  string toString () const;
184  std::ostream & toStream (std::ostream & str) const;
185  std::ostream & toXml (std::ostream & str, int indent ) const;
186  YCPValue evaluate (bool cse = false);
187  constTypePtr type () const { return Type::Void; };
188 };
189 
190 
191 //-------------------------------------------------------------------
196 class YSTypedef : public YStatement
197 {
199  Ustring m_name; // name
200  constTypePtr m_type; // type
201 public:
202  YSTypedef (const string &name, constTypePtr type, int line = 0); // Typedef
204  ~YSTypedef () {};
205  virtual ykind kind () const { return ysTypedef; }
206  string toString() const;
207  std::ostream & toStream (std::ostream & str) const;
208  std::ostream & toXml (std::ostream & str, int indent ) const;
209  YCPValue evaluate (bool cse = false);
210  constTypePtr type () const { return Type::Void; };
211 };
212 
213 
214 //-------------------------------------------------------------------
219 class YSFunction : public YStatement
220 {
222  // the functions' symbol, it's code is this YSFunction !
223  YSymbolEntryPtr m_entry;
224 
225 public:
226  YSFunction (YSymbolEntryPtr entry, int line = 0);
228  ~YSFunction ();
229  virtual ykind kind () const { return ysFunction; }
230 
231  // symbol entry of function itself
232  SymbolEntryPtr entry () const;
233 
234  // access to function definition
235  YFunctionPtr function () const;
236 
237  string toString () const;
238  std::ostream & toStream (std::ostream & str) const;
239  std::ostream & toXml (std::ostream & str, int indent ) const;
240  YCPValue evaluate (bool cse = false);
241  constTypePtr type () const { return Type::Void; };
242 };
243 
244 
245 //-------------------------------------------------------------------
251 class YSAssign : public YStatement
252 {
254 protected:
255  SymbolEntryPtr m_entry;
256  YCodePtr m_code;
257 public:
258  YSAssign (SymbolEntryPtr entry, YCodePtr code, int line = 0);
260  ~YSAssign ();
261  virtual ykind kind () const { return ysAssign; }
262  string toString () const;
263  std::ostream & toStream (std::ostream & str) const;
264  std::ostream & toXml (std::ostream & str, int indent ) const;
265  YCPValue evaluate (bool cse = false);
266 };
267 
268 
269 //-------------------------------------------------------------------
275 class YSVariable : public YSAssign
276 {
278 public:
279  YSVariable (SymbolEntryPtr entry, YCodePtr code, int line = 0);
281  ~YSVariable ();
282  virtual ykind kind () const { return ysVariable; }
283  string toString () const;
284 };
285 
286 
287 //-------------------------------------------------------------------
293 class YSBracket : public YStatement
294 {
296  SymbolEntryPtr m_entry;
297  YCodePtr m_arg;
298  YCodePtr m_code;
299 public:
300  YSBracket (SymbolEntryPtr entry, YCodePtr arg, YCodePtr code, int line = 0);
302  ~YSBracket ();
303  virtual ykind kind () const { return ysBracket; }
304  string toString () const;
305  std::ostream & toStream (std::ostream & str) const;
306  std::ostream & toXml (std::ostream & str, int indent ) const;
307  // recursively extract list arg at idx, get value from current at idx
308  // and replace with value. re-generating the list/map/term during unwind
309  YCPValue commit (YCPValue current, int idx, YCPList arg, YCPValue value);
310  YCPValue evaluate (bool cse = false);
311  constTypePtr type () const { return Type::Void; };
312 };
313 
314 
315 //-------------------------------------------------------------------
320 class YSIf : public YStatement
321 {
322  REP_BODY(YSIf);
323  YCodePtr m_condition; // bool expr
324  YCodePtr m_true; // true statement/block
325  YCodePtr m_false; // false statement/block
326 public:
327  YSIf (YCodePtr a_expr, YCodePtr a_true, YCodePtr a_false, int line = 0);
329  ~YSIf ();
330  virtual ykind kind () const { return ysIf; }
331  string toString () const;
332  std::ostream & toStream (std::ostream & str) const;
333  std::ostream & toXml (std::ostream & str, int indent ) const;
334  YCPValue evaluate (bool cse = false);
335  constTypePtr type () const { return Type::Void; };
336 };
337 
338 
339 //-------------------------------------------------------------------
344 class YSWhile : public YStatement
345 {
346  REP_BODY(YSWhile);
347  YCodePtr m_condition; // bool expr
348  YCodePtr m_loop; // loop statement
349 
350 public:
351  YSWhile (YCodePtr expr, YCodePtr loop, int line = 0);
353  ~YSWhile ();
354  virtual ykind kind () const { return ysWhile; }
355  string toString () const;
356  std::ostream & toStream (std::ostream & str) const;
357  std::ostream & toXml (std::ostream & str, int indent ) const;
358  YCPValue evaluate (bool cse = false);
359  constTypePtr type () const { return Type::Void; };
360 };
361 
362 
363 //-------------------------------------------------------------------
368 class YSRepeat : public YStatement
369 {
371  YCodePtr m_loop; // loop statement
372  YCodePtr m_condition; // bool expr
373 
374 public:
375  YSRepeat (YCodePtr loop, YCodePtr expr, int line = 0);
377  ~YSRepeat ();
378  virtual ykind kind () const { return ysRepeat; }
379  string toString () const;
380  std::ostream & toStream (std::ostream & str) const;
381  std::ostream & toXml (std::ostream & str, int indent ) const;
382  YCPValue evaluate (bool cse = false);
383  constTypePtr type () const { return Type::Void; };
384 };
385 
386 
387 //-------------------------------------------------------------------
392 class YSDo : public YStatement
393 {
394  REP_BODY(YSDo);
395  YCodePtr m_loop; // loop statement
396  YCodePtr m_condition; // bool expr
397 
398 public:
399  YSDo (YCodePtr loop, YCodePtr expr, int line = 0);
401  ~YSDo ();
402  virtual ykind kind () const { return ysDo; }
403  string toString () const;
404  std::ostream & toStream (std::ostream & str) const;
405  std::ostream & toXml (std::ostream & str, int indent ) const;
406  YCPValue evaluate (bool cse = false);
407  constTypePtr type () const { return Type::Void; };
408 };
409 
410 
411 //-------------------------------------------------------------------
416 class YSTextdomain : public YStatement
417 {
420 public:
421  YSTextdomain (const string &textdomain, int line = 0);
423  ~YSTextdomain ();
424  virtual ykind kind () const { return ysTextdomain; }
425  string toString () const;
426  std::ostream & toStream (std::ostream & str) const;
427  std::ostream & toXml (std::ostream & str, int indent ) const;
428  YCPValue evaluate (bool cse = false);
429  constTypePtr type () const { return Type::Void; };
430  const char *domain () const { return m_domain->c_str(); };
431 private:
432  void bind ();
433 };
434 
435 
436 //-------------------------------------------------------------------
441 class YSInclude : public YStatement
442 {
445  bool m_skipped;
446 public:
447  YSInclude (const string &filename, int line = 0, bool skipped = false);
449  ~YSInclude ();
450  virtual ykind kind () const { return ysInclude; }
451  string toString () const;
452  std::ostream & toStream (std::ostream & str) const;
453  std::ostream & toXml (std::ostream & str, int indent ) const;
454  YCPValue evaluate (bool cse = false);
455  constTypePtr type () const { return Type::Void; };
456  string filename () const { return m_filename; };
457 };
458 
459 
460 //-------------------------------------------------------------------
465 class YSImport : public YStatement, public Import
466 {
468 public:
469  YSImport (const string &name, int line = 0);
470  YSImport (const string &name, Y2Namespace *name_space);
472  ~YSImport ();
473  virtual ykind kind () const { return ysImport; }
474  string name () const;
475  string toString () const;
476  std::ostream & toStream (std::ostream & str) const;
477  std::ostream & toXml (std::ostream & str, int indent ) const;
478  YCPValue evaluate (bool cse = false);
479  constTypePtr type () const { return Type::Void; };
480 };
481 
482 
483 //-------------------------------------------------------------------
488 class YSFilename : public YStatement
489 {
492 public:
493  YSFilename (const string &filename, int line = 0);
495  ~YSFilename ();
496  virtual ykind kind () const { return ysFilename; }
497  string toString () const;
498  std::ostream & toStream (std::ostream & str) const;
499  std::ostream & toXml (std::ostream & str, int indent ) const;
500  YCPValue evaluate (bool cse = false);
501  constTypePtr type () const { return Type::Void; };
502 };
503 
504 //-------------------------------------------------------------------
509 class YSSwitch : public YStatement
510 {
512  YCodePtr m_condition;
513  YBlockPtr m_block;
514 
515  // index of the default case statement in the block
517 
518  // indices of the case statements in the block
519  map<YCPValue, int, ycp_less> m_cases;
520 
521 public:
522  YSSwitch (YCodePtr condition);
524  ~YSSwitch ();
525  virtual ykind kind () const { return ysSwitch; }
526  string name () const;
527  string toString () const;
528  std::ostream & toStream (std::ostream & str) const;
529  std::ostream & toXml (std::ostream & str, int indent ) const;
530  YCPValue evaluate (bool cse = false);
531  constTypePtr type () const { return Type::Void; };
532  constTypePtr conditionType () const { return m_condition->type (); };
533  bool setCase (YCPValue value);
534  bool setDefaultCase ();
535  void setBlock (YBlockPtr block);
536 };
537 
538 
539 #endif // YStatement_h
constTypePtr type() const
Definition: YStatement.h:359
~YSImport()
Definition: YStatement.cc:1713
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1807
~YSSwitch()
Definition: YStatement.cc:1923
Definition: YStatement.h:344
SymbolEntryPtr m_entry
Definition: YStatement.h:296
SymbolEntryPtr m_entry
Definition: YStatement.h:255
~YSRepeat()
Definition: YStatement.cc:1302
string toString() const
Definition: YStatement.cc:321
~YSReturn()
Definition: YStatement.cc:374
constTypePtr type() const
Definition: YStatement.h:429
YSIf(YCodePtr a_expr, YCodePtr a_true, YCodePtr a_false, int line=0)
Definition: YStatement.cc:967
YSBreak(int line=0)
Definition: YStatement.cc:128
YCode for precompiled ycp code.
Definition: YCode.h:75
YCodePtr m_false
Definition: YStatement.h:325
constTypePtr type() const
Definition: YStatement.h:140
constTypePtr type() const
Definition: YStatement.h:407
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:204
Definition: YCode.h:135
Definition: YCode.h:151
Ustring m_domain
Definition: YStatement.h:419
YSymbolEntryPtr m_entry
Definition: YStatement.h:223
#define str
Definition: scanner.cc:997
string toString() const
Definition: YStatement.cc:1929
REP_BODY(YSContinue)
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:657
~YSFilename()
Definition: YStatement.cc:1862
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1600
REP_BODY(YSExpression)
virtual ykind kind() const
Definition: YStatement.h:473
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1835
Definition: YStatement.h:196
YSAssign(SymbolEntryPtr entry, YCodePtr code, int line=0)
Definition: YStatement.cc:624
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1898
Ustring m_name
Definition: YStatement.h:199
virtual ykind kind() const
Definition: YStatement.h:114
Definition: YCode.h:142
Definition: YStatement.h:171
REP_BODY(YSBlock)
Definition: YBlock.h:49
REP_BODY(YSRepeat)
virtual ykind kind() const
Definition: YStatement.h:282
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:210
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:2010
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:344
YSRepeat(YCodePtr loop, YCodePtr expr, int line=0)
Definition: YStatement.cc:1282
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1072
constTypePtr m_type
Definition: YStatement.h:200
ykind
Definition: YCode.h:90
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1972
YCodePtr m_loop
Definition: YStatement.h:348
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1666
string toString() const
Definition: YStatement.cc:414
DEFINE_DERIVED_POINTER(YStatement, YCode)
YBlockPtr m_block
Definition: YStatement.h:513
~YSVariable()
Definition: YStatement.cc:713
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:158
constTypePtr type() const
Definition: YStatement.h:531
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1480
Definition: YStatement.h:441
virtual ykind kind() const
Definition: YStatement.h:525
Definition: YStatement.h:149
int line() const
Definition: YStatement.h:78
~YSTypedef()
Definition: YStatement.h:204
virtual ykind kind() const
Definition: YStatement.h:229
Definition: YStatement.h:127
REP_BODY(YSFunction)
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:666
Definition: YCode.h:136
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:592
Definition: YStatement.h:65
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1321
YStatement(int line=0)
Definition: YStatement.cc:73
Definition: YCode.h:140
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1357
YSFunction(YSymbolEntryPtr entry, int line=0)
Definition: YStatement.cc:479
YCodePtr m_code
Definition: YStatement.h:298
Definition: YStatement.h:488
YSImport(const string &name, int line=0)
Definition: YStatement.cc:1687
YCodePtr m_condition
Definition: YStatement.h:372
constTypePtr type() const
Definition: YStatement.h:210
Definition: YStatement.h:392
Definition: YStatement.h:368
virtual YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:98
virtual string toString() const
Definition: YStatement.cc:91
constTypePtr type() const
Definition: YStatement.h:80
YBlockPtr m_block
Definition: YStatement.h:152
~YSDo()
Definition: YStatement.cc:1443
YCodePtr m_condition
Definition: YStatement.h:396
Definition: YCode.h:139
YSBlock(YBlockPtr block, int line=0)
Definition: YStatement.cc:300
virtual ykind kind() const
Definition: YStatement.h:261
YSBracket(SymbolEntryPtr entry, YCodePtr arg, YCodePtr code, int line=0)
Definition: YStatement.cc:733
~YSInclude()
Definition: YStatement.cc:1635
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1045
REP_BODY(YSSwitch)
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1883
Definition: YStatement.h:89
int m_defaultcase
Definition: YStatement.h:516
Ustring m_filename
Definition: YStatement.h:444
string toString() const
Definition: YStatement.cc:240
string toString() const
Definition: YStatement.cc:1726
bool setDefaultCase()
Definition: YStatement.cc:2078
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1160
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:613
string toString() const
Definition: YStatement.cc:995
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:680
virtual ykind kind() const
Definition: YStatement.h:354
~YSAssign()
Definition: YStatement.cc:640
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:453
void setBlock(YBlockPtr block)
Definition: YStatement.cc:2091
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1610
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:779
string toString() const
Definition: YStatement.cc:1449
~YSBlock()
Definition: YStatement.cc:315
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1994
YSSwitch(YCodePtr condition)
Definition: YStatement.cc:1914
Definition: YStatement.h:320
YCodePtr value() const
Definition: YStatement.cc:380
Definition: YCode.h:149
~YSBracket()
Definition: YStatement.cc:742
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:538
virtual ykind kind() const
Definition: YStatement.h:450
instantiate to import a module
Definition: Import.h:36
Definition: YCode.h:145
Definition: YStatement.h:275
constTypePtr type() const
Definition: YStatement.h:501
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1174
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1016
void propagate(constTypePtr from, constTypePtr to)
Definition: YStatement.cc:403
Definition: YCode.h:150
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1592
Definition: YCode.h:147
virtual ykind kind() const
Definition: YStatement.h:179
int m_line
Definition: YStatement.h:68
YSInclude(const string &filename, int line=0, bool skipped=false)
Definition: YStatement.cc:1627
constTypePtr type() const
Definition: YStatement.h:311
constTypePtr type() const
Definition: YStatement.h:241
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:329
YCodePtr m_condition
Definition: YStatement.h:347
constTypePtr type() const
Definition: YStatement.h:335
Definition: YCode.h:153
constTypePtr type() const
Definition: YStatement.h:187
Unique strings.
Definition: Ustring.h:124
bool m_skipped
Definition: YStatement.h:445
constTypePtr type() const
Definition: YStatement.h:455
virtual bool isStatement() const
Definition: YStatement.h:77
YCPValue commit(YCPValue current, int idx, YCPList arg, YCPValue value)
Definition: YStatement.cc:797
string toString() const
Definition: YStatement.cc:1132
string toString() const
Definition: YStatement.cc:187
virtual ykind kind() const
Definition: YStatement.h:378
~YSFunction()
Definition: YStatement.cc:486
constTypePtr type() const
Definition: YStatement.h:383
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:194
string toString() const
Definition: YStatement.cc:1576
REP_BODY(YSAssign)
REP_BODY(YSInclude)
YCodePtr m_value
Definition: YStatement.h:174
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:769
YCodePtr m_code
Definition: YStatement.h:256
string toString() const
Definition: YStatement.cc:1868
string filename() const
Definition: YStatement.h:456
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:252
Wrapper for YCPListRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPListRep with the arrow operator. See YCPListRep.
Definition: YCPList.h:236
Definition: YCode.h:143
string toString() const
Definition: YStatement.cc:647
string toString() const
Definition: YStatement.cc:1641
YCodePtr m_true
Definition: YStatement.h:324
YCodePtr m_condition
Definition: YStatement.h:323
virtual ykind kind() const
Definition: YStatement.h:205
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1467
constTypePtr type() const
Definition: YStatement.h:479
Definition: YCode.h:138
virtual ykind kind() const
Definition: YStatement.h:424
Definition: YStatement.h:108
Definition: YCode.h:146
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:909
YCodePtr m_expr
Definition: YStatement.h:130
REP_BODY(YSDo)
YCodePtr m_condition
Definition: YStatement.h:512
Definition: YCode.h:137
YSExpression(YCodePtr expr, int line=0)
Definition: YStatement.cc:220
virtual ykind kind() const
Definition: YStatement.h:95
Definition: YStatement.h:293
void bind()
Definition: YStatement.cc:1616
string toString() const
Definition: YStatement.cc:749
YSFilename(const string &filename, int line=0)
Definition: YStatement.cc:1855
~YSWhile()
Definition: YStatement.cc:1126
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1676
REP_BODY(YSVariable)
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1891
Definition: YCode.h:148
YSWhile(YCodePtr expr, YCodePtr loop, int line=0)
Definition: YStatement.cc:1108
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:514
REP_BODY(YSReturn)
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1190
string toString() const
Definition: YStatement.cc:1340
Definition: YCode.h:144
string toString() const
Definition: YStatement.cc:507
map< YCPValue, int, ycp_less > m_cases
Definition: YStatement.h:519
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:337
virtual ykind kind() const
Definition: YStatement.h:402
REP_BODY(YSIf)
YSTypedef(const string &name, constTypePtr type, int line=0)
Definition: YStatement.cc:567
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1308
string name() const
string toString() const
Definition: YStatement.cc:584
YSContinue(int line=0)
Definition: YStatement.cc:174
const char * domain() const
Definition: YStatement.h:430
YSVariable(SymbolEntryPtr entry, YCodePtr code, int line=0)
Definition: YStatement.cc:699
REP_BODY(YSWhile)
Wrapper for YCPValueRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPValueRep with the arrow operator. See YCPValueRep.
Definition: YCPValue.h:275
REP_BODY(YSFilename)
REP_BODY(YSTypedef)
virtual ykind kind() const
Definition: YStatement.h:330
Definition: YStatement.h:416
virtual ykind kind() const
Definition: YStatement.h:135
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:108
Definition: Y2Namespace.h:43
YCodePtr m_arg
Definition: YStatement.h:297
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:118
YSReturn(YCodePtr value, int line=0)
Definition: YStatement.cc:356
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:1825
~YStatement()
Definition: YStatement.h:72
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:428
YSDo(YCodePtr loop, YCodePtr expr, int line=0)
Definition: YStatement.cc:1423
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:601
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42
static const constTypePtr Void
Definition: Type.h:122
Definition: YStatement.h:251
string name() const
Definition: YStatement.cc:1719
Definition: YCode.h:152
SymbolEntryPtr entry() const
Definition: YStatement.cc:493
REP_BODY(YStatement)
constTypePtr type() const
Definition: YStatement.h:162
YCodePtr m_loop
Definition: YStatement.h:371
Definition: YStatement.h:219
virtual ykind kind() const
Definition: YStatement.h:157
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:287
YCodePtr m_loop
Definition: YStatement.h:395
string toString() const
Definition: YStatement.cc:141
~YSIf()
Definition: YStatement.cc:989
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:552
YSTextdomain(const string &textdomain, int line=0)
Definition: YStatement.cc:1562
REP_BODY(YSBreak)
bool setCase(YCPValue value)
Definition: YStatement.cc:2063
REP_BODY(YSTextdomain)
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:148
Definition: YStatement.h:509
std::ostream & toStream(std::ostream &str) const
Definition: YStatement.cc:1657
~YSExpression()
Definition: YStatement.cc:234
YCPValue evaluate(bool cse=false)
Definition: YStatement.cc:1497
~YSTextdomain()
Definition: YStatement.cc:1570
virtual ykind kind() const
Definition: YStatement.h:303
Definition: YCode.h:141
void clearValue()
Definition: YStatement.cc:393
Definition: YStatement.h:465
constTypePtr conditionType() const
Definition: YStatement.h:532
REP_BODY(YSBracket)
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:441
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:164
REP_BODY(YSImport)
std::ostream & toXml(std::ostream &str, int indent) const
Definition: YStatement.cc:260
string toString() const
Definition: YStatement.cc:719
Ustring m_filename
Definition: YStatement.h:491
virtual ykind kind() const
Definition: YStatement.h:496

Generated on a sunny day for yast2-core by doxygen 1.8.8