Last change
on this file since 359 was 359, checked in by Maxim Reznik, 6 years ago |
Reuse interpretation index
Return the same value for each call of Get_Index with the same arg.
|
File size:
975 bytes
|
Line | |
---|
1 | with Gela.Int.Visiters;
|
---|
2 |
|
---|
3 | package body Gela.Int.Expressions is
|
---|
4 |
|
---|
5 | ------------
|
---|
6 | -- Create --
|
---|
7 | ------------
|
---|
8 |
|
---|
9 | function Create
|
---|
10 | (Down : Gela.Interpretations.Interpretation_Index_Array;
|
---|
11 | Expression_Type : Gela.Semantic_Types.Type_Index)
|
---|
12 | return Expression is
|
---|
13 | begin
|
---|
14 | return (Index => 0,
|
---|
15 | Length => Down'Length,
|
---|
16 | Expression_Type => Expression_Type,
|
---|
17 | Down => Down);
|
---|
18 | end Create;
|
---|
19 |
|
---|
20 | ---------------------
|
---|
21 | -- Expression_Type --
|
---|
22 | ---------------------
|
---|
23 |
|
---|
24 | function Expression_Type
|
---|
25 | (Self : Expression)
|
---|
26 | return Gela.Semantic_Types.Type_Index is
|
---|
27 | begin
|
---|
28 | return Self.Expression_Type;
|
---|
29 | end Expression_Type;
|
---|
30 |
|
---|
31 | -----------
|
---|
32 | -- Visit --
|
---|
33 | -----------
|
---|
34 |
|
---|
35 | overriding procedure Visit
|
---|
36 | (Self : Expression;
|
---|
37 | Visiter : access Gela.Int.Visiters.Visiter'Class) is
|
---|
38 | begin
|
---|
39 | Visiter.Expression (Self);
|
---|
40 | end Visit;
|
---|
41 |
|
---|
42 | end Gela.Int.Expressions;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.