DIRECTORY
  CRunTimeDefs USING [],
  Storage USING [Node];
  
   
CRunTimeImpl: PROGRAM IMPORTS Storage EXPORTS CRunTimeDefs = {


  StringToArray: PUBLIC PROCEDURE [s: LONG STRING] RETURNS [LONG POINTER TO INTEGER] = {
      -- the problem here is that the string will be allocated EACH time
      -- it is used. FIX THIS LATER.
  
      saveP, p: LONG POINTER TO INTEGER;
      n: INTEGER;
      
      p ← Storage.Node[nwords: SIZE[INTEGER] * s.length];
      -- NOTE: the scanner has already inserting the Ascii.NUL
      saveP ← p;
      
      FOR i: CARDINAL IN [0..s.length) DO
          n ← s.text[i] - 0C;	-- convert to an INTEGER
	  p↑ ← n;
	  p ← p + SIZE[INTEGER];
	  ENDLOOP;
	  
      RETURN[saveP];
      };

  }.