summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Scanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Scanner.cpp')
-rw-r--r--cpp/src/Slice/Scanner.cpp81
1 files changed, 51 insertions, 30 deletions
diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp
index 0b5d6f11a4c..f18e3165c68 100644
--- a/cpp/src/Slice/Scanner.cpp
+++ b/cpp/src/Slice/Scanner.cpp
@@ -75,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
@@ -106,6 +105,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -162,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.
@@ -555,7 +564,6 @@ char *slice_text;
//
// **********************************************************************
-#include <IceUtil/ScannerConfig.h>
#include <Slice/GrammarUtil.h> // Before Grammer.h, so that YYSTYPE is defined
#include <Slice/Grammar.h>
#include <IceUtil/InputUtil.h>
@@ -576,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;
@@ -597,7 +613,7 @@ int checkKeyword(string&);
-#line 599 "lex.yy.c"
+#line 615 "lex.yy.c"
#define INITIAL 0
#define BOMSCAN 1
@@ -680,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. */
@@ -699,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; \
@@ -784,10 +805,10 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 68 "Scanner.l"
+#line 75 "Scanner.l"
-#line 789 "lex.yy.c"
+#line 810 "lex.yy.c"
if ( !(yy_init) )
{
@@ -872,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 70 "Scanner.l"
+#line 77 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -886,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 77 "Scanner.l"
+#line 84 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -899,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 84 "Scanner.l"
+#line 91 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -913,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 91 "Scanner.l"
+#line 98 "Scanner.l"
{
if(unit->scanPosition(slice_text))
{
@@ -923,7 +944,7 @@ YY_RULE_SETUP
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 98 "Scanner.l"
+#line 105 "Scanner.l"
{
// C++-style comment
BEGIN(MAINSCAN);
@@ -941,7 +962,7 @@ YY_RULE_SETUP
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 113 "Scanner.l"
+#line 120 "Scanner.l"
{
// C-style comment
BEGIN(MAINSCAN);
@@ -985,7 +1006,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 154 "Scanner.l"
+#line 161 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_SCOPE_DELIMITER;
@@ -993,7 +1014,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 159 "Scanner.l"
+#line 166 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_METADATA_OPEN;
@@ -1001,7 +1022,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 164 "Scanner.l"
+#line 171 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_METADATA_CLOSE;
@@ -1009,7 +1030,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 169 "Scanner.l"
+#line 176 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_GLOBAL_METADATA_OPEN;
@@ -1017,7 +1038,7 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 174 "Scanner.l"
+#line 181 "Scanner.l"
{
BEGIN(MAINSCAN);
return ICE_GLOBAL_METADATA_CLOSE;
@@ -1026,7 +1047,7 @@ YY_RULE_SETUP
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
-#line 179 "Scanner.l"
+#line 186 "Scanner.l"
{
BEGIN(MAINSCAN);
StringTokPtr ident = new StringTok;
@@ -1054,7 +1075,7 @@ YY_RULE_SETUP
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 204 "Scanner.l"
+#line 211 "Scanner.l"
{
BEGIN(MAINSCAN);
StringTokPtr ident = new StringTok;
@@ -1065,7 +1086,7 @@ YY_RULE_SETUP
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 212 "Scanner.l"
+#line 219 "Scanner.l"
{
BEGIN(MAINSCAN);
StringTokPtr str = new StringTok;
@@ -1229,7 +1250,7 @@ YY_RULE_SETUP
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 373 "Scanner.l"
+#line 380 "Scanner.l"
{
BEGIN(MAINSCAN);
IntegerTokPtr itp = new IntegerTok;
@@ -1248,7 +1269,7 @@ YY_RULE_SETUP
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 389 "Scanner.l"
+#line 396 "Scanner.l"
{
BEGIN(MAINSCAN);
errno = 0;
@@ -1282,7 +1303,7 @@ YY_RULE_SETUP
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
-#line 419 "Scanner.l"
+#line 426 "Scanner.l"
{
// Ignore white-space
@@ -1298,7 +1319,7 @@ YY_RULE_SETUP
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 432 "Scanner.l"
+#line 439 "Scanner.l"
{
// Ignore UTF-8 BOM, rule only active when parsing start of file.
@@ -1307,7 +1328,7 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 438 "Scanner.l"
+#line 445 "Scanner.l"
{
BEGIN(MAINSCAN);
if(slice_text[0] < 32 || slice_text[0] > 126)
@@ -1326,10 +1347,10 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 454 "Scanner.l"
+#line 461 "Scanner.l"
ECHO;
YY_BREAK
-#line 1331 "lex.yy.c"
+#line 1352 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(BOMSCAN):
case YY_STATE_EOF(MAINSCAN):
@@ -2089,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.
*/
@@ -2329,7 +2350,7 @@ void slice_free (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 454 "Scanner.l"
+#line 461 "Scanner.l"