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

byte.gsp

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



/**
 * Any byte, inclusive those standing for whitespace chars.
 */

token ByteToken extends class universal::String() 
alias "Byte", "byte", "anychar"
parse
{{
  char c = 0;        		
  cancelWhitespaceEating();
  setEmpty();
  is.get(c);
  if (!is.fail()) 
    append(c);
  else
    abort("");
}}

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

test
{{
  "x": pass {x}
  "1": pass {1}
  "a": pass {a}
  "\\n": pass "\n"
  "bb": fail {bb}
}}

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