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

id.gsp

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



/**
 * Reads a sequence of alphanumeric letters, underscores, colons, dots.
 */

token IdToken extends class universal::String()
  include <stdio.h>, <ctype.h>, "universal__String.h"
  alias "id", "identifier"
  parse
  {{ 
    setEmpty();

    char c = 0;        		
    is.get(c);
    while (isalnum(c) || (c == '_') || (c == ':') || (c == '.'))
    {
      append(c);
      c = 0; 
      is.get(c);	
    }
    
    if (empty())
      abort("");


    /* Set pos. to the immediate following char
     * If EOF was reached, this does nothing.
     */
    is.seekg(-1, ios::cur); 
  }}
  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