summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Scanner.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-08-08 15:49:02 +0200
committerBenoit Foucher <benoit@zeroc.com>2012-08-08 15:49:02 +0200
commit5bee6b7dd838a7b8b84a1b41251579a05e6aa8ec (patch)
tree71f7dd2a1096dab81bd8ddb4e17d5ac42f38c65d /cpp/src/Slice/Scanner.cpp
parentFixes (diff)
parentFixed python & ruby compilation error caused by OutputStream::format removal (diff)
downloadice-5bee6b7dd838a7b8b84a1b41251579a05e6aa8ec.tar.bz2
ice-5bee6b7dd838a7b8b84a1b41251579a05e6aa8ec.tar.xz
ice-5bee6b7dd838a7b8b84a1b41251579a05e6aa8ec.zip
Merge remote-tracking branch 'origin/encoding11' into mx
Diffstat (limited to 'cpp/src/Slice/Scanner.cpp')
-rw-r--r--cpp/src/Slice/Scanner.cpp85
1 files changed, 54 insertions, 31 deletions
diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp
index 40aafc1f528..f18e3165c68 100644
--- a/cpp/src/Slice/Scanner.cpp
+++ b/cpp/src/Slice/Scanner.cpp
@@ -1,4 +1,5 @@
#include <IceUtil/Config.h>
+#include <stdint.h>
#line 2 "lex.yy.c"
#line 4 "lex.yy.c"
@@ -74,7 +75,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -105,6 +105,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -161,7 +163,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -574,6 +584,14 @@ char *slice_text;
# pragma warning( 4 : 4244 )
#endif
+#ifdef _MSC_VER
+# ifdef slice_wrap
+# undef slice_wrap
+# define slice_wrap() 1
+# endif
+# define YY_NO_UNISTD_H
+#endif
+
using namespace std;
using namespace Slice;
@@ -595,7 +613,7 @@ int checkKeyword(string&);
-#line 598 "lex.yy.c"
+#line 615 "lex.yy.c"
#define INITIAL 0
#define BOMSCAN 1
@@ -678,7 +696,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -697,7 +720,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- unsigned n; \
+ size_t n; \
for ( n = 0; n < max_size && \
(c = getc( slice_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -782,10 +805,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 67 "Scanner.l"
+#line 75 "Scanner.l"
-#line 788 "lex.yy.c"
+#line 810 "lex.yy.c"
if ( !(yy_init) )
{
@@ -870,7 +893,7 @@ case 1:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up slice_text again */
YY_RULE_SETUP
-#line 69 "Scanner.l"
+#line 77 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -884,7 +907,7 @@ case 2:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up slice_text again */
YY_RULE_SETUP
-#line 76 "Scanner.l"
+#line 84 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -897,7 +920,7 @@ case 3:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up slice_text again */
YY_RULE_SETUP
-#line 83 "Scanner.l"
+#line 91 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -911,7 +934,7 @@ case 4:
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up slice_text again */
YY_RULE_SETUP
-#line 90 "Scanner.l"
+#line 98 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -921,7 +944,7 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 97 "Scanner.l"
+#line 105 "Scanner.l"
{
// C++-style comment
BEGIN(MAINSCAN);
@@ -939,7 +962,7 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 112 "Scanner.l"
+#line 120 "Scanner.l"
{
// C-style comment
BEGIN(MAINSCAN);
@@ -983,7 +1006,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 153 "Scanner.l"
+#line 161 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_SCOPE_DELIMITER;
@@ -991,7 +1014,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 158 "Scanner.l"
+#line 166 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_METADATA_OPEN;
@@ -999,7 +1022,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 163 "Scanner.l"
+#line 171 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_METADATA_CLOSE;
@@ -1007,7 +1030,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 168 "Scanner.l"
+#line 176 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_GLOBAL_METADATA_OPEN;
@@ -1015,7 +1038,7 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 173 "Scanner.l"
+#line 181 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_GLOBAL_METADATA_CLOSE;
@@ -1024,7 +1047,7 @@ YY_RULE_SETUP
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
-#line 178 "Scanner.l"
+#line 186 "Scanner.l"
{
BEGIN(MAINSCAN);
StringTokPtr ident = new StringTok;
@@ -1052,7 +1075,7 @@ YY_RULE_SETUP
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 203 "Scanner.l"
+#line 211 "Scanner.l"
{
BEGIN(MAINSCAN);
StringTokPtr ident = new StringTok;
@@ -1063,7 +1086,7 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 211 "Scanner.l"
+#line 219 "Scanner.l"
{
BEGIN(MAINSCAN);
StringTokPtr str = new StringTok;
@@ -1227,7 +1250,7 @@ YY_RULE_SETUP
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 372 "Scanner.l"
+#line 380 "Scanner.l"
{
BEGIN(MAINSCAN);
IntegerTokPtr itp = new IntegerTok;
@@ -1246,7 +1269,7 @@ YY_RULE_SETUP
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 388 "Scanner.l"
+#line 396 "Scanner.l"
{
BEGIN(MAINSCAN);
errno = 0;
@@ -1280,7 +1303,7 @@ YY_RULE_SETUP
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 418 "Scanner.l"
+#line 426 "Scanner.l"
{
// Ignore white-space
@@ -1296,7 +1319,7 @@ YY_RULE_SETUP
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 431 "Scanner.l"
+#line 439 "Scanner.l"
{
// Ignore UTF-8 BOM, rule only active when parsing start of file.
@@ -1305,7 +1328,7 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 437 "Scanner.l"
+#line 445 "Scanner.l"
{
BEGIN(MAINSCAN);
if(slice_text[0] < 32 || slice_text[0] > 126)
@@ -1324,10 +1347,10 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 453 "Scanner.l"
+#line 461 "Scanner.l"
ECHO;
YY_BREAK
-#line 1330 "lex.yy.c"
+#line 1352 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(BOMSCAN):
case YY_STATE_EOF(MAINSCAN):
@@ -1408,7 +1431,7 @@ case YY_STATE_EOF(MAINSCAN):
{
(yy_did_buffer_switch_on_eof) = 0;
- if ( slice_wrap(0) )
+ if ( slice_wrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1744,7 +1767,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
- if ( slice_wrap(0) )
+ if ( slice_wrap( ) )
return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
@@ -2087,8 +2110,8 @@ YY_BUFFER_STATE slice__scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to slice_lex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
@@ -2327,7 +2350,7 @@ void slice_free (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 453 "Scanner.l"
+#line 461 "Scanner.l"