2 * Provides basic utility functions to convert between
\r
3 * the various Unicode character conversions. There are of
\r
4 * course various packages that could be used instead of these
\r
5 * functions, but then the Antlr 3 C runtime would be dependant
\r
6 * on the particular package. Using ICU for this is a good idea if
\r
7 * your project is already dependant on it.
\r
10 // [The "BSD licence"]
\r
11 // Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
\r
12 // http://www.temporal-wave.com
\r
13 // http://www.linkedin.com/in/jimidle
\r
15 // All rights reserved.
\r
17 // Redistribution and use in source and binary forms, with or without
\r
18 // modification, are permitted provided that the following conditions
\r
20 // 1. Redistributions of source code must retain the above copyright
\r
21 // notice, this list of conditions and the following disclaimer.
\r
22 // 2. Redistributions in binary form must reproduce the above copyright
\r
23 // notice, this list of conditions and the following disclaimer in the
\r
24 // documentation and/or other materials provided with the distribution.
\r
25 // 3. The name of the author may not be used to endorse or promote products
\r
26 // derived from this software without specific prior written permission.
\r
28 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
\r
29 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
\r
30 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
\r
31 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
\r
32 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
\r
33 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
\r
34 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
\r
35 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
\r
36 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
\r
37 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
41 /// Convert 8 bit character to ANTLR char form.
\r
43 /// \param[in] inc Input character to transform in 8 bit ASCII form.
\r
44 /// \return ANTLR3_UCHAR encoding of the character.
\r
47 ANTLR3_UCHAR antlr3c8toAntlrc(ANTLR3_INT8 inc)
\r
49 return (ANTLR3_UCHAR)(inc);
\r