File: Decl.h

package info (click to toggle)
storm-lang 0.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,004 kB
  • sloc: ansic: 261,462; cpp: 140,405; sh: 14,891; perl: 9,846; python: 2,525; lisp: 2,504; asm: 860; makefile: 678; pascal: 70; java: 52; xml: 37; awk: 12
file content (57 lines) | stat: -rw-r--r-- 1,488 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Core/TObject.h"
#include "Core/Thread.h"
#include "Compiler/Named.h"
#include "Compiler/Visibility.h"

namespace storm {
	namespace bs {
		STORM_PKG(lang.bs);

		/**
		 * Declaration that will be expanded later on.
		 *
		 * Generated by the parser in cases where we need to delay the creation of some entity
		 */
		class NamedDecl : public ObjectOn<Compiler> {
			STORM_ABSTRACT_CLASS;
		public:
			STORM_CTOR NamedDecl();

			// Visibility (if set).
			MAYBE(Visibility *) visibility;

			// Default thread (if set).
			MAYBE(SrcName *) thread;

			// Location of the documentation (if set).
			SrcPos docPos;

			// Create the actual named entity.
			Named *STORM_FN create();

			// Initialize the declaration previously created (if any).
			void STORM_FN resolve();

			// Update this declaration (if possible). If no previous implementation was found, a
			// newly created instance of this element is returned. If something is returned from
			// here, we don't expect 'resolve' to be called later.
			//
			// Note: This function will likely be removed in the future, when we have a more generic
			// mechanism for updating functions.
			virtual MAYBE(Named *) STORM_FN update(Scope scope);

		protected:
			// Do the actual creation.
			virtual Named *STORM_FN doCreate() ABSTRACT;

			// Resolve things inside 'named'.
			virtual void STORM_FN doResolve(Named *entity);

		private:
			// Previously created entity.
			MAYBE(Named *) created;
		};

	}
}