LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes

backslashnewline.gsp

This is the verbatim text of the file "backslashnewline.gsp" part of the LLOOP package. The copyright remains with Michel MEHL. All rights reserved.



/**
 * Concatenates lines separated with a banalized new line, regardless of
 * used platform line separator (\n, \n\r...).
 */ 

preprocessor backslashnewline
{{
  static char cPrev = 0;
  static char cPrevPrev = 0;

  if ( (cPrev == '\\') && ((c == '\n') || (c == '\r')) )
    {
      parser.pstream().seekp(-1, ios::cur); // Remove the '\' read before
      discard();
    }
  else if ( (cPrevPrev == '\\') && (cPrev == '\r') && (c == '\n') )
    {
      discard();
    }

  cPrevPrev = cPrev;
  cPrev =  c;
}}

This file is part of the LLOOP Reversible Object-Oriented Parser Generator. Copyright (c) 2005-2006 Michel MEHL, France. All rights reserved. LLOOP is distributed by the company ERSA SaRL.


Copyright (c) 2005-2006 Michel MEHL, Haguenau, France
LLOOP version 1.1