ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
broadway_expr.h
Go to the documentation of this file.
1 
2 #ifndef BDWY_EXPR_H
3 #define BDWY_EXPR_H
4 
5 typedef std::list< idNodeAnn * > idnodeann_list;
6 typedef idnodeann_list::iterator idnodeann_list_p;
7 
8 typedef std::list< exprAnn * > exprann_list;
9 typedef exprann_list::iterator exprann_list_p;
10 typedef exprann_list::const_iterator exprann_list_cp;
11 
12 
16 class exprAnn : public Ann
17 {
18 private:
19 
25 
26 public:
27 
33  : Ann(line),
34  _op(op)
35  {}
36 
39  inline Broadway::Operator op() const { return _op; }
40 
46 #ifdef __PROCLOCATION
47  virtual bool test(procLocation * where,
48  propertyAnalyzer * property_analyzer) =0;
49 #endif
50 
56 #ifdef __PROCLOCATION
57  virtual void compute_next(procLocation * where, ruleAnn * rule);
58 #endif
59 
65 #ifdef __PROCLOCATION
66  virtual void apply_next(procLocation * where,
67  propertyAnalyzer * property_analyzer,
68  ruleAnn * rule,
69  memoryblock_set & changes);
70 #endif
71 
78  virtual void lookup(propertyAnn * default_property,
79  procedureAnn * procedure,
80  Annotations * annotations) =0;
81 
87 #ifdef __PROCLOCATION
88  virtual void report(std::ostream & out, bool is_error, procLocation * where) =0;
89 #endif
90 
95  virtual void print(std::ostream & out) =0;
96 
97 // begin TB new
98 
103 #ifdef __PROCLOCATION
104  virtual void diagnostic(std::ostream & out,
105  procLocation *where,
106  propertyAnalyzer * property_analyzer) const =0;
107 #endif
108 // end TB new
109 };
110 
116 {
117 private:
118 
122 
126 
127 public:
128 
134  exprAnn * lhs,
135  exprAnn * rhs,
136  int line);
137 
138  inline exprAnn * lhs() const { return _lhs; }
139  inline exprAnn * rhs() const { return _rhs; }
140 
141 #ifdef __PROCLOCATION
142  virtual bool test(procLocation * where,
143  propertyAnalyzer * property_analyzer);
144 #endif
145  virtual void lookup(propertyAnn * default_property,
146  procedureAnn * procedure,
147  Annotations * annotations);
148 
149 #ifdef __PROCLOCATION
150  virtual void report(std::ostream & out, bool is_error, procLocation * where);
151 #endif
152 
153  virtual void print(std::ostream & out);
154 
155 // begin TB new
156 #ifdef __PROCLOCATION
157  virtual void diagnostic(std::ostream & out,
158  procLocation *where,
159  propertyAnalyzer * property_analyzer) const;
160 #endif
161 // end TB new
162 };
163 
169 {
170 private:
171 
175 
180  std::string _property_name;
181 
187 
192  std::string _lhs_name;
193 
199 
205 
210  std::string _rhs_name;
211 
218 
225 
233 
234  /* @brief Previous _rhs_value at a location. */
235 #ifdef __PROCLOCATION
236  map<procLocation*,enumvalue_set> _previous_rhs_value; // TB_unify
237 #endif
238 
244 
251 #ifdef __MEMORYBLOCK
252  memoryblock_set _complicit_property_blocks;
253 #endif
254 
261 
267  bool _is_weak;
268 
269 public:
270 
275 // DQ (8/12/2004): Added virtual destructor to avoid g++ compiler warnings
276  virtual ~enumPropertyExprAnn() {};
277 
279  const parserID * property,
280  const parserID * lhs,
282  const parserID * rhs,
283  int line);
284 
290  inline bool rhs_is_property_value() const { return _rhs_is_property_value; }
291 
292 #ifdef __PROCLOCATION
293  virtual bool test(procLocation * where,
294  propertyAnalyzer * property_analyzer);
295 #endif
296 
297 #ifdef __PROCLOCATION
298  virtual void compute_next(procLocation * where, ruleAnn * rule);
299 #endif
300 
301 #ifdef __PROCLOCATION
302  virtual void apply_next(procLocation * where,
303  propertyAnalyzer * property_analyzer,
304  ruleAnn * rule,
305  memoryblock_set & changes);
306 #endif
307  virtual void lookup(propertyAnn * default_property,
308  procedureAnn * procedure,
309  Annotations * annotations);
310 
311 #ifdef __PROCLOCATION
312  virtual void report(std::ostream & out, bool is_error, procLocation * where);
313 #endif
314 
315  virtual void print(std::ostream & out);
316 
317  inline bool is_weak() const { return _is_weak; }
318  inline void set_weak() { _is_weak = true; }
319 
320 // begin TB new
321 #ifdef __PROCLOCATION
322  virtual void diagnostic(std::ostream & out,
323  procLocation *where,
324  propertyAnalyzer * property_analyzer) const;
325 #endif
326 // end TB new
327 };
328 
334 {
335 private:
336 
340 
345  std::string _property_name;
346 
352 
357  std::string _lhs_name;
358 
364 
369  std::string _rhs_name;
370 
376 
377 public:
378 
383 // DQ (8/12/2004): Added virtual destructor to avoid g++ compiler warnings
384  virtual ~setPropertyExprAnn() {};
385 
387  const parserID * setProperty,
388  const parserID * lhs,
390  const parserID * rhs,
391  int line);
392 
393 #ifdef __PROCLOCATION
394  virtual bool test(procLocation * where,
395  propertyAnalyzer * property_analyzer);
396 #endif
397 
398 #ifdef __PROCLOCATION
399  virtual void compute_next(procLocation * where, ruleAnn * rule);
400 #endif
401 
402 #ifdef __PROCLOCATION
403  virtual void apply_next(procLocation * where,
404  propertyAnalyzer * property_analyzer,
405  ruleAnn * rule,
406  memoryblock_set & changes);
407 #endif
408 
409  virtual void lookup(propertyAnn * default_property,
410  procedureAnn * procedure,
411  Annotations * annotations);
412 
413 #ifdef __PROCLOCATION
414  virtual void report(std::ostream & out, bool is_error, procLocation * where);
415 #endif
416 
417  virtual void print(std::ostream & out);
418 
419 // begin TB new
420 #ifdef __PROCLOCATION
421  virtual void diagnostic(std::ostream & out,
422  procLocation *where,
423  propertyAnalyzer * property_analyzer) const;
424 #endif
425 // end TB new
426 };
427 
448 class numericExprAnn : public exprAnn
449 {
450 private:
451 
454  std::string _lhs_name;
455 
459 
462 #ifdef __EXPRNODE
463  exprNode * _expr;
464 #endif
465 
466 public:
467 
472 // DQ (8/12/2004): Added virtual destructor to avoid g++ compiler warnings
473  virtual ~numericExprAnn() {};
474 
475 #ifdef __EXPRNODE
476  numericExprAnn(exprNode * expr,
477  int line);
478 #endif
479 
485  numericExprAnn(const parserID * lhs,
486  int line);
487 
495 #ifdef __EXPRNODE
496  numericExprAnn(const parserID * lhs,
497  exprNode * expr,
498  int line);
499 #endif
500 
501 #ifdef __PROCLOCATION
502  virtual bool test(procLocation * where,
503  propertyAnalyzer * property_analyzer);
504 #endif
505 
506 #ifdef __PROCLOCATION
507  virtual void compute_next(procLocation * where, ruleAnn * rule);
508 
509  virtual void apply_next(procLocation * where,
510  propertyAnalyzer * property_analyzer,
511  ruleAnn * rule,
512  memoryblock_set & changes);
513 #endif
514 
515  virtual void lookup(propertyAnn * default_property,
516  procedureAnn * procedure,
517  Annotations * annotations);
518 
519 #ifdef __PROCLOCATION
520  virtual void report(std::ostream & out, bool is_error, procLocation * where);
521 #endif
522 
523  virtual void print(std::ostream & out);
524 
525 // begin TB new
526 #ifdef __PROCLOCATION
527  virtual void diagnostic(std::ostream & out,
528  procLocation *where,
529  propertyAnalyzer * property_analyzer) const {}
530 #endif
531 // end TB new
532 };
533 
534 
539 class pointerExprAnn : public exprAnn
540 {
541 private:
542 
545  std::string _lhs_name;
546 
550 
553  std::string _rhs_name;
554 
558 
559 public:
560 
565 // DQ (8/12/2004): Added virtual destructor to avoid g++ compiler warnings
566  virtual ~pointerExprAnn() {};
567 
569  const parserID * lhs,
570  const parserID * rhs);
571 
572 #ifdef __PROCLOCATION
573  virtual bool test(procLocation * where,
574  propertyAnalyzer * property_analyzer);
575 #endif
576  virtual void lookup(propertyAnn * default_property,
577  procedureAnn * procedure,
578  Annotations * annotations);
579 
580 #ifdef __PROCLOCATION
581  virtual void report(std::ostream & out, bool is_error, procLocation * where);
582 #endif
583 
584  virtual void print(std::ostream & out);
585 
586 // begin TB new
587 #ifdef __PROCLOCATION
588  virtual void diagnostic(std::ostream & out,
589  procLocation *where,
590  propertyAnalyzer * property_analyzer) const {}
591 #endif
592 // end TB new
593 };
594 
603 #ifdef __IDNODEANN
604 class idNodeAnn : public idNode
605 {
606 private:
607 
608  REF annVariable * _variable;
609  int _line;
610 
611 public:
612 
617  idNodeAnn(const parserID * id);
618 
619  inline annVariable * variable() const { return _variable; }
620  inline int line() const { return _line; }
621 
622  void lookup(procedureAnn * procedure,
623  Annotations * annotations);
624 
630  virtual void eval() { }
631 
637  virtual void output_expr(output_context & ct, Node * parent, int prec, Assoc assoc);
638 
639 };
640 #endif /* __IDNODE_ANN */
641 
642 #endif /* BDWY_EXPR_H */