File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 9
9
//! # 1. Method calls within methods (and function block bodies)
10
10
//! The reason we want to desugar all method calls within (other) methods is for the fact that a non
11
11
//! overridden method may make use of an overridden method. For example consider
12
- //! ```
12
+ //! ```text
13
13
//! FUNCTION_BLOCK A
14
14
//! METHOD getName: STRING
15
15
//! getName := 'A';
54
54
//! # 2. Method calls through a pointer variable pointing to a class or function block
55
55
//! Essentially what is illustrated in 1. within the main function, consider:
56
56
//!
57
- //! ```
57
+ //! ```text
58
58
//! FUNCTION main
59
59
//! VAR
60
60
//! name: STRING;
86
86
//! issues. Compatible here refers to the fact that the order of the member fields must be constant. More
87
87
//! specifically, the methods must be defined in "ancestral hierarchical order". To illustrate with the
88
88
//! previous examples, assume we have
89
- //! ```
89
+ //! ```text
90
90
//! TYPE __vtable_A:
91
91
//! STRUCT
92
92
//! getName: __FPOINTER TO A.getName := ADR(A.getName);
Original file line number Diff line number Diff line change 9
9
//! # 1. Virtual Table POU Member Field
10
10
//! Every root, i.e. non-extended, class or function block will receive a `__vtable: POINTER TO __VOID` member
11
11
//! field. For example a function block such as
12
- //! ```norun
12
+ //! ```text
13
13
//! FUNCTION_BLOCK A
14
14
//! VAR
15
15
//! one: DINT;
16
16
//! END_VAR
17
17
//! END_FUNCTION_BLOCK
18
18
//! ```
19
19
//! will internally expand to
20
- //! ```norun
20
+ //! ```text
21
21
//! FUNCTION_BLOCK A
22
22
//! VAR
23
23
//! __vtable: POINTER TO __VOID;
34
34
//! methods `foo` (inherited) and `bar` (overridden) as well as `baz` (new). For these two function blocks we
35
35
//! would generate the following virtual table structures:
36
36
//!
37
- //! ```norun
37
+ //! ```text
38
38
//! TYPE __vtable_A:
39
39
//! STRUCT
40
40
//! foo: __FPOINTER TO A.foo := ADR(A.foo);
55
55
//! The newly created `__vtable` member fields need to point to some instance of the corresponding virtual
56
56
//! table. For that we will create one global variable for each virtual table. Deriving from the previous
57
57
//! example we would generate the following two variables
58
- //! ```
58
+ //! ```text
59
59
//! VAR_GLOBAL
60
60
//! __vtable_instance_A: __vtable_A;
61
61
//! __vtable_instance_B: __vtable_B;
You can’t perform that action at this time.
0 commit comments