Parsers generated with latest version of bison/flex

git-svn-id: http://svn.opennebula.org/one/trunk@384 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Rubén S. Montero committed 2009-03-06 12:07:32 +00:00
1 parent 8364c1cb5c
commit cd0cf1fcd8
6 files changed
+187 -73

No files matched your search

+1 -1
View File
@@ -320,7 +320,7 @@ extern "C"
int host_rank_parse(Host * host, int& result, char ** errmsg);
void host_lex_destroy();
int host_lex_destroy();
YY_BUFFER_STATE host__scan_string(const char * str);
+38 -15
View File
@@ -28,7 +28,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -73,7 +73,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
@@ -104,6 +103,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -211,13 +212,6 @@ extern FILE *host_in, *host_out;
#define unput(c) yyunput( c, (yytext_ptr) )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
@@ -498,7 +492,7 @@ int host__flex_debug = 0;
char *host_text;
#line 1 "host_parser.l"
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2008, Distributed Systems Architecture Group, Universidad */
/* Copyright 2002-2009, Distributed Systems Architecture Group, Universidad */
/* Complutense de Madrid (dsa-research.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
@@ -527,7 +521,7 @@ char *host_text;
#define YY_USER_ACTION llocp->first_line = host_lineno; \
llocp->first_column = llocp->last_column; \
llocp->last_column += host_leng;
#line 531 "host_parser.c"
#line 525 "host_parser.c"
#define INITIAL 0
@@ -545,6 +539,35 @@ char *host_text;
static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int host_lex_destroy (void );
int host_get_debug (void );
void host_set_debug (int debug_flag );
YY_EXTRA_TYPE host_get_extra (void );
void host_set_extra (YY_EXTRA_TYPE user_defined );
FILE *host_get_in (void );
void host_set_in (FILE * in_str );
FILE *host_get_out (void );
void host_set_out (FILE * out_str );
int host_get_leng (void );
char *host_get_text (void );
int host_get_lineno (void );
void host_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -585,7 +608,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO fwrite( host_text, host_leng, 1, host_out )
#define ECHO do { if (fwrite( host_text, host_leng, 1, host_out )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -596,7 +619,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
int n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( host_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -682,7 +705,7 @@ YY_DECL
/* --- Tokens --- */
#line 686 "host_parser.c"
#line 709 "host_parser.c"
if ( !(yy_init) )
{
@@ -819,7 +842,7 @@ YY_RULE_SETUP
#line 64 "host_parser.l"
ECHO;
YY_BREAK
#line 823 "host_parser.c"
#line 846 "host_parser.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
+33 -10
View File
@@ -13,7 +13,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -58,7 +58,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
@@ -89,6 +88,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -126,13 +127,6 @@ extern int host_leng;
extern FILE *host_in, *host_out;
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
@@ -229,6 +223,35 @@ extern char *host_text;
#define YY_EXTRA_TYPE void *
#endif
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int host_lex_destroy (void );
int host_get_debug (void );
void host_set_debug (int debug_flag );
YY_EXTRA_TYPE host_get_extra (void );
void host_set_extra (YY_EXTRA_TYPE user_defined );
FILE *host_get_in (void );
void host_set_in (FILE * in_str );
FILE *host_get_out (void );
void host_set_out (FILE * out_str );
int host_get_leng (void );
char *host_get_text (void );
int host_get_lineno (void );
void host_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -291,6 +314,6 @@ extern int host_lex (void);
#line 64 "host_parser.l"
#line 295 "host_parser.h"
#line 318 "host_parser.h"
#undef host_IN_HEADER
#endif /* host_HEADER_H */
+44 -22
View File
@@ -19,7 +19,7 @@
#include "Template.h"
#include "template_syntax.h"
extern "C"
extern "C"
{
#include "template_parser.h"
}
@@ -46,7 +46,7 @@ extern "C"
{
int template_parse(Template * tmpl, char ** errmsg);
void template_lex_destroy();
int template_lex_destroy();
YY_BUFFER_STATE template__scan_string(const char * str);
@@ -97,7 +97,7 @@ int Template::parse(const string &parse_str, char **error_msg)
YY_BUFFER_STATE str_buffer;
const char * str;
int rc;
pthread_mutex_lock(&mutex);
*error_msg = 0;
@@ -137,7 +137,7 @@ void Template::marshall(string &str, const char delim)
{
multimap<string,Attribute *>::iterator it;
string * attr;
for(it=attributes.begin(),str="";it!=attributes.end();it++)
{
attr = it->second->marshall();
@@ -148,7 +148,7 @@ void Template::marshall(string &str, const char delim)
}
str += it->first + "=" + *attr + delim;
delete attr;
}
}
@@ -156,13 +156,35 @@ void Template::marshall(string &str, const char delim)
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
int Template::remove(const string& name, vector<Attribute *>& values)
{
multimap<string, Attribute *>::iterator i;
pair<multimap<string, Attribute *>::iterator,
multimap<string, Attribute *>::iterator> index;
int j;
index = attributes.equal_range(name);
for ( i = index.first,j=0 ; i != index.second ; i++,j++ )
{
values.push_back(i->second);
}
attributes.erase(index.first,index.second);
return j;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
int Template::get(
const string& name,
const string& name,
vector<const Attribute*>& values) const
{
multimap<string, Attribute *>::const_iterator i;
pair<multimap<string, Attribute *>::const_iterator,
multimap<string, Attribute *>::const_iterator> index;
multimap<string, Attribute *>::const_iterator> index;
int j;
index = attributes.equal_range(name);
@@ -179,18 +201,18 @@ int Template::get(
/* -------------------------------------------------------------------------- */
int Template::get(
const string& name,
const string& name,
vector<Attribute*>& values)
{
multimap<string, Attribute *>::iterator i;
pair<multimap<string, Attribute *>::iterator,
multimap<string, Attribute *>::iterator> index;
multimap<string, Attribute *>::iterator> index;
int j;
index = attributes.equal_range(name);
for ( i = index.first,j=0 ; i != index.second ; i++,j++ )
{
{
values.push_back(i->second);
}
@@ -217,18 +239,18 @@ void Template::get(
value = "";
return;
}
sattr = dynamic_cast<const SingleAttribute *>(attrs[0]);
if ( sattr != 0 )
{
value = sattr->value();
value = sattr->value();
}
else
{
value="";
}
}
}
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@@ -249,8 +271,8 @@ void Template::get(
istringstream iss(sval);
iss >> value;
}
iss >> value;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@@ -260,9 +282,9 @@ void Template::to_xml(string& xml) const
multimap<string,Attribute *>::const_iterator it;
ostringstream oss;
string * s;
oss << "<" << xml_root << ">";
for ( it = attributes.begin(); it!=attributes.end(); it++)
{
s = it->second->to_xml();
@@ -271,9 +293,9 @@ void Template::to_xml(string& xml) const
delete s;
}
oss << "</" << xml_root << ">";
xml = oss.str();
}
@@ -284,7 +306,7 @@ ostream& operator << (ostream& os, Template& t)
{
multimap<string,Attribute *>::iterator it;
string * s;
for ( it = t.attributes.begin(); it!=t.attributes.end(); it++)
{
s = it->second->marshall(",");
@@ -293,7 +315,7 @@ ostream& operator << (ostream& os, Template& t)
delete s;
}
return os;
}
+38 -15
View File
@@ -28,7 +28,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -73,7 +73,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
@@ -104,6 +103,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -211,13 +212,6 @@ extern FILE *template_in, *template_out;
#define unput(c) yyunput( c, (yytext_ptr) )
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
@@ -516,7 +510,7 @@ int template__flex_debug = 0;
char *template_text;
#line 1 "template_parser.l"
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2008, Distributed Systems Architecture Group, Universidad */
/* Copyright 2002-2009, Distributed Systems Architecture Group, Universidad */
/* Complutense de Madrid (dsa-research.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
@@ -544,7 +538,7 @@ char *template_text;
#define YY_USER_ACTION llocp->first_line = template_lineno; \
llocp->first_column = llocp->last_column; \
llocp->last_column += template_leng;
#line 548 "template_parser.c"
#line 542 "template_parser.c"
#define INITIAL 0
@@ -562,6 +556,35 @@ char *template_text;
static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int template_lex_destroy (void );
int template_get_debug (void );
void template_set_debug (int debug_flag );
YY_EXTRA_TYPE template_get_extra (void );
void template_set_extra (YY_EXTRA_TYPE user_defined );
FILE *template_get_in (void );
void template_set_in (FILE * in_str );
FILE *template_get_out (void );
void template_set_out (FILE * out_str );
int template_get_leng (void );
char *template_get_text (void );
int template_get_lineno (void );
void template_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -602,7 +625,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO fwrite( template_text, template_leng, 1, template_out )
#define ECHO do { if (fwrite( template_text, template_leng, 1, template_out )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -613,7 +636,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
int n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( template_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -702,7 +725,7 @@ YY_DECL
/* --- Comments and blanks --- */
#line 706 "template_parser.c"
#line 729 "template_parser.c"
if ( !(yy_init) )
{
@@ -869,7 +892,7 @@ YY_RULE_SETUP
#line 66 "template_parser.l"
ECHO;
YY_BREAK
#line 873 "template_parser.c"
#line 896 "template_parser.c"
case YY_STATE_EOF(INITIAL):
yyterminate();
+33 -10
View File
@@ -13,7 +13,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -58,7 +58,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
@@ -89,6 +88,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -126,13 +127,6 @@ extern int template_leng;
extern FILE *template_in, *template_out;
/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
@@ -229,6 +223,35 @@ extern char *template_text;
#define YY_EXTRA_TYPE void *
#endif
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int template_lex_destroy (void );
int template_get_debug (void );
void template_set_debug (int debug_flag );
YY_EXTRA_TYPE template_get_extra (void );
void template_set_extra (YY_EXTRA_TYPE user_defined );
FILE *template_get_in (void );
void template_set_in (FILE * in_str );
FILE *template_get_out (void );
void template_set_out (FILE * out_str );
int template_get_leng (void );
char *template_get_text (void );
int template_get_lineno (void );
void template_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
@@ -291,6 +314,6 @@ extern int template_lex (void);
#line 66 "template_parser.l"
#line 295 "template_parser.h"
#line 318 "template_parser.h"
#undef template_IN_HEADER
#endif /* template_HEADER_H */