///////////////////////////////////////////////////////////////////////////////
//                              Lisaac Example                               //
//                                                                           //
//                   LSIIT - ULP - CNRS - INRIA - FRANCE                     //
//                                                                           //
//   This program is free software: you can redistribute it and/or modify    //
//   it under the terms of the GNU General Public License as published by    //
//   the Free Software Foundation, either version 3 of the License, or       //
//   (at your option) any later version.                                     //
//                                                                           //
//   This program is distributed in the hope that it will be useful,         //
//   but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           //
//   GNU General Public License for more details.                            //
//                                                                           //
//   You should have received a copy of the GNU General Public License       //
//   along with this program.  If not, see <http://www.gnu.org/licenses/>.   //
//                                                                           //
//                     http://isaacproject.u-strasbg.fr/                     //
///////////////////////////////////////////////////////////////////////////////
Section Header
  
  + name     := EXTERNAL_EXAMPLE;
  
  - external := `#include <stdio.h>`; // Here, add C code (function, include, ...)
  
Section Inherit
  
  - parent_object:OBJECT := OBJECT;
    
Section External 
  // In this section, a Lisaac function give 
  // a C function with identically profil. (Without `Self')
  
  - function (a,b:INTEGER) :INTEGER <-
  (
    "Hello\n".print;
    a + b
  );
  
Section Public
    
  - main <-
  ( + a:INTEGER;
    
    a := function (1,2);    
    "Adress function : ".print;
    `function`:POINTER.print_hex;
    "h\n".print;
    
    a := `@a + 2`:INTEGER; // External C with return value.
    `printf("Display with C function and access local Lisaac variable (%d)\n",@a)`;
  );
