///////////////////////////////////////////////////////////////////////////////
//                             Lisaac Compiler                               //
//                                                                           //
//                   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        := ITM_READ_ARGS;

  - copyright   := "2003-2007 Benoit Sonntag";

  
  - author      := "Sonntag Benoit (bsonntag@loria.fr)";
  - comment     := "Message with a lot of arguments";
  
Section Inherit
  
  + parent_itm_read:Expanded ITM_READ;
  
Section Public
  
  - is_affect:POSITION <-
  ( + result,default:POSITION;
    + j:INTEGER;
    
    (args.first != NULL).if {
      result := args.first.position;
    } else {
      j := args.lower + 1;      
      {(j <= args.upper) && {result = default}}.while_do {
	result := args.item j.is_affect;
	j := j + 1;
      };
    };
    result
  );
  
  //
  // Data
  //

  + args:FAST_ARRAY[ITM_CODE];

  //
  // Constructor
  //
  
  - create p:POSITION name n:STRING_CONSTANT args arg:FAST_ARRAY[ITM_CODE] :SELF <-
  ( + result:SELF;
    result := clone;
    result.make p name n args arg;
    result
  );
  
  - make p:POSITION name n:STRING_CONSTANT args arg:FAST_ARRAY[ITM_CODE] <-
  (
    position := p;
    name     := n;
    args     := arg;
  );

  //
  // Runnable
  //

  - to_run_expr:EXPR <-
  ( + l_arg:FAST_ARRAY[ITM_CODE];    
    
    l_arg := ALIAS_ARRAY[ITM_CODE].new;       
    (args.lower+1).to (args.upper) do { j:INTEGER;         
      l_arg.add_last (args.item j);
    };        
    to_run_with (args.first) args l_arg
  );
     







