summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp434
1 files changed, 177 insertions, 257 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp b/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp
index c3f0c5d4e28..a451f98e6a9 100644
--- a/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp
+++ b/TAO/orbsvcs/orbsvcs/Trader/Constraint_l.cpp
@@ -1,18 +1,15 @@
-#define YY_NO_UNPUT
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Id$
+ * $Header$
*/
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#include "ace/os_include/os_stdio.h"
-#include "ace/OS_NS_unistd.h"
-#include /**/ "tao/Versioned_Namespace.h"
-
+#include "tao/orbconf.h"
+#include "ace/OS.h"
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
@@ -24,7 +21,6 @@
#ifdef __cplusplus
-
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
@@ -41,13 +37,6 @@
#endif /* __STDC__ */
#endif /* ! __cplusplus */
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
#ifdef YY_USE_CONST
#define yyconst const
#else
@@ -283,18 +272,19 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 32
-#define YY_END_OF_BUFFER 33
-static yyconst short int yy_accept[81] =
+#define YY_NUM_RULES 31
+#define YY_END_OF_BUFFER 32
+static yyconst short int yy_accept[82] =
{ 0,
- 0, 0, 33, 31, 30, 31, 31, 22, 23, 14,
- 12, 13, 31, 15, 26, 16, 31, 18, 29, 29,
+ 0, 0, 32, 30, 31, 30, 30, 22, 23, 14,
+ 12, 13, 30, 15, 26, 16, 30, 18, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
- 11, 21, 0, 28, 0, 0, 26, 27, 17, 20,
- 19, 29, 29, 29, 29, 29, 29, 10, 29, 29,
- 29, 9, 29, 29, 0, 0, 29, 29, 8, 29,
- 29, 2, 1, 7, 29, 29, 0, 27, 29, 24,
- 29, 29, 29, 5, 25, 6, 3, 29, 4, 0
+ 11, 21, 0, 28, 0, 26, 27, 0, 26, 17,
+ 20, 19, 29, 29, 29, 29, 29, 29, 10, 29,
+ 29, 29, 9, 29, 29, 0, 0, 29, 29, 8,
+ 29, 29, 2, 1, 7, 29, 29, 0, 27, 29,
+ 24, 29, 29, 29, 5, 25, 6, 3, 29, 4,
+ 0
} ;
static yyconst int yy_ec[256] =
@@ -338,70 +328,70 @@ static yyconst int yy_meta[42] =
1
} ;
-static yyconst short int yy_base[83] =
+static yyconst short int yy_base[84] =
{ 0,
- 0, 0, 108, 109, 109, 93, 38, 109, 109, 109,
- 33, 34, 94, 109, 37, 91, 90, 89, 0, 86,
- 80, 66, 59, 66, 63, 21, 61, 59, 67, 61,
- 109, 109, 46, 109, 47, 80, 42, 44, 109, 109,
- 109, 0, 71, 66, 61, 56, 51, 0, 46, 51,
- 46, 0, 49, 44, 51, 49, 59, 62, 0, 42,
- 38, 0, 0, 0, 46, 39, 57, 56, 49, 0,
- 28, 27, 29, 0, 0, 0, 0, 27, 0, 109,
- 76, 57
+ 0, 0, 107, 108, 108, 92, 38, 108, 108, 108,
+ 93, 92, 91, 108, 33, 88, 87, 86, 0, 83,
+ 77, 63, 56, 63, 60, 17, 58, 56, 64, 58,
+ 108, 108, 42, 108, 43, 77, 36, 76, 40, 108,
+ 108, 108, 0, 67, 62, 57, 52, 47, 0, 42,
+ 47, 42, 0, 45, 40, 47, 47, 55, 58, 0,
+ 38, 34, 0, 0, 0, 42, 38, 54, 52, 44,
+ 0, 23, 22, 23, 0, 0, 0, 0, 24, 0,
+ 108, 72, 51
} ;
-static yyconst short int yy_def[83] =
+static yyconst short int yy_def[84] =
{ 0,
- 80, 1, 80, 80, 80, 80, 81, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 80, 80, 81, 80, 80, 80, 80, 80, 80, 80,
- 80, 82, 82, 82, 82, 82, 82, 82, 82, 82,
- 82, 82, 82, 82, 81, 80, 82, 82, 82, 82,
- 82, 82, 82, 82, 82, 82, 80, 80, 82, 82,
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 0,
- 80, 80
+ 81, 1, 81, 81, 81, 81, 82, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
+ 81, 81, 82, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 83, 83, 83, 83, 83, 83, 83, 83,
+ 83, 83, 83, 83, 83, 82, 81, 83, 83, 83,
+ 83, 83, 83, 83, 83, 83, 83, 81, 81, 83,
+ 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
+ 0, 81, 81
} ;
-static yyconst short int yy_nxt[151] =
+static yyconst short int yy_nxt[150] =
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 19, 19, 20, 19,
19, 19, 21, 19, 4, 4, 22, 19, 23, 24,
19, 25, 26, 27, 28, 29, 19, 19, 30, 19,
- 31, 34, 36, 36, 37, 37, 36, 49, 37, 34,
- 55, 36, 50, 37, 34, 38, 67, 67, 42, 79,
- 68, 56, 35, 78, 77, 76, 75, 68, 68, 74,
- 35, 55, 56, 73, 72, 35, 33, 33, 71, 70,
- 69, 66, 65, 64, 63, 62, 61, 60, 59, 58,
- 57, 38, 54, 53, 52, 51, 48, 47, 46, 45,
-
- 44, 43, 41, 40, 39, 38, 32, 80, 3, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80
+ 31, 34, 38, 50, 39, 34, 56, 37, 51, 38,
+ 34, 39, 43, 57, 68, 68, 80, 79, 69, 78,
+ 77, 76, 35, 69, 57, 69, 35, 56, 75, 74,
+ 73, 35, 33, 33, 72, 71, 70, 67, 66, 65,
+ 64, 63, 62, 61, 60, 59, 58, 37, 36, 55,
+ 54, 53, 52, 49, 48, 47, 46, 45, 44, 42,
+
+ 41, 40, 37, 36, 36, 32, 81, 3, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81
} ;
-static yyconst short int yy_chk[151] =
+static yyconst short int yy_chk[150] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 7, 11, 12, 11, 12, 15, 26, 15, 33,
- 35, 37, 26, 37, 55, 38, 56, 56, 82, 78,
- 56, 38, 7, 73, 72, 71, 69, 68, 67, 66,
- 33, 35, 38, 65, 61, 55, 81, 81, 60, 58,
- 57, 54, 53, 51, 50, 49, 47, 46, 45, 44,
- 43, 36, 30, 29, 28, 27, 25, 24, 23, 22,
-
- 21, 20, 18, 17, 16, 13, 6, 3, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80
+ 1, 7, 15, 26, 15, 33, 35, 37, 26, 39,
+ 56, 39, 83, 37, 57, 57, 79, 74, 57, 73,
+ 72, 70, 7, 69, 37, 68, 33, 35, 67, 66,
+ 62, 56, 82, 82, 61, 59, 58, 55, 54, 52,
+ 51, 50, 48, 47, 46, 45, 44, 38, 36, 30,
+ 29, 28, 27, 25, 24, 23, 22, 21, 20, 18,
+
+ 17, 16, 13, 12, 11, 6, 3, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81
} ;
static yy_state_type yy_last_accepting_state;
@@ -415,7 +405,9 @@ static char *yy_last_accepting_cpos;
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
+
#define INITIAL 0
+
TAO_END_VERSIONED_NAMESPACE_DECL
// $Id$
@@ -423,7 +415,7 @@ TAO_END_VERSIONED_NAMESPACE_DECL
//
// = LIBRARY
// orbsvcs
-//
+//
// = FILENAME
// constraint.l
//
@@ -439,8 +431,6 @@ TAO_END_VERSIONED_NAMESPACE_DECL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
static TAO_Literal_Constraint* extract_string(const char*);
-static CORBA::LongLong trader_strtoll(const char* str, unsigned int base);
-static CORBA::ULongLong trader_strtoull(const char* str, unsigned int base);
#define TAO_YY_LEX_DEBUG
@@ -450,6 +440,7 @@ static CORBA::ULongLong trader_strtoull(const char* str, unsigned int base);
+
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -462,9 +453,11 @@ extern int yywrap YY_PROTO(( void ));
#endif
#endif
+#if 0
#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif
+#endif /* 0 */
#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
@@ -509,6 +502,7 @@ YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
+#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines. This will fail
@@ -588,7 +582,7 @@ YY_MALLOC_DECL
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK ACE_NOTREACHED (break;)
+#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
@@ -605,6 +599,8 @@ YY_DECL
+
+
if ( yy_init )
{
yy_init = 0;
@@ -654,13 +650,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 81 )
+ if ( yy_current_state >= 82 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 109 );
+ while ( yy_base[yy_current_state] != 108 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -688,167 +684,186 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_MIN; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 2:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_MAX; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 3:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_FIRST; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 4:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_RANDOM; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 5:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_WITH; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 6:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_EXIST; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 7:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_NOT; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 8:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_AND; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 9:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_OR; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 10:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_IN; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 11:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_TWIDDLE; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 12:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_PLUS; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 13:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_MINUS; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 14:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_MULT; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 15:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_DIV; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 16:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_LT; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 17:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_LE; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 18:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_GT; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 19:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_GE; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 20:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_EQ; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 21:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_NE; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 22:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_LPAREN; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 23:
YY_RULE_SETUP
+
{ TAO_YY_LEX_DEBUG; return TAO_RPAREN; }
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 24:
YY_RULE_SETUP
-{
- yylval.constraint_ =
- new TAO_Literal_Constraint(true);
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint(true);
TAO_YY_LEX_DEBUG; return TAO_BOOLEAN;
}
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 25:
YY_RULE_SETUP
-{
- yylval.constraint_ =
- new TAO_Literal_Constraint(false);
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint(false);
TAO_YY_LEX_DEBUG; return TAO_BOOLEAN;
}
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 26:
YY_RULE_SETUP
-{
- if (yytext[0] == '-')
- {
- yylval.constraint_ =
- new TAO_Literal_Constraint(
- trader_strtoll(yytext, 0));
- }
- else
- {
- yylval.constraint_ =
- new TAO_Literal_Constraint(
- trader_strtoull(yytext, 0));
- }
- TAO_YY_LEX_DEBUG; return TAO_NUMBER;
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint((yytext[0] == '-' ?
+ (CORBA::Long)atoi(yytext) : (CORBA::ULong)atoi(yytext)));
+ TAO_YY_LEX_DEBUG; return TAO_NUMBER;
}
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 27:
YY_RULE_SETUP
-{
- yylval.constraint_ =
- new TAO_Literal_Constraint(ACE_OS::strtod(yytext, 0));
- TAO_YY_LEX_DEBUG; return TAO_NUMBER;
+
+{
+ yylval.constraint_ =
+ new TAO_Literal_Constraint((CORBA::Double)atof(yytext));
+ TAO_YY_LEX_DEBUG; return TAO_NUMBER;
}
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 28:
YY_RULE_SETUP
-{
+
+{
yylval.constraint_ = extract_string(yytext);
- TAO_YY_LEX_DEBUG; return TAO_STRING;
+ TAO_YY_LEX_DEBUG; return TAO_STRING;
}
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 29:
YY_RULE_SETUP
-{
- yylval.constraint_ =
+
+{
+ yylval.constraint_ =
new TAO_Property_Constraint(yytext);
- TAO_YY_LEX_DEBUG; return TAO_IDENT;
+ TAO_YY_LEX_DEBUG; return TAO_IDENT;
}
- YY_BREAK
+ ACE_NOTREACHED (YY_BREAK)
case 30:
YY_RULE_SETUP
-{}
- break;
-case 31:
-YY_RULE_SETUP
-{
+
+{
TAO_YY_LEX_DEBUG; return TAO_UNKNOWN;
}
- YY_BREAK
-case 32:
+ ACE_NOTREACHED (YY_BREAK)
+case 31:
YY_RULE_SETUP
+
TAO_TRADER_ECHO;
- break;
+ YY_BREAK
+
case YY_STATE_EOF(INITIAL):
yyterminate();
@@ -1140,7 +1155,7 @@ static yy_state_type yy_get_previous_state()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 81 )
+ if ( yy_current_state >= 82 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1175,16 +1190,16 @@ yy_state_type yy_current_state;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 81 )
+ if ( yy_current_state >= 82 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 80);
+ yy_is_jam = (yy_current_state == 81);
return yy_is_jam ? 0 : yy_current_state;
}
-
+#if 0
#ifndef YY_NO_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
@@ -1228,9 +1243,8 @@ register char *yy_bp;
yy_c_buf_p = yy_cp;
}
#endif /* ifndef YY_NO_UNPUT */
+#endif /* 0 */
-
-#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
@@ -1253,7 +1267,7 @@ static int input()
else
{ /* need more input */
- size_t offset = yy_c_buf_p - yytext_ptr;
+ int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
@@ -1302,7 +1316,7 @@ static int input()
return c;
}
-#endif /* YY_NO_INPUT */
+
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
@@ -1429,15 +1443,18 @@ FILE *file;
b->yy_input_file = file;
b->yy_fill_buffer = 1;
-#if YY_ALWAYS_INTERACTIVE
- b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
- b->yy_is_interactive = 0;
+#if defined (ACE_HAS_WINCE)
+ // Mimic the behavior as WinCE does not have isatty().
+ if ((file != 0) && (file == fileno(file))) {
+ b->yy_is_interactive = 1;
+ }
+ else {
+ b->yy_is_interactive = 0;
+ }
#else
- b->yy_is_interactive = file ? (ACE_OS::isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif // ACE_HAS_WINCE
+
}
@@ -1732,10 +1749,11 @@ int main()
#endif
+
TAO_Literal_Constraint*
extract_string(const char* total)
{
- int prev_slash = 0,
+ int prev_slash = 0,
ctr = 0;
char str[BUFSIZ],
*tmp = (char*) total + 1;
@@ -1763,104 +1781,6 @@ extract_string(const char* total)
return new TAO_Literal_Constraint(str);
}
-CORBA::ULongLong
-trader_strtoull(const char* s, unsigned int base)
-{
- CORBA::ULongLong result = 0;
- CORBA::ULongLong previous = 0;
-
- // Check for a valid base
- if (!(base == 0 || base == 8 || base == 10 || base == 16))
- {
- errno = EINVAL;
- return result;
- }
-
- if (*s == '+')
- {
- s++;
- }
-
- if ((base == 0 || base == 16) &&
- *s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))
- {
- s += 2;
- base = 16;
- }
- else if ((base == 0 || base == 8) && *s == '0')
- {
- s++;
- base = 8;
- }
- else
- {
- base = 10;
- }
-
- for (; *s; ++s)
- {
- if (base == 8 && *s <= '7' && *s >= '0')
- {
- result = (result * base) + (*s - '0');
- }
- else if (base > 8 && *s <= '9' && *s >= '0')
- {
- result = (result * base) + (*s - '0');
- }
- else if (base > 10 && *s <= 'f' && *s >= 'a')
- {
- result = (result * base) + (*s - 'a' + 10);
- }
- else if (base > 10 && *s <= 'F' && *s >= 'A')
- {
- result = (result * base) + (*s - 'A' + 10);
- }
- else
- {
- break;
- }
-
- // If the previous value is greater than result, then we have
- // exceeded the size of a CORBA::ULongLong and the result
- // will be ACE_UINT64_MAX. However, errno will be set to ERANGE
- if (previous > result)
- {
- errno = ERANGE;
- result = ACE_UINT64_MAX;
- break;
- }
- previous = result;
- }
-
- return result;
-}
-
-CORBA::LongLong
-trader_strtoll(const char* s, unsigned int base)
-{
- // Check for the negative sign
- bool negative = false;
- if (*s == '-')
- {
- negative = true;
- s++;
- }
-
- // Convert the raw text into a CORBA::LongLong
- CORBA::LongLong result = static_cast<CORBA::LongLong> (
- trader_strtoull(s, base));
-
- // If the result that comes back is negative, then the value exceeded
- // the maximum for CORBA::LongLong
- if (result < 0)
- {
- errno = ERANGE;
- return (negative ? ACE_INT64_MIN : ACE_INT64_MAX);
- }
-
- return (negative ? -result : result);
-}
-
int
yywrap (void)
{