]> gitweb.factorcode.org Git - factor.git/blob - factor/parser/CharLiteral.java
53aa0ff35f3248e6a79fc425fcdf852faf2ceba2
[factor.git] / factor / parser / CharLiteral.java
1 /* :folding=explicit:collapseFolds=1: */
2
3 /*
4  * $Id$
5  *
6  * Copyright (C) 2004 Slava Pestov.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  *    this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  *    this list of conditions and the following disclaimer in the documentation
16  *    and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * DEVELOPERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 package factor.parser;
31
32 import factor.*;
33 import java.io.IOException;
34
35 public class CharLiteral extends FactorParsingDefinition
36 {
37         //{{{ CharLiteral constructor
38         /**
39          * A new definition.
40          */
41         public CharLiteral(FactorWord word)
42                 throws Exception
43         {
44                 super(word);
45         } //}}}
46
47         public void eval(FactorInterpreter interp, FactorReader reader)
48                 throws IOException, FactorParseException
49         {
50                 reader.append(new Character(
51                         reader.getScanner()
52                         .readNonEOFEscaped()));
53         }
54 }