Changeset 2604

Show
Ignore:
Timestamp:
01/15/08 19:02:08 (1 year ago)
Author:
maxr
Message:

ada: source_buffers added. we will need it in new (unicode aware) scaner
and to implement asis-text.ads

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tendra/src/producers/ada/asis/Makefile

    r2557 r2604  
    6666        $(BIN_GNATCHOP) -w parser.all 
    6767 
     68#  Source Buffer part 
     69 
     70BUFFER_SRC = gela-source_buffers-current.ads 
     71 
     72gela-source_buffers-current.ads: 
     73        $(BIN_ECHO) with Gela.Source_Buffers.$(ADA_INPUT_BUFFER)\; \ 
     74                > gela-source_buffers-current.ads 
     75        $(BIN_ECHO) package Gela.Source_Buffers.Current renames \ 
     76                Gela.Source_Buffers.$(ADA_INPUT_BUFFER)\; \ 
     77                >> gela-source_buffers-current.ads 
     78 
    6879#  Asis part 
    6980 
     
    96107        $(BIN_CP) ${ADA_DIR}/xasis/*   ${INSTALL_PREFIX}/${ADA_INCLUDE_DIR} 
    97108 
    98 DEPEND_SRC = ${LEXER_SRC} ${PARSER_SRC} *.ads *.adb ${ASIS_SRC} 
     109DEPEND_SRC = ${LEXER_SRC} ${PARSER_SRC} *.ads *.adb ${ASIS_SRC} ${BUFFER_SRC} 
    99110 
    100111CLEANFILES=* 
  • trunk/tendra/src/producers/ada/asis/asis-gela-compilations.adb

    r2455 r2604  
    2727         List.Nodes (Item.Index).File_Name := U.Null_Unbounded_Wide_String; 
    2828         Pools.Deallocate_All (List.Nodes (Item.Index).Pool); 
     29         Text_Utils.Free (List.Nodes (Item.Index).Buffer); 
    2930      end if; 
    3031   end Drop_Compilation; 
     
    147148      List.Nodes (Index).Version   := Version; 
    148149      List.Nodes (Index).Pool      := Pools.State (Lists.Pool); 
     150      List.Nodes (Index).Buffer    := Text_Utils.New_Buffer (File); 
     151 
    149152      Item                         := (Index, Version); 
    150153   end New_Compilation; 
     154 
     155   ------------------- 
     156   -- Source_Buffer -- 
     157   ------------------- 
     158 
     159   function Source_Buffer 
     160     (List : Compilation_List; 
     161      Item : Compilation) return Text_Utils.Source_Buffer_Access 
     162   is 
     163   begin 
     164      if Valid_Version (List, Item) then 
     165         return List.Nodes (Item.Index).Buffer; 
     166      else 
     167         return null; 
     168      end if; 
     169   end Source_Buffer; 
    151170 
    152171   ------------------- 
  • trunk/tendra/src/producers/ada/asis/asis-gela-compilations.ads

    r2455 r2604  
    1313 
    1414with Asis.Gela.Pools; 
     15with Asis.Gela.Text_Utils; 
    1516with Ada.Strings.Wide_Unbounded; 
    1617 
     
    4445   pragma Inline (Valid_Version); 
    4546 
     47   function Source_Buffer 
     48     (List : Compilation_List; 
     49      Item : Compilation) return Text_Utils.Source_Buffer_Access; 
     50 
    4651private 
    4752   package U renames Ada.Strings.Wide_Unbounded; 
     
    5358      Version   : Version_Count; 
    5459      Pool      : Pools.Pool_State; 
     60      Buffer    : Text_Utils.Source_Buffer_Access; 
    5561   end record; 
    5662 
  • trunk/tendra/src/producers/ada/asis/asis-gela-contexts-utils.adb

    r2594 r2604  
    589589      end loop; 
    590590   end Split_Compilation; 
     591 
     592   ---------------------- 
     593   -- Compilation_List -- 
     594   ---------------------- 
     595 
     596   function Compilation_List 
     597     (The_Context : in Asis.Context) 
     598     return Gela.Compilations.Compilation_List 
     599   is 
     600      Node : Concrete_Context_Node renames 
     601        Concrete_Context_Node (The_Context.all); 
     602   begin 
     603      return Node.Compilation_List; 
     604   end Compilation_List; 
    591605 
    592606end Asis.Gela.Contexts.Utils; 
  • trunk/tendra/src/producers/ada/asis/asis-gela-contexts-utils.ads

    r2573 r2604  
    2424   procedure Parse_Parameters (The_Context : in out Concrete_Context_Node); 
    2525   --  Read The_Context.Parameters and configure ASIS 
     26 
     27   function Compilation_List (The_Context : in Asis.Context) 
     28     return Gela.Compilations.Compilation_List; 
    2629 
    2730end Asis.Gela.Contexts.Utils;