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

any.gsp

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



/**
 * Reads any multi-line sequence of chars with an end delimiter (any constant string). 
 * 
 * The Any token is a specialization of the BlockToken, whereby
 * the left delimiter is forced to an empty string value.
 */

token AnyToken extends token BlockToken() 
  alias "Any", "any"
  parse
  {{
    using namespace gsp;

    /* Ensure the string is empty.
     */

    setEmpty();

    /* Check whether the right delimiter is a valid constant.
     */
    
    const SymbolInfo& rightSym = getNextSymbolInfo(parser);
    if (!rightSym.isConstant())
      {
	cerr << "AnyToken: End delimiter '" << rightSym.representation() << "' is not a constant." << endl;
	abort("");
      }
    else
      {
	if (!readBlock("", rightSym.representation(),is, parser.ignoreCase()))
	  abort("");
      }
  }}

  expand
  {{
    os << toString();
  }}

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