Titan Core Initial Contribution
[deliverable/titan.core.git] / compiler2 / asn1 / Ref.hh
1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef _Asn_Ref_HH
9 #define _Asn_Ref_HH
10
11 #include "AST_asn1.hh"
12 #include "../Type.hh"
13
14 namespace Asn {
15
16 /**
17 * \addtogroup AST
18 *
19 * @{
20 */
21
22 using namespace Common;
23
24 class Ref_pard;
25 class FieldName;
26 class FromObj;
27
28 /**
29 * Parameterized reference.
30 */
31 class Ref_pard : public Ref_defd {
32 private:
33 Ref_defd_simple *ref_parass; /**< ref. to the par.d ass. */
34 Block *block; /**< actual parameter list */
35 bool refd_ass_is_not_pard;
36 Assignments *asss;
37 Ref_defd_simple *ref_ds; /**< name of the instantiated stuff */
38
39 Ref_pard(const Ref_pard& p);
40 public:
41 Ref_pard(Ref_defd_simple *p_refds, Block *p_block);
42 virtual ~Ref_pard();
43 /** Virtual constructor. */
44 virtual Ref_pard *clone() const;
45 virtual void set_fullname(const string& p_fullname);
46 virtual void set_my_scope(Scope *p_scope);
47 virtual bool get_is_erroneous();
48 virtual string get_dispname();
49 /** Instantiates the reference. */
50 virtual Ref_defd_simple* get_ref_defd_simple();
51 virtual void dump(unsigned level) const;
52 };
53
54 /**
55 * Class to represent FieldName. FieldName is a sequence of
56 * PrimitiveFieldNames.
57 */
58 class FieldName : public Node {
59 private:
60 vector<Identifier> fields;
61
62 FieldName(const FieldName& p);
63 public:
64 FieldName() : Node() { }
65 virtual ~FieldName();
66 virtual FieldName *clone() const;
67 void add_field(Identifier *p_id);
68 virtual string get_dispname() const;
69 size_t get_nof_fields() const { return fields.size(); }
70 Identifier* get_field_byIndex(size_t p_i) const { return fields[p_i]; }
71 };
72
73 /**
74 * Class to represent InformationFromObjects.
75 */
76 class FromObj : public Common::Reference {
77 private:
78 /** ObjectClass, Object or ObjectSet */
79 Ref_defd *ref_defd;
80 FieldName *fn;
81 Setting *setting; /**< contains the ObejctClassFieldType, OpenType or
82 OS_defn that was created in get_refd_setting()
83 and owned by this */
84 Setting *setting_cache;
85
86 FromObj(const FromObj& p);
87 public:
88 FromObj(Ref_defd *p_ref_defd, FieldName *p_fn);
89 virtual ~FromObj();
90 virtual FromObj *clone() const;
91 virtual void set_fullname(const string& p_fullname);
92 virtual void set_my_scope(Scope *p_scope);
93 virtual bool get_is_erroneous();
94 virtual string get_dispname();
95 virtual Setting* get_refd_setting();
96 virtual Common::Assignment* get_refd_assignment(bool check_parlist = true);
97 virtual bool has_single_expr();
98 virtual void generate_code (expression_struct_t *expr);
99 virtual void generate_code_const_ref(expression_struct_t *expr);
100 };
101
102 /** @} end of AST group */
103
104 } // namespace Asn
105
106 #endif // _Asn_Ref_HH
This page took 0.033702 seconds and 5 git commands to generate.