|
| 1 | +------------------------------------------------------------------------------ |
| 2 | +-- Templates Parser -- |
| 3 | +-- -- |
| 4 | +-- Copyright (C) 2020, AdaCore -- |
| 5 | +-- -- |
| 6 | +-- This is free software; you can redistribute it and/or modify it -- |
| 7 | +-- under terms of the GNU General Public License as published by the -- |
| 8 | +-- Free Software Foundation; either version 3, or (at your option) any -- |
| 9 | +-- later version. This software is distributed in the hope that it will -- |
| 10 | +-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty -- |
| 11 | +-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- |
| 12 | +-- General Public License for more details. -- |
| 13 | +-- -- |
| 14 | +-- You should have received a copy of the GNU General Public License -- |
| 15 | +-- distributed with this software; see file COPYING3. If not, go -- |
| 16 | +-- to http://www.gnu.org/licenses for a complete copy of the license. -- |
| 17 | +------------------------------------------------------------------------------ |
| 18 | + |
| 19 | +with Ada.Strings.Unbounded; |
| 20 | +with Ada.Text_IO; |
| 21 | + |
| 22 | +with Templates_Parser; |
| 23 | + |
| 24 | +procedure Ii is |
| 25 | + |
| 26 | + use Ada; |
| 27 | + use Ada.Strings.Unbounded; |
| 28 | + use Templates_Parser; |
| 29 | + |
| 30 | + R : Unbounded_String; |
| 31 | + V : Vector_Tag; |
| 32 | + T : Translate_Table (1 .. 4); |
| 33 | + |
| 34 | +begin |
| 35 | + T (1) := Assoc ("HEAD_FILE1", "/content/header.tmplt"); |
| 36 | + T (2) := Assoc ("HEAD_FILE2", "header.tmplt"); |
| 37 | + T (3) := Assoc ("HEAD_FILE3", "../content/header.tmplt"); |
| 38 | + T (4) := Assoc ("HEAD_FILE4", "./content/header.tmplt"); |
| 39 | + R := Parse ("content/ii.tmplt", T); |
| 40 | + |
| 41 | + Text_IO.Put_Line (To_String (R)); |
| 42 | +end Ii; |
0 commit comments