source: trunk/ada-2012/src/semantic/gela-int-expressions.adb@ 359

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
RevLine 
[257]1with Gela.Int.Visiters;
2
[276]3package body Gela.Int.Expressions is
[257]4
5 ------------
6 -- Create --
7 ------------
8
9 function Create
[358]10 (Down : Gela.Interpretations.Interpretation_Index_Array;
[278]11 Expression_Type : Gela.Semantic_Types.Type_Index)
[276]12 return Expression is
[257]13 begin
[359]14 return (Index => 0,
15 Length => Down'Length,
[278]16 Expression_Type => Expression_Type,
[358]17 Down => Down);
[257]18 end Create;
19
[276]20 ---------------------
21 -- Expression_Type --
22 ---------------------
[257]23
[276]24 function Expression_Type
25 (Self : Expression)
26 return Gela.Semantic_Types.Type_Index is
[257]27 begin
[276]28 return Self.Expression_Type;
29 end Expression_Type;
[257]30
31 -----------
32 -- Visit --
33 -----------
34
35 overriding procedure Visit
[276]36 (Self : Expression;
[257]37 Visiter : access Gela.Int.Visiters.Visiter'Class) is
38 begin
[276]39 Visiter.Expression (Self);
[257]40 end Visit;
41
[276]42end Gela.Int.Expressions;
Note: See TracBrowser for help on using the repository browser.