int main(void) {
#ifdef WIN32
- int s;
+ int s;
#else
- sem_t * s;
+ sem_t * s;
#endif
s = sem_open("/0", O_CREAT, 0644, 10);
if (s == SEM_FAILED){
"Messages specific for this Hello World example");
void main()
{
- XBT_INFO("Hello World !!!");
+ XBT_INFO("Hello World !!!");
}
static void action_reduce(const char *const *action)
{
- int i;
- char *reduce_identifier;
- char mailbox[80];
- double comm_size = parse_double(action[2]);
- double comp_size = parse_double(action[3]);
- m_task_t comp_task = NULL;
- const char *process_name;
- double clock = MSG_get_clock();
-
- process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
-
- xbt_assert(communicator_size, "Size of Communicator is not defined, "
- "can't use collective operations");
-
- process_name = MSG_process_get_name(MSG_process_self());
-
- reduce_identifier = bprintf("reduce_%d", counters->reduce_counter++);
-
- if (!strcmp(process_name, "p0")) {
- XBT_DEBUG("%s: %s is the Root", reduce_identifier, process_name);
-
- msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
- m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
- for (i = 1; i < communicator_size; i++) {
- sprintf(mailbox, "%s_p%d_p0", reduce_identifier, i);
- comms[i-1] = MSG_task_irecv(&(tasks[i-1]),mailbox);
- }
- MSG_comm_waitall(comms,communicator_size-1,-1);
- for (i = 1; i < communicator_size; i++) {
- MSG_comm_destroy(comms[i-1]);
- MSG_task_destroy(tasks[i-1]);
- }
- free(tasks);
-
- comp_task = MSG_task_create("reduce_comp", comp_size, 0, NULL);
- XBT_DEBUG("%s: computing 'reduce_comp'", reduce_identifier);
- MSG_task_execute(comp_task);
- MSG_task_destroy(comp_task);
- XBT_DEBUG("%s: computed", reduce_identifier);
-
- } else {
- XBT_DEBUG("%s: %s sends", reduce_identifier, process_name);
- sprintf(mailbox, "%s_%s_p0", reduce_identifier, process_name);
- XBT_DEBUG("put on %s", mailbox);
- MSG_task_send(MSG_task_create(reduce_identifier, 0, comm_size, NULL),
- mailbox);
- }
-
- XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
- free(reduce_identifier);
+ int i;
+ char *reduce_identifier;
+ char mailbox[80];
+ double comm_size = parse_double(action[2]);
+ double comp_size = parse_double(action[3]);
+ m_task_t comp_task = NULL;
+ const char *process_name;
+ double clock = MSG_get_clock();
+
+ process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
+
+ xbt_assert(communicator_size, "Size of Communicator is not defined, "
+ "can't use collective operations");
+
+ process_name = MSG_process_get_name(MSG_process_self());
+
+ reduce_identifier = bprintf("reduce_%d", counters->reduce_counter++);
+
+ if (!strcmp(process_name, "p0")) {
+ XBT_DEBUG("%s: %s is the Root", reduce_identifier, process_name);
+
+ msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
+ m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
+ for (i = 1; i < communicator_size; i++) {
+ sprintf(mailbox, "%s_p%d_p0", reduce_identifier, i);
+ comms[i-1] = MSG_task_irecv(&(tasks[i-1]),mailbox);
+ }
+ MSG_comm_waitall(comms,communicator_size-1,-1);
+ for (i = 1; i < communicator_size; i++) {
+ MSG_comm_destroy(comms[i-1]);
+ MSG_task_destroy(tasks[i-1]);
+ }
+ free(tasks);
+
+ comp_task = MSG_task_create("reduce_comp", comp_size, 0, NULL);
+ XBT_DEBUG("%s: computing 'reduce_comp'", reduce_identifier);
+ MSG_task_execute(comp_task);
+ MSG_task_destroy(comp_task);
+ XBT_DEBUG("%s: computed", reduce_identifier);
+
+ } else {
+ XBT_DEBUG("%s: %s sends", reduce_identifier, process_name);
+ sprintf(mailbox, "%s_%s_p0", reduce_identifier, process_name);
+ XBT_DEBUG("put on %s", mailbox);
+ MSG_task_send(MSG_task_create(reduce_identifier, 0, comm_size, NULL),
+ mailbox);
+ }
+
+ XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+ free(reduce_identifier);
}
static void action_bcast(const char *const *action)
{
- int i;
- char *bcast_identifier;
- char mailbox[80];
- double comm_size = parse_double(action[2]);
- m_task_t task = NULL;
- const char *process_name;
- double clock = MSG_get_clock();
-
- process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
-
- xbt_assert(communicator_size, "Size of Communicator is not defined, "
- "can't use collective operations");
-
- process_name = MSG_process_get_name(MSG_process_self());
-
- bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++);
-
- if (!strcmp(process_name, "p0")) {
- XBT_DEBUG("%s: %s is the Root", bcast_identifier, process_name);
-
- msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
-
- for (i = 1; i < communicator_size; i++) {
- sprintf(mailbox, "%s_p0_p%d", bcast_identifier, i);
- comms[i-1] =
- MSG_task_isend(MSG_task_create(mailbox,0,comm_size,NULL),
- mailbox);
- }
- MSG_comm_waitall(comms,communicator_size-1,-1);
- for (i = 1; i < communicator_size; i++)
- MSG_comm_destroy(comms[i-1]);
- free(comms);
-
- XBT_DEBUG("%s: all messages sent by %s have been received",
- bcast_identifier, process_name);
-
- } else {
- sprintf(mailbox, "%s_p0_%s", bcast_identifier, process_name);
- MSG_task_receive(&task, mailbox);
- MSG_task_destroy(task);
- XBT_DEBUG("%s: %s has received", bcast_identifier, process_name);
- }
-
- XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
- free(bcast_identifier);
+ int i;
+ char *bcast_identifier;
+ char mailbox[80];
+ double comm_size = parse_double(action[2]);
+ m_task_t task = NULL;
+ const char *process_name;
+ double clock = MSG_get_clock();
+
+ process_globals_t counters = (process_globals_t) MSG_process_get_data(MSG_process_self());
+
+ xbt_assert(communicator_size, "Size of Communicator is not defined, "
+ "can't use collective operations");
+
+ process_name = MSG_process_get_name(MSG_process_self());
+
+ bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++);
+
+ if (!strcmp(process_name, "p0")) {
+ XBT_DEBUG("%s: %s is the Root", bcast_identifier, process_name);
+
+ msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
+
+ for (i = 1; i < communicator_size; i++) {
+ sprintf(mailbox, "%s_p0_p%d", bcast_identifier, i);
+ comms[i-1] =
+ MSG_task_isend(MSG_task_create(mailbox,0,comm_size,NULL),
+ mailbox);
+ }
+ MSG_comm_waitall(comms,communicator_size-1,-1);
+ for (i = 1; i < communicator_size; i++)
+ MSG_comm_destroy(comms[i-1]);
+ free(comms);
+
+ XBT_DEBUG("%s: all messages sent by %s have been received",
+ bcast_identifier, process_name);
+
+ } else {
+ sprintf(mailbox, "%s_p0_%s", bcast_identifier, process_name);
+ MSG_task_receive(&task, mailbox);
+ MSG_task_destroy(task);
+ XBT_DEBUG("%s: %s has received", bcast_identifier, process_name);
+ }
+
+ XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+ free(bcast_identifier);
}
SURFXML_BUFFER_SET(route_dst, "host B");
A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
SURFXML_START_TAG(route);
- XBT_DEBUG(" <link:ctn id=\"LinkA\"/>");
+ XBT_DEBUG(" <link:ctn id=\"LinkA\"/>");
SURFXML_BUFFER_SET(link_ctn_id, "LinkA");
A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
SURFXML_START_TAG(link_ctn);
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++)
MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
- MSG_host_get_name(slaves[i]));
+ MSG_host_get_name(slaves[i]));
XBT_INFO("Goodbye now!");
free(slaves);
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++)
MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
- MSG_host_get_name(slaves[i]));
+ MSG_host_get_name(slaves[i]));
XBT_INFO("Goodbye now!");
free(slaves);
} else {
XBT_INFO("Hey ?! What's up ? ");
xbt_die("Unexpected behavior");
- }
+ }
}
XBT_INFO("I'm done. See you!");
return 0;
/** Bypass deployment **/
static int bypass_deployment(void)
{
- int nb_host,i;
- static int AX_ptr;
- static int surfxml_bufferstack_size = 2048;
- static int surfxml_buffer_stack_stack_ptr = 0;
- static int surfxml_buffer_stack_stack[1024];
- xbt_dynar_t hosts = MSG_hosts_as_dynar();
- /* allocating memory to the buffer, I think 2MB should be enough */
- surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
-
- nb_host = xbt_dynar_length(hosts);
- xbt_dynar_free(&hosts);
-
- /* <platform> */
- SURFXML_BUFFER_SET(platform_version, "3");
- SURFXML_START_TAG(platform);
- XBT_DEBUG("<platform version=\"3\">");
-
- XBT_DEBUG(" <process host=\"c-0.me\" function=\"master\">");
- SURFXML_BUFFER_SET(process_host, "c-0.me");
- SURFXML_BUFFER_SET(process_function, "master");
- SURFXML_BUFFER_SET(process_start_time, "-1.0");
- SURFXML_BUFFER_SET(process_kill_time, "-1.0");
- SURFXML_START_TAG(process);
-
- XBT_DEBUG(" <argument value=\"%s\"/>",bprintf("%d",nb_host-1));
- SURFXML_BUFFER_SET(argument_value, bprintf("%d",nb_host-1));
- SURFXML_START_TAG(argument);
- SURFXML_END_TAG(argument);
-
- XBT_DEBUG(" <argument value=\"5000000\"/>");
- SURFXML_BUFFER_SET(argument_value, "5000000");
- SURFXML_START_TAG(argument);
- SURFXML_END_TAG(argument);
-
- XBT_DEBUG(" <argument value=\"100000\"/>");
- SURFXML_BUFFER_SET(argument_value, "100000");
- SURFXML_START_TAG(argument);
- SURFXML_END_TAG(argument);
-
- for(i=1 ; i<nb_host ; i++)
- {
- XBT_DEBUG(" <argument value=\"%s.me\"/>",bprintf("c-%d",i));
- SURFXML_BUFFER_SET(argument_value, bprintf("c-%d.me",i));
- SURFXML_START_TAG(argument);
- SURFXML_END_TAG(argument);
- }
- XBT_DEBUG(" </process>");
- SURFXML_END_TAG(process);
-
- for(i=1 ; i<nb_host ; i++)
- {
- XBT_DEBUG(" <process host=\"%s.me\" function=\"slave\"/>",bprintf("c-%d",i));
- SURFXML_BUFFER_SET(process_host, bprintf("c-%d.me",i));
- SURFXML_BUFFER_SET(process_function, "slave");
- SURFXML_BUFFER_SET(process_start_time, "-1.0");
- SURFXML_BUFFER_SET(process_kill_time, "-1.0");
- SURFXML_START_TAG(process);
- SURFXML_END_TAG(process);
- }
-
- XBT_DEBUG("</platform>");
- SURFXML_END_TAG(platform);
-
- free(surfxml_bufferstack);
- return 0;
+ int nb_host,i;
+ static int AX_ptr;
+ static int surfxml_bufferstack_size = 2048;
+ static int surfxml_buffer_stack_stack_ptr = 0;
+ static int surfxml_buffer_stack_stack[1024];
+ xbt_dynar_t hosts = MSG_hosts_as_dynar();
+ /* allocating memory to the buffer, I think 2MB should be enough */
+ surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
+
+ nb_host = xbt_dynar_length(hosts);
+ xbt_dynar_free(&hosts);
+
+ /* <platform> */
+ SURFXML_BUFFER_SET(platform_version, "3");
+ SURFXML_START_TAG(platform);
+ XBT_DEBUG("<platform version=\"3\">");
+
+ XBT_DEBUG(" <process host=\"c-0.me\" function=\"master\">");
+ SURFXML_BUFFER_SET(process_host, "c-0.me");
+ SURFXML_BUFFER_SET(process_function, "master");
+ SURFXML_BUFFER_SET(process_start_time, "-1.0");
+ SURFXML_BUFFER_SET(process_kill_time, "-1.0");
+ SURFXML_START_TAG(process);
+
+ XBT_DEBUG(" <argument value=\"%s\"/>",bprintf("%d",nb_host-1));
+ SURFXML_BUFFER_SET(argument_value, bprintf("%d",nb_host-1));
+ SURFXML_START_TAG(argument);
+ SURFXML_END_TAG(argument);
+
+ XBT_DEBUG(" <argument value=\"5000000\"/>");
+ SURFXML_BUFFER_SET(argument_value, "5000000");
+ SURFXML_START_TAG(argument);
+ SURFXML_END_TAG(argument);
+
+ XBT_DEBUG(" <argument value=\"100000\"/>");
+ SURFXML_BUFFER_SET(argument_value, "100000");
+ SURFXML_START_TAG(argument);
+ SURFXML_END_TAG(argument);
+
+ for(i=1 ; i<nb_host ; i++)
+ {
+ XBT_DEBUG(" <argument value=\"%s.me\"/>",bprintf("c-%d",i));
+ SURFXML_BUFFER_SET(argument_value, bprintf("c-%d.me",i));
+ SURFXML_START_TAG(argument);
+ SURFXML_END_TAG(argument);
+ }
+ XBT_DEBUG(" </process>");
+ SURFXML_END_TAG(process);
+
+ for(i=1 ; i<nb_host ; i++)
+ {
+ XBT_DEBUG(" <process host=\"%s.me\" function=\"slave\"/>",bprintf("c-%d",i));
+ SURFXML_BUFFER_SET(process_host, bprintf("c-%d.me",i));
+ SURFXML_BUFFER_SET(process_function, "slave");
+ SURFXML_BUFFER_SET(process_start_time, "-1.0");
+ SURFXML_BUFFER_SET(process_kill_time, "-1.0");
+ SURFXML_START_TAG(process);
+ SURFXML_END_TAG(process);
+ }
+
+ XBT_DEBUG("</platform>");
+ SURFXML_END_TAG(platform);
+
+ free(surfxml_bufferstack);
+ return 0;
}
/** Test function */
MSG_error_t test_all(const char *platform_file)
{
- MSG_error_t res = MSG_OK;
- MSG_create_environment(platform_file);
- MSG_function_register("master", master);
- MSG_function_register("slave", slave);
- surf_parse = bypass_deployment;
- MSG_launch_application(NULL);
+ MSG_error_t res = MSG_OK;
+ MSG_create_environment(platform_file);
+ MSG_function_register("master", master);
+ MSG_function_register("slave", slave);
+ surf_parse = bypass_deployment;
+ MSG_launch_application(NULL);
- res = MSG_main();
+ res = MSG_main();
- XBT_INFO("Simulation time %g", MSG_get_clock());
- return res;
+ XBT_INFO("Simulation time %g", MSG_get_clock());
+ return res;
} /* end_of_test_all */
/** Main function */
int main(int argc, char *argv[])
{
- MSG_error_t res = MSG_OK;
+ MSG_error_t res = MSG_OK;
- MSG_global_init(&argc, argv);
- res = test_all(argv[1]);
- MSG_clean();
+ MSG_global_init(&argc, argv);
+ res = test_all(argv[1]);
+ MSG_clean();
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ if (res == MSG_OK)
+ return 0;
+ else
+ return 1;
} /* end_of_main */
("All tasks have been dispatched. Let's tell everybody the computation is over.");
for (i = 0; i < slaves_count; i++)
MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE),
- MSG_host_get_name(slaves[i]));
+ MSG_host_get_name(slaves[i]));
MSG_task_destroy(task);
break;
}
XBT_INFO("CS already used. Queue the request of client %d", atoi(req) +1);
xbt_dynar_push(requests, &req);
} else { // can serve it immediatly
- if(strcmp(req, "2") == 0){
- m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
- MSG_task_send(answer, req);
- CS_used = 1;
- XBT_INFO("CS idle. Grant immediatly");
- }
+ if(strcmp(req, "2") == 0){
+ m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
+ MSG_task_send(answer, req);
+ CS_used = 1;
+ XBT_INFO("CS idle. Grant immediatly");
+ }
}
} else { // that's a release. Check if someone was waiting for the lock
if (xbt_dynar_length(requests) > 0) {
XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
char *req ;
- xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
- if(strcmp(req, "2") == 0){
- xbt_dynar_pop(requests, &req);
- MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
- todo--;
- }else{
- xbt_dynar_pop(requests, &req);
- MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
- CS_used = 0;
- todo--;
- }
+ xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
+ if(strcmp(req, "2") == 0){
+ xbt_dynar_pop(requests, &req);
+ MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+ todo--;
+ }else{
+ xbt_dynar_pop(requests, &req);
+ MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
+ CS_used = 0;
+ todo--;
+ }
} else { // nobody wants it
XBT_INFO("CS release. resource now idle");
CS_used = 0;
XBT_INFO("CS already used. Queue the request of client %d", atoi(req) +1);
xbt_dynar_push(requests, &req);
} else { // can serve it immediatly
- if(strcmp(req, "2") == 0){
- m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
- MSG_task_send(answer, req);
- CS_used = 1;
- XBT_INFO("CS idle. Grant immediatly");
- }
+ if(strcmp(req, "2") == 0){
+ m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
+ MSG_task_send(answer, req);
+ CS_used = 1;
+ XBT_INFO("CS idle. Grant immediatly");
+ }
}
} else { // that's a release. Check if someone was waiting for the lock
if (xbt_dynar_length(requests) > 0) {
XBT_INFO("CS release. Grant to queued requests (queue size: %lu)", xbt_dynar_length(requests));
char *req ;
- xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
- if(strcmp(req, "2") == 0){
- xbt_dynar_pop(requests, &req);
- MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
- }else{
- xbt_dynar_pop(requests, &req);
- MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
- CS_used = 0;
- }
+ xbt_dynar_get_cpy(requests, (xbt_dynar_length(requests) - 1), &req);
+ if(strcmp(req, "2") == 0){
+ xbt_dynar_pop(requests, &req);
+ MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+ }else{
+ xbt_dynar_pop(requests, &req);
+ MSG_task_send(MSG_task_create("notgrant", 0, 1000, NULL), req);
+ CS_used = 0;
+ }
} else { // nobody wants it
XBT_INFO("CS release. resource now idle");
CS_used = 0;
if (!strcmp(kind, "request")) {
char *req = MSG_task_get_data(task);
if (CS_used) {
- XBT_INFO("CS already used. Queue the request");
- xbt_dynar_push(requests, &req);
+ XBT_INFO("CS already used. Queue the request");
+ xbt_dynar_push(requests, &req);
} else {
- m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
- MSG_task_send(answer, req);
- CS_used = 1;
- XBT_INFO("CS idle. Grant immediatly");
+ m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
+ MSG_task_send(answer, req);
+ CS_used = 1;
+ XBT_INFO("CS idle. Grant immediatly");
}
} else {
if (xbt_dynar_length(requests) > 0) {
- XBT_INFO("CS release. Grant to queued requests");
- char *req;
- xbt_dynar_pop(requests, &req);
- MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
+ XBT_INFO("CS release. Grant to queued requests");
+ char *req;
+ xbt_dynar_pop(requests, &req);
+ MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
} else {
- XBT_INFO("CS_realase, ressource now idle");
- CS_used = 0;
+ XBT_INFO("CS_realase, ressource now idle");
+ CS_used = 0;
}
}
/***************** Centralized Mutual Exclusion Algorithm *********************/
/* This example implements a centralized mutual exclusion algorithm. */
-/* LTL property checked : !(GFcs) */
+/* LTL property checked : !(GFcs) */
/******************************************************************************/
#include "msg/msg.h"
char *req = MSG_task_get_data(task);
if (CS_used) {
XBT_INFO("CS already used.");
- m_task_t answer = MSG_task_create("not grant", 0, 1000, NULL);
+ m_task_t answer = MSG_task_create("not grant", 0, 1000, NULL);
MSG_task_send(answer, req);
} else { // can serve it immediatly
XBT_INFO("CS idle. Grant immediatly");
XBT_INFO("Client (%s) got the answer (grant). Sleep a bit and release it", my_mailbox);
if(!strcmp(my_mailbox, "1"))
- cs = 1;
+ cs = 1;
/*MSG_process_sleep(my_pid);
MSG_task_send(MSG_task_create("release", 0, 1000, NULL),
- "coordinator");
- XBT_INFO("Client (%s) releases the CS", my_mailbox);
+ "coordinator");
+ XBT_INFO("Client (%s) releases the CS", my_mailbox);
if(!strcmp(my_mailbox, "1"))
- cs = 0;*/
+ cs = 0;*/
}else{
/***************** Centralized Mutual Exclusion Algorithm *********************/
/* This example implements a centralized mutual exclusion algorithm. */
-/* LTL property checked : !(GFcs) */
+/* LTL property checked : !(GFcs) */
/******************************************************************************/
#include "msg/msg.h"
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
-#else /* ! __cplusplus */
+#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
- } \
- while ( 0 )
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
- int yy_buffer_status;
+ int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
- */
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
#define YY_BUFFER_EOF_PENDING 2
- };
+ };
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer(yyin,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
yyensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer(yyin,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 25
#define YY_END_OF_BUFFER 26
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
static yyconst flex_int16_t yy_accept[54] =
{ 0,
0, 0, 26, 24, 18, 23, 8, 24, 24, 9,
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- size_t n; \
- for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(yyin); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
\
#endif
#endif
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
#line 29 "parserPromela.lex"
#line 704 "lex.yy.c"
- if ( !(yy_init) )
- {
- (yy_init) = 1;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
#ifdef YY_USER_INIT
- YY_USER_INIT;
+ YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! yyin )
- yyin = stdin;
+ if ( ! yyin )
+ yyin = stdin;
- if ( ! yyout )
- yyout = stdout;
+ if ( ! yyout )
+ yyout = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- yyensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer(yyin,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
- yy_load_buffer_state( );
- }
+ yy_load_buffer_state( );
+ }
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
- /* Support of yytext. */
- *yy_cp = (yy_hold_char);
+ /* Support of yytext. */
+ *yy_cp = (yy_hold_char);
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = (yy_start);
yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 54 )
- 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] != 90 );
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 54 )
+ 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] != 90 );
yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-do_action: /* This label is used only to access EOF actions. */
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 31 "parserPromela.lex"
{ printf("%s", yytext); return (NEVER); }
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
#line 32 "parserPromela.lex"
{ printf("%s", yytext); return (IF); }
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
#line 33 "parserPromela.lex"
{ printf("%s", yytext);
return (FI); }
- YY_BREAK
+ YY_BREAK
case 4:
YY_RULE_SETUP
#line 35 "parserPromela.lex"
{ printf("%s", yytext); return (IMPLIES); }
- YY_BREAK
+ YY_BREAK
case 5:
YY_RULE_SETUP
#line 36 "parserPromela.lex"
{ printf("%s", yytext); return (GOTO); }
- YY_BREAK
+ YY_BREAK
case 6:
YY_RULE_SETUP
#line 37 "parserPromela.lex"
{ printf("%s", yytext); return (AND); }
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
#line 38 "parserPromela.lex"
{ printf("%s", yytext); return (OR); }
- YY_BREAK
+ YY_BREAK
case 8:
YY_RULE_SETUP
#line 39 "parserPromela.lex"
{ printf("%s", yytext); return (NOT); }
- YY_BREAK
+ YY_BREAK
case 9:
YY_RULE_SETUP
#line 40 "parserPromela.lex"
{ printf("%s", yytext); return (LEFT_PAR); }
- YY_BREAK
+ YY_BREAK
case 10:
YY_RULE_SETUP
#line 41 "parserPromela.lex"
{ printf("%s", yytext); return (RIGHT_PAR); }
- YY_BREAK
+ YY_BREAK
case 11:
YY_RULE_SETUP
#line 42 "parserPromela.lex"
{ printf("%s", yytext); return (CASE); }
- YY_BREAK
+ YY_BREAK
case 12:
YY_RULE_SETUP
#line 43 "parserPromela.lex"
{ printf("%s", yytext); return (COLON); }
- YY_BREAK
+ YY_BREAK
case 13:
YY_RULE_SETUP
#line 44 "parserPromela.lex"
{ printf("%s", yytext); return (SEMI_COLON); }
- YY_BREAK
+ YY_BREAK
case 14:
YY_RULE_SETUP
#line 45 "parserPromela.lex"
{ printf("%s", yytext); return (CASE_TRUE); }
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
#line 46 "parserPromela.lex"
{ printf("%s", yytext); return (LEFT_BRACE); }
- YY_BREAK
+ YY_BREAK
case 16:
YY_RULE_SETUP
#line 47 "parserPromela.lex"
{ printf("%s", yytext); return (RIGHT_BRACE); }
- YY_BREAK
+ YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 50 "parserPromela.lex"
{ printf(" ");}
- YY_BREAK
+ YY_BREAK
case 18:
YY_RULE_SETUP
#line 52 "parserPromela.lex"
{ printf("%s",yytext); }
- YY_BREAK
+ YY_BREAK
case 19:
YY_RULE_SETUP
#line 55 "parserPromela.lex"
{ printf("%s",yytext);
sscanf(yytext,"%lf",&yylval.real);
return (LITT_REEL); }
- YY_BREAK
+ YY_BREAK
case 20:
YY_RULE_SETUP
#line 59 "parserPromela.lex"
{ printf("%s",yytext);
sscanf(yytext,"%d",&yylval.integer);
return (LITT_ENT); }
- YY_BREAK
+ YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
yylval.string=(char *)malloc(strlen(yytext)+1);
sscanf(yytext,"%s",yylval.string);
return (LITT_CHAINE); }
- YY_BREAK
+ YY_BREAK
case 22:
YY_RULE_SETUP
#line 68 "parserPromela.lex"
{ printf("%s",yytext);
- yylval.string=(char *)malloc(strlen(yytext)+1);
- sscanf(yytext,"%s",yylval.string);
- return (ID); }
- YY_BREAK
+ yylval.string=(char *)malloc(strlen(yytext)+1);
+ sscanf(yytext,"%s",yylval.string);
+ return (ID); }
+ YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
#line 73 "parserPromela.lex"
{ printf("\n"); }
- YY_BREAK
+ YY_BREAK
case 24:
YY_RULE_SETUP
#line 75 "parserPromela.lex"
{ printf("caractère inconnu\n"); }
- YY_BREAK
+ YY_BREAK
case 25:
YY_RULE_SETUP
#line 77 "parserPromela.lex"
ECHO;
- YY_BREAK
+ YY_BREAK
#line 926 "lex.yy.c"
case YY_STATE_EOF(INITIAL):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( yywrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * yytext, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( yywrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- yyrestart(yyin );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- return ret_val;
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart(yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 54 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 54 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
- * next_state = yy_try_NUL_trans( current_state );
+ * next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 54 )
- 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 == 53);
-
- return yy_is_jam ? 0 : yy_current_state;
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 54 )
+ 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 == 53);
+
+ return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
{
- register char *yy_cp;
+ register char *yy_cp;
yy_cp = (yy_c_buf_p);
- /* undo effects of setting up yytext */
- *yy_cp = (yy_hold_char);
+ /* undo effects of setting up yytext */
+ *yy_cp = (yy_hold_char);
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
- *--yy_cp = (char) c;
+ *--yy_cp = (char) c;
- (yytext_ptr) = yy_bp;
- (yy_hold_char) = *yy_cp;
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
}
#ifndef YY_NO_INPUT
#endif
{
- int c;
+ int c;
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- yyrestart(yyin );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( yywrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart(yyin );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput();
#else
- return input();
+ return input();
#endif
- }
+ }
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve yytext */
- (yy_hold_char) = *++(yy_c_buf_p);
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
+ (yy_hold_char) = *++(yy_c_buf_p);
- return c;
+ return c;
}
-#endif /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
void yyrestart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
- }
+ }
- yy_init_buffer(YY_CURRENT_BUFFER,input_file );
- yy_load_buffer_state( );
+ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+ yy_load_buffer_state( );
}
/** Switch to a different input buffer.
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * yypop_buffer_state();
- * yypush_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- yyensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- yy_load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ yyensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy_load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
}
static void yy_load_buffer_state (void)
{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
*/
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = size;
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- yy_init_buffer(b,file );
+ yy_init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void yy_delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- yyfree((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ yyfree((void *) b->yy_ch_buf );
- yyfree((void *) b );
+ yyfree((void *) b );
}
#ifndef __cplusplus
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- yy_flush_buffer(b );
+ yy_flush_buffer(b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
/* If b is the current buffer, then yy_init_buffer was _probably_
* called from yyrestart() or through yy_get_next_buffer.
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- errno = oerrno;
+ errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
*/
void yy_flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- b->yy_n_chars = 0;
+ b->yy_n_chars = 0;
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == YY_CURRENT_BUFFER )
- yy_load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ yy_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
-
- yyensure_buffer_stack();
-
- /* This block is copied from yy_switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
- /* copied from yy_switch_to_buffer. */
- yy_load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ if (new_buffer == NULL)
+ return;
+
+ yyensure_buffer_stack();
+
+ /* This block is copied from yy_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void yypop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
-
- yy_delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
-
- if (YY_CURRENT_BUFFER) {
- yy_load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void yyensure_buffer_stack (void)
{
- int num_to_alloc;
+ int num_to_alloc;
- if (!(yy_buffer_stack)) {
+ if (!(yy_buffer_stack)) {
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
*/
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- yy_switch_to_buffer(b );
-
- return b;
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer(b );
+
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to yylex() will
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
{
- return yy_scan_bytes(yystr,strlen(yystr) );
+ return yy_scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
*/
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) yyalloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) yyalloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+ b = yy_scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
- return b;
+ return b;
}
#ifndef YY_EXIT_FAILURE
static void yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up yytext. */ \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- yytext[yyleng] = (yy_hold_char); \
- (yy_c_buf_p) = yytext + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- yyleng = yyless_macro_arg; \
- } \
- while ( 0 )
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
{
/* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- yy_delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- yypop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yypop_buffer_state();
+ }
- /* Destroy the stack itself. */
- yyfree((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ yyfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* yylex() is called, initialization will occur. */
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
- return n;
+ return n;
}
#endif
void *yyalloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *yyrealloc (void * ptr, yy_size_t size )
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
void yyfree (void * ptr )
{
- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
elapsed_time = MSG_get_clock() - start_time;
XBT_INFO("FLOW[%d] : Receive %.0f bytes from %s to %s",
- id,
- MSG_task_get_data_size(task),
+ id,
+ MSG_task_get_data_size(task),
masternames[id],
slavenames[id]);
// MSG_task_execute(task);
/* This example should always be executed using a deployment of
* GRID_SIZE * GRID_SIZE nodes. */
-#define GRID_SIZE 3 /* Modify to adjust the grid's size */
-#define NODE_MATRIX_SIZE 300 /* Ammount of work done by each node*/
+#define GRID_SIZE 3 /* Modify to adjust the grid's size */
+#define NODE_MATRIX_SIZE 300 /* Ammount of work done by each node*/
#define GRID_NUM_NODES GRID_SIZE * GRID_SIZE
#define MATRIX_SIZE NODE_MATRIX_SIZE * GRID_SIZE
}
static SD_task_t SD_workstation_get_last_scheduled_task( SD_workstation_t workstation){
- WorkstationAttribute attr =
- (WorkstationAttribute) SD_workstation_get_data(workstation);
- return attr->last_scheduled_task;
+ WorkstationAttribute attr =
+ (WorkstationAttribute) SD_workstation_get_data(workstation);
+ return attr->last_scheduled_task;
}
static void SD_workstation_set_last_scheduled_task(SD_workstation_t workstation,
- SD_task_t task){
- WorkstationAttribute attr =
- (WorkstationAttribute) SD_workstation_get_data(workstation);
- attr->last_scheduled_task=task;
- SD_workstation_set_data(workstation, attr);
+ SD_task_t task){
+ WorkstationAttribute attr =
+ (WorkstationAttribute) SD_workstation_get_data(workstation);
+ attr->last_scheduled_task=task;
+ SD_workstation_set_data(workstation, attr);
}
static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
last_scheduled_task =
SD_workstation_get_last_scheduled_task(selected_workstation);
if (last_scheduled_task &&
- (SD_task_get_state(last_scheduled_task) != SD_DONE) &&
- (SD_task_get_state(last_scheduled_task) != SD_FAILED) &&
- !SD_task_dependency_exists(
- SD_workstation_get_last_scheduled_task(selected_workstation),
- selected_task))
+ (SD_task_get_state(last_scheduled_task) != SD_DONE) &&
+ (SD_task_get_state(last_scheduled_task) != SD_FAILED) &&
+ !SD_task_dependency_exists(
+ SD_workstation_get_last_scheduled_task(selected_workstation),
+ selected_task))
SD_task_dependency_add("resource", NULL,
- last_scheduled_task, selected_task);
+ last_scheduled_task, selected_task);
SD_workstation_set_last_scheduled_task(selected_workstation, selected_task);
XBT_INFO("Simulation stopped after %.4f seconds", SD_get_clock());
xbt_dynar_foreach(changed_tasks, ctr, task) {
XBT_INFO("Task '%s' start time: %f, finish time: %f",
- SD_task_get_name(task),
- SD_task_get_start_time(task),
- SD_task_get_finish_time(task));
+ SD_task_get_name(task),
+ SD_task_get_start_time(task),
+ SD_task_get_finish_time(task));
}
/* let throttle the communication for taskD if its parent is SD_DONE */
/* Change the access mode of the workstations */
workstations = SD_workstation_get_list();
for (i = 0; i < 2; i++) {
- SD_workstation_dump(workstations[i]);
-
+ SD_workstation_dump(workstations[i]);
+
SD_workstation_set_access_mode(workstations[i],
SD_WORKSTATION_SEQUENTIAL_ACCESS);
XBT_INFO(" Change access mode of %s to %s",
/* let's launch the simulation! */
while (!xbt_dynar_is_empty(changed_tasks = SD_simulate(-1.0))) {
- XBT_INFO(" Simulation was suspended, check workstation states");
+ XBT_INFO(" Simulation was suspended, check workstation states");
for (i = 0; i < 2; i++) {
- SD_workstation_dump(workstations[i]);
+ SD_workstation_dump(workstations[i]);
}
xbt_dynar_free(&changed_tasks);
}
for (i=0;i<SD_workstation_get_number();i++)
XBT_INFO("%s runs at %f flops", SD_workstation_get_name(workstations[i]),
- SD_workstation_get_power(workstations[i]));
+ SD_workstation_get_power(workstations[i]));
/* creation of some typed tasks and their dependencies */
taskA = SD_task_create_comp_seq("Task A", NULL, 1e9);
}
void nodeShow(DGNode* nd){
fprintf( stderr,"%3d.%s: (%d,%d)\n",
- nd->id,nd->name,nd->inDegree,nd->outDegree);
+ nd->id,nd->name,nd->inDegree,nd->outDegree);
/*
if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
else if(nd->verified==0) fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
DGNode **nds =NULL, *tmpnd=NULL;
DGArc **ar=NULL;
- if (dg->numNodes == dg->maxNodes-1 ) {
- dg->maxNodes += BLOCK_SIZE;
+ if (dg->numNodes == dg->maxNodes-1 ) {
+ dg->maxNodes += BLOCK_SIZE;
nds =(DGNode **) calloc(dg->maxNodes,sizeof(DGNode*));
- memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
- free(dg->node);
- dg->node=nds;
- }
+ memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
+ free(dg->node);
+ dg->node=nds;
+ }
len = strlen( nd->name);
- for (i = 0; i < dg->numNodes; i++) {
- tmpnd =dg->node[ i];
- ar=NULL;
- if ( strlen( tmpnd->name) != len ) continue;
- if ( strncmp( nd->name, tmpnd->name, len) ) continue;
- if ( nd->inDegree > 0 ) {
- tmpnd->maxInDegree += nd->maxInDegree;
+ for (i = 0; i < dg->numNodes; i++) {
+ tmpnd =dg->node[ i];
+ ar=NULL;
+ if ( strlen( tmpnd->name) != len ) continue;
+ if ( strncmp( nd->name, tmpnd->name, len) ) continue;
+ if ( nd->inDegree > 0 ) {
+ tmpnd->maxInDegree += nd->maxInDegree;
ar =(DGArc **) calloc(tmpnd->maxInDegree,sizeof(DGArc*));
- memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
- free(tmpnd->inArc);
- tmpnd->inArc=ar;
- for (j = 0; j < nd->inDegree; j++ ) {
- nd->inArc[ j]->head = tmpnd;
- }
- memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
- tmpnd->inDegree += nd->inDegree;
- }
- if ( nd->outDegree > 0 ) {
- tmpnd->maxOutDegree += nd->maxOutDegree;
+ memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
+ free(tmpnd->inArc);
+ tmpnd->inArc=ar;
+ for (j = 0; j < nd->inDegree; j++ ) {
+ nd->inArc[ j]->head = tmpnd;
+ }
+ memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
+ tmpnd->inDegree += nd->inDegree;
+ }
+ if ( nd->outDegree > 0 ) {
+ tmpnd->maxOutDegree += nd->maxOutDegree;
ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
- memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
- free(tmpnd->outArc);
- tmpnd->outArc=ar;
- for (j = 0; j < nd->outDegree; j++ ) {
- nd->outArc[ j]->tail = tmpnd;
- }
- memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
- tmpnd->outDegree += nd->outDegree;
- }
- free(nd);
- return i;
- }
- nd->id = dg->numNodes;
- dg->node[dg->numNodes] = nd;
- dg->numNodes++;
+ memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
+ free(tmpnd->outArc);
+ tmpnd->outArc=ar;
+ for (j = 0; j < nd->outDegree; j++ ) {
+ nd->outArc[ j]->tail = tmpnd;
+ }
+ memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
+ tmpnd->outDegree += nd->outDegree;
+ }
+ free(nd);
+ return i;
+ }
+ nd->id = dg->numNodes;
+ dg->node[dg->numNodes] = nd;
+ dg->numNodes++;
return nd->id;
}
int AttachArc(DGraph *dg,DGArc* nar){
-int arcId = -1;
+int arcId = -1;
int i=0,newNumber=0;
-DGNode *head = nar->head,
- *tail = nar->tail;
+DGNode *head = nar->head,
+ *tail = nar->tail;
DGArc **ars=NULL,*probe=NULL;
/*fprintf(stderr,"AttachArc %ld\n",dg->numArcs); */
- if ( !tail || !head ) return arcId;
- if ( dg->numArcs == dg->maxArcs-1 ) {
- dg->maxArcs += BLOCK_SIZE;
+ if ( !tail || !head ) return arcId;
+ if ( dg->numArcs == dg->maxArcs-1 ) {
+ dg->maxArcs += BLOCK_SIZE;
ars =(DGArc **) calloc(dg->maxArcs,sizeof(DGArc*));
- memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
- free(dg->arc);
- dg->arc=ars;
- }
- for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
- probe = tail->outArc[ i];
- if(probe->head == head
- &&
- probe->length == nar->length
+ memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
+ free(dg->arc);
+ dg->arc=ars;
+ }
+ for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
+ probe = tail->outArc[ i];
+ if(probe->head == head
+ &&
+ probe->length == nar->length
){
free(nar);
- return probe->id;
- }
- }
-
- nar->id = dg->numArcs;
- arcId=dg->numArcs;
- dg->arc[dg->numArcs] = nar;
- dg->numArcs++;
-
- head->inArc[ head->inDegree] = nar;
- head->inDegree++;
- if ( head->inDegree >= head->maxInDegree ) {
- newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
+ return probe->id;
+ }
+ }
+
+ nar->id = dg->numArcs;
+ arcId=dg->numArcs;
+ dg->arc[dg->numArcs] = nar;
+ dg->numArcs++;
+
+ head->inArc[ head->inDegree] = nar;
+ head->inDegree++;
+ if ( head->inDegree >= head->maxInDegree ) {
+ newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
- memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
- free(head->inArc);
- head->inArc=ars;
- head->maxInDegree = newNumber;
- }
- tail->outArc[ tail->outDegree] = nar;
- tail->outDegree++;
- if(tail->outDegree >= tail->maxOutDegree ) {
- newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
+ memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
+ free(head->inArc);
+ head->inArc=ars;
+ head->maxInDegree = newNumber;
+ }
+ tail->outArc[ tail->outDegree] = nar;
+ tail->outDegree++;
+ if(tail->outDegree >= tail->maxOutDegree ) {
+ newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
- memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
- free(tail->outArc);
- tail->outArc=ars;
- tail->maxOutDegree = newNumber;
- }
+ memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
+ free(tail->outArc);
+ tail->outArc=ars;
+ tail->maxOutDegree = newNumber;
+ }
/*fprintf(stderr,"AttachArc: head->in=%d tail->out=%ld\n",head->inDegree,tail->outDegree);*/
return arcId;
}
DGNode *focusNode = dg->node[ i];
if(DetailsLevel >= 2) {
for (j = 0; j < focusNode->inDegree; j++ ) {
- fprintf(stderr,"\t ");
- nodeShow(focusNode->inArc[ j]->tail);
+ fprintf(stderr,"\t ");
+ nodeShow(focusNode->inArc[ j]->tail);
}
}
nodeShow(focusNode);
for (j = 0; j < focusNode->outDegree; j++ ) {
fprintf(stderr, "\t ");
nodeShow(focusNode->outArc[ j]->head);
- }
+ }
fprintf(stderr, "---\n");
}
fprintf(stderr,"----------------------------------------\n");
* *
* N A S P A R A L L E L B E N C H M A R K S 3.3 *
* *
- * D T *
+ * D T *
* *
*************************************************************************
* *
* *
*************************************************************************
* *
- * Author: M. Frumkin * *
+ * Author: M. Frumkin * *
* *
*************************************************************************/
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
char *cmpi_inc,
char *cflags,
char *clinkflags );
-
+
void timer_clear( int n );
void timer_start( int n );
void timer_stop( int n );
verified = 0;
}else if(cls=='W') {
if(strstr(bmname,"BH")){
- verify_value = 4102461.0;
+ verify_value = 4102461.0;
}else if(strstr(bmname,"WH")){
- verify_value = 204280762.0;
+ verify_value = 204280762.0;
}else if(strstr(bmname,"SH")){
- verify_value = 186944764.0;
+ verify_value = 186944764.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
verified = 0;
}else if(cls=='A') {
if(strstr(bmname,"BH")){
- verify_value = 17809491.0;
+ verify_value = 17809491.0;
}else if(strstr(bmname,"WH")){
- verify_value = 1289925229.0;
+ verify_value = 1289925229.0;
}else if(strstr(bmname,"SH")){
- verify_value = 610856482.0;
+ verify_value = 610856482.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
- verified = 0;
+ verified = 0;
}else if(cls=='B') {
if(strstr(bmname,"BH")){
- verify_value = 4317114.0;
+ verify_value = 4317114.0;
}else if(strstr(bmname,"WH")){
- verify_value = 7877279917.0;
+ verify_value = 7877279917.0;
}else if(strstr(bmname,"SH")){
- verify_value = 1836863082.0;
+ verify_value = 1836863082.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
- verified = 0;
+ verified = 0;
}
}else if(cls=='C') {
if(strstr(bmname,"BH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"WH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"SH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
- verified = -1;
+ verified = -1;
}
}else if(cls=='D') {
if(strstr(bmname,"BH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"WH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"SH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
}
fprintf(stderr," %s L2 Norm = %f\n",bmname,rnm2);
if(verified==-1){
- fprintf(stderr," No verification was performed.\n");
+ fprintf(stderr," No verification was performed.\n");
}else if( rnm2 - verify_value < epsilon &&
rnm2 - verify_value > -epsilon) { /* abs here does not work on ALTIX */
- verified = 1;
- fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
+ verified = 1;
+ fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
}else{
- verified = 0;
- fprintf(stderr," The correct verification value = %f\n",verify_value);
- fprintf(stderr," Got value = %f\n",rnm2);
+ verified = 0;
+ fprintf(stderr," The correct verification value = %f\n",verify_value);
+ fprintf(stderr," Got value = %f\n",rnm2);
}
}else{
verified = -1;
id=AttachNode(dg,nd);
for(j=0;j<maxInDeg;j++){
sid=i*maxInDeg+j;
- if(sid>=numPrevLayerNodes) break;
+ if(sid>=numPrevLayerNodes) break;
snd=dg->node[firstLayerNode+sid];
ar=newArc(dg->node[id],snd);
AttachArc(dg,ar);
id=AttachNode(dg,nd);
for(j=0;j<maxInDeg;j++){
sid=i*maxInDeg+j;
- if(sid>=numPrevLayerNodes) break;
+ if(sid>=numPrevLayerNodes) break;
snd=dg->node[firstLayerNode+sid];
ar=newArc(snd,dg->node[id]);
AttachArc(dg,ar);
if(a->len>b->len) Resample(b,a->len);
for(i=fielddim;i<a->len-fielddim;i+=fielddim){
rms0=(a->val[i]-b->val[i])*(a->val[i]-b->val[i])
- +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
- +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
- +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
+ +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
+ +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
+ +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
j=i+fielddim;
rms1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
- +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
- +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
- +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+ +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+ +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+ +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
j=i-fielddim;
rmsm1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
- +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
- +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
- +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+ +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+ +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+ +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
k=0;
if(rms1<rms0){
k=1;
a->val[i+1]=weight*b->val[j+1];
a->val[i+2]=weight*b->val[j+2];
a->val[i+3]=weight*b->val[j+3];
- }
+ }
}
if(timer_on){
timer_stop(w);
timer_stop(0);
tot_time=timer_read(0);
c_print_results( dg->name,
- CLASS,
- featnum,
- 0,
- 0,
- dg->numNodes,
- 0,
- comm_size,
- tot_time,
- bytes_sent/tot_time,
- "bytes transmitted",
- verified,
- NPBVERSION,
- COMPILETIME,
- MPICC,
- CLINK,
- CMPI_LIB,
- CMPI_INC,
- CFLAGS,
- CLINKFLAGS );
+ CLASS,
+ featnum,
+ 0,
+ 0,
+ dg->numNodes,
+ 0,
+ comm_size,
+ tot_time,
+ bytes_sent/tot_time,
+ "bytes transmitted",
+ verified,
+ NPBVERSION,
+ COMPILETIME,
+ MPICC,
+ CLINK,
+ CMPI_LIB,
+ CMPI_INC,
+ CFLAGS,
+ CLINKFLAGS );
}
MPI_Finalize();
return 1;
}
void nodeShow(DGNode* nd){
fprintf( stderr,"%3d.%s: (%d,%d)\n",
- nd->id,nd->name,nd->inDegree,nd->outDegree);
+ nd->id,nd->name,nd->inDegree,nd->outDegree);
/*
if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
else if(nd->verified==0) fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
DGNode **nds =NULL, *tmpnd=NULL;
DGArc **ar=NULL;
- if (dg->numNodes == dg->maxNodes-1 ) {
- dg->maxNodes += BLOCK_SIZE;
+ if (dg->numNodes == dg->maxNodes-1 ) {
+ dg->maxNodes += BLOCK_SIZE;
nds =(DGNode **) calloc(dg->maxNodes,sizeof(DGNode*));
- memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
- free(dg->node);
- dg->node=nds;
- }
+ memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
+ free(dg->node);
+ dg->node=nds;
+ }
len = strlen( nd->name);
- for (i = 0; i < dg->numNodes; i++) {
- tmpnd =dg->node[ i];
- ar=NULL;
- if ( strlen( tmpnd->name) != len ) continue;
- if ( strncmp( nd->name, tmpnd->name, len) ) continue;
- if ( nd->inDegree > 0 ) {
- tmpnd->maxInDegree += nd->maxInDegree;
+ for (i = 0; i < dg->numNodes; i++) {
+ tmpnd =dg->node[ i];
+ ar=NULL;
+ if ( strlen( tmpnd->name) != len ) continue;
+ if ( strncmp( nd->name, tmpnd->name, len) ) continue;
+ if ( nd->inDegree > 0 ) {
+ tmpnd->maxInDegree += nd->maxInDegree;
ar =(DGArc **) calloc(tmpnd->maxInDegree,sizeof(DGArc*));
- memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
- free(tmpnd->inArc);
- tmpnd->inArc=ar;
- for (j = 0; j < nd->inDegree; j++ ) {
- nd->inArc[ j]->head = tmpnd;
- }
- memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
- tmpnd->inDegree += nd->inDegree;
- }
- if ( nd->outDegree > 0 ) {
- tmpnd->maxOutDegree += nd->maxOutDegree;
+ memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
+ free(tmpnd->inArc);
+ tmpnd->inArc=ar;
+ for (j = 0; j < nd->inDegree; j++ ) {
+ nd->inArc[ j]->head = tmpnd;
+ }
+ memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
+ tmpnd->inDegree += nd->inDegree;
+ }
+ if ( nd->outDegree > 0 ) {
+ tmpnd->maxOutDegree += nd->maxOutDegree;
ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
- memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
- free(tmpnd->outArc);
- tmpnd->outArc=ar;
- for (j = 0; j < nd->outDegree; j++ ) {
- nd->outArc[ j]->tail = tmpnd;
- }
- memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
- tmpnd->outDegree += nd->outDegree;
- }
- free(nd);
- return i;
- }
- nd->id = dg->numNodes;
- dg->node[dg->numNodes] = nd;
- dg->numNodes++;
+ memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
+ free(tmpnd->outArc);
+ tmpnd->outArc=ar;
+ for (j = 0; j < nd->outDegree; j++ ) {
+ nd->outArc[ j]->tail = tmpnd;
+ }
+ memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
+ tmpnd->outDegree += nd->outDegree;
+ }
+ free(nd);
+ return i;
+ }
+ nd->id = dg->numNodes;
+ dg->node[dg->numNodes] = nd;
+ dg->numNodes++;
return nd->id;
}
int AttachArc(DGraph *dg,DGArc* nar){
-int arcId = -1;
+int arcId = -1;
int i=0,newNumber=0;
-DGNode *head = nar->head,
- *tail = nar->tail;
+DGNode *head = nar->head,
+ *tail = nar->tail;
DGArc **ars=NULL,*probe=NULL;
/*fprintf(stderr,"AttachArc %ld\n",dg->numArcs); */
- if ( !tail || !head ) return arcId;
- if ( dg->numArcs == dg->maxArcs-1 ) {
- dg->maxArcs += BLOCK_SIZE;
+ if ( !tail || !head ) return arcId;
+ if ( dg->numArcs == dg->maxArcs-1 ) {
+ dg->maxArcs += BLOCK_SIZE;
ars =(DGArc **) calloc(dg->maxArcs,sizeof(DGArc*));
- memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
- free(dg->arc);
- dg->arc=ars;
- }
- for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
- probe = tail->outArc[ i];
- if(probe->head == head
- &&
- probe->length == nar->length
+ memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
+ free(dg->arc);
+ dg->arc=ars;
+ }
+ for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
+ probe = tail->outArc[ i];
+ if(probe->head == head
+ &&
+ probe->length == nar->length
){
free(nar);
- return probe->id;
- }
- }
-
- nar->id = dg->numArcs;
- arcId=dg->numArcs;
- dg->arc[dg->numArcs] = nar;
- dg->numArcs++;
-
- head->inArc[ head->inDegree] = nar;
- head->inDegree++;
- if ( head->inDegree >= head->maxInDegree ) {
- newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
+ return probe->id;
+ }
+ }
+
+ nar->id = dg->numArcs;
+ arcId=dg->numArcs;
+ dg->arc[dg->numArcs] = nar;
+ dg->numArcs++;
+
+ head->inArc[ head->inDegree] = nar;
+ head->inDegree++;
+ if ( head->inDegree >= head->maxInDegree ) {
+ newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
- memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
- free(head->inArc);
- head->inArc=ars;
- head->maxInDegree = newNumber;
- }
- tail->outArc[ tail->outDegree] = nar;
- tail->outDegree++;
- if(tail->outDegree >= tail->maxOutDegree ) {
- newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
+ memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
+ free(head->inArc);
+ head->inArc=ars;
+ head->maxInDegree = newNumber;
+ }
+ tail->outArc[ tail->outDegree] = nar;
+ tail->outDegree++;
+ if(tail->outDegree >= tail->maxOutDegree ) {
+ newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
- memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
- free(tail->outArc);
- tail->outArc=ars;
- tail->maxOutDegree = newNumber;
- }
+ memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
+ free(tail->outArc);
+ tail->outArc=ars;
+ tail->maxOutDegree = newNumber;
+ }
/*fprintf(stderr,"AttachArc: head->in=%d tail->out=%ld\n",head->inDegree,tail->outDegree);*/
return arcId;
}
DGNode *focusNode = dg->node[ i];
if(DetailsLevel >= 2) {
for (j = 0; j < focusNode->inDegree; j++ ) {
- fprintf(stderr,"\t ");
- nodeShow(focusNode->inArc[ j]->tail);
+ fprintf(stderr,"\t ");
+ nodeShow(focusNode->inArc[ j]->tail);
}
}
nodeShow(focusNode);
for (j = 0; j < focusNode->outDegree; j++ ) {
fprintf(stderr, "\t ");
nodeShow(focusNode->outArc[ j]->head);
- }
+ }
fprintf(stderr, "---\n");
}
fprintf(stderr,"----------------------------------------\n");
* *
* N A S P A R A L L E L B E N C H M A R K S 3.3 *
* *
- * D T *
+ * D T *
* *
*************************************************************************
* *
* *
*************************************************************************
* *
- * Author: M. Frumkin * *
+ * Author: M. Frumkin * *
* *
*************************************************************************/
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
char *cmpi_inc,
char *cflags,
char *clinkflags );
-
+
void timer_clear( int n );
void timer_start( int n );
void timer_stop( int n );
verified = 0;
}else if(cls=='W') {
if(strstr(bmname,"BH")){
- verify_value = 4102461.0;
+ verify_value = 4102461.0;
}else if(strstr(bmname,"WH")){
- verify_value = 204280762.0;
+ verify_value = 204280762.0;
}else if(strstr(bmname,"SH")){
- verify_value = 186944764.0;
+ verify_value = 186944764.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
verified = 0;
}else if(cls=='A') {
if(strstr(bmname,"BH")){
- verify_value = 17809491.0;
+ verify_value = 17809491.0;
}else if(strstr(bmname,"WH")){
- verify_value = 1289925229.0;
+ verify_value = 1289925229.0;
}else if(strstr(bmname,"SH")){
- verify_value = 610856482.0;
+ verify_value = 610856482.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
- verified = 0;
+ verified = 0;
}else if(cls=='B') {
if(strstr(bmname,"BH")){
- verify_value = 4317114.0;
+ verify_value = 4317114.0;
}else if(strstr(bmname,"WH")){
- verify_value = 7877279917.0;
+ verify_value = 7877279917.0;
}else if(strstr(bmname,"SH")){
- verify_value = 1836863082.0;
+ verify_value = 1836863082.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
- verified = 0;
+ verified = 0;
}
}else if(cls=='C') {
if(strstr(bmname,"BH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"WH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"SH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
- verified = -1;
+ verified = -1;
}
}else if(cls=='D') {
if(strstr(bmname,"BH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"WH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"SH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
}
fprintf(stderr," %s L2 Norm = %f\n",bmname,rnm2);
if(verified==-1){
- fprintf(stderr," No verification was performed.\n");
+ fprintf(stderr," No verification was performed.\n");
}else if( rnm2 - verify_value < epsilon &&
rnm2 - verify_value > -epsilon) { /* abs here does not work on ALTIX */
- verified = 1;
- fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
+ verified = 1;
+ fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
}else{
- verified = 0;
- fprintf(stderr," The correct verification value = %f\n",verify_value);
- fprintf(stderr," Got value = %f\n",rnm2);
+ verified = 0;
+ fprintf(stderr," The correct verification value = %f\n",verify_value);
+ fprintf(stderr," Got value = %f\n",rnm2);
}
}else{
verified = -1;
id=AttachNode(dg,nd);
for(j=0;j<maxInDeg;j++){
sid=i*maxInDeg+j;
- if(sid>=numPrevLayerNodes) break;
+ if(sid>=numPrevLayerNodes) break;
snd=dg->node[firstLayerNode+sid];
ar=newArc(dg->node[id],snd);
AttachArc(dg,ar);
id=AttachNode(dg,nd);
for(j=0;j<maxInDeg;j++){
sid=i*maxInDeg+j;
- if(sid>=numPrevLayerNodes) break;
+ if(sid>=numPrevLayerNodes) break;
snd=dg->node[firstLayerNode+sid];
ar=newArc(snd,dg->node[id]);
AttachArc(dg,ar);
if(a->len>b->len) Resample(b,a->len);
for(i=fielddim;i<a->len-fielddim;i+=fielddim){
rms0=(a->val[i]-b->val[i])*(a->val[i]-b->val[i])
- +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
- +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
- +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
+ +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
+ +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
+ +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
j=i+fielddim;
rms1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
- +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
- +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
- +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+ +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+ +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+ +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
j=i-fielddim;
rmsm1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
- +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
- +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
- +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+ +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+ +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+ +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
k=0;
if(rms1<rms0){
k=1;
a->val[i+1]=weight*b->val[j+1];
a->val[i+2]=weight*b->val[j+2];
a->val[i+3]=weight*b->val[j+3];
- }
+ }
}
if(timer_on){
timer_stop(w);
timer_stop(0);
tot_time=timer_read(0);
c_print_results( dg->name,
- CLASS,
- featnum,
- 0,
- 0,
- dg->numNodes,
- 0,
- comm_size,
- tot_time,
- bytes_sent/tot_time,
- "bytes transmitted",
- verified,
- NPBVERSION,
- COMPILETIME,
- MPICC,
- CLINK,
- CMPI_LIB,
- CMPI_INC,
- CFLAGS,
- CLINKFLAGS );
+ CLASS,
+ featnum,
+ 0,
+ 0,
+ dg->numNodes,
+ 0,
+ comm_size,
+ tot_time,
+ bytes_sent/tot_time,
+ "bytes transmitted",
+ verified,
+ NPBVERSION,
+ COMPILETIME,
+ MPICC,
+ CLINK,
+ CMPI_LIB,
+ CMPI_INC,
+ CFLAGS,
+ CLINKFLAGS );
}
MPI_Finalize();
return 1;
}
void nodeShow(DGNode* nd){
fprintf( stderr,"%3d.%s: (%d,%d)\n",
- nd->id,nd->name,nd->inDegree,nd->outDegree);
+ nd->id,nd->name,nd->inDegree,nd->outDegree);
/*
if(nd->verified==1) fprintf(stderr,"%ld.%s\t: usable.",nd->id,nd->name);
else if(nd->verified==0) fprintf(stderr,"%ld.%s\t: unusable.",nd->id,nd->name);
DGNode **nds =NULL, *tmpnd=NULL;
DGArc **ar=NULL;
- if (dg->numNodes == dg->maxNodes-1 ) {
- dg->maxNodes += BLOCK_SIZE;
+ if (dg->numNodes == dg->maxNodes-1 ) {
+ dg->maxNodes += BLOCK_SIZE;
nds =(DGNode **) calloc(dg->maxNodes,sizeof(DGNode*));
- memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
- free(dg->node);
- dg->node=nds;
- }
+ memcpy(nds,dg->node,(dg->maxNodes-BLOCK_SIZE)*sizeof(DGNode*));
+ free(dg->node);
+ dg->node=nds;
+ }
len = strlen( nd->name);
- for (i = 0; i < dg->numNodes; i++) {
- tmpnd =dg->node[ i];
- ar=NULL;
- if ( strlen( tmpnd->name) != len ) continue;
- if ( strncmp( nd->name, tmpnd->name, len) ) continue;
- if ( nd->inDegree > 0 ) {
- tmpnd->maxInDegree += nd->maxInDegree;
+ for (i = 0; i < dg->numNodes; i++) {
+ tmpnd =dg->node[ i];
+ ar=NULL;
+ if ( strlen( tmpnd->name) != len ) continue;
+ if ( strncmp( nd->name, tmpnd->name, len) ) continue;
+ if ( nd->inDegree > 0 ) {
+ tmpnd->maxInDegree += nd->maxInDegree;
ar =(DGArc **) calloc(tmpnd->maxInDegree,sizeof(DGArc*));
- memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
- free(tmpnd->inArc);
- tmpnd->inArc=ar;
- for (j = 0; j < nd->inDegree; j++ ) {
- nd->inArc[ j]->head = tmpnd;
- }
- memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
- tmpnd->inDegree += nd->inDegree;
- }
- if ( nd->outDegree > 0 ) {
- tmpnd->maxOutDegree += nd->maxOutDegree;
+ memcpy(ar,tmpnd->inArc,(tmpnd->inDegree)*sizeof(DGArc*));
+ free(tmpnd->inArc);
+ tmpnd->inArc=ar;
+ for (j = 0; j < nd->inDegree; j++ ) {
+ nd->inArc[ j]->head = tmpnd;
+ }
+ memcpy( &(tmpnd->inArc[ tmpnd->inDegree]), nd->inArc, nd->inDegree*sizeof( DGArc *));
+ tmpnd->inDegree += nd->inDegree;
+ }
+ if ( nd->outDegree > 0 ) {
+ tmpnd->maxOutDegree += nd->maxOutDegree;
ar =(DGArc **) calloc(tmpnd->maxOutDegree,sizeof(DGArc*));
- memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
- free(tmpnd->outArc);
- tmpnd->outArc=ar;
- for (j = 0; j < nd->outDegree; j++ ) {
- nd->outArc[ j]->tail = tmpnd;
- }
- memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
- tmpnd->outDegree += nd->outDegree;
- }
- free(nd);
- return i;
- }
- nd->id = dg->numNodes;
- dg->node[dg->numNodes] = nd;
- dg->numNodes++;
+ memcpy(ar,tmpnd->outArc,(tmpnd->outDegree)*sizeof(DGArc*));
+ free(tmpnd->outArc);
+ tmpnd->outArc=ar;
+ for (j = 0; j < nd->outDegree; j++ ) {
+ nd->outArc[ j]->tail = tmpnd;
+ }
+ memcpy( &(tmpnd->outArc[tmpnd->outDegree]),nd->outArc,nd->outDegree*sizeof( DGArc *));
+ tmpnd->outDegree += nd->outDegree;
+ }
+ free(nd);
+ return i;
+ }
+ nd->id = dg->numNodes;
+ dg->node[dg->numNodes] = nd;
+ dg->numNodes++;
return nd->id;
}
int AttachArc(DGraph *dg,DGArc* nar){
-int arcId = -1;
+int arcId = -1;
int i=0,newNumber=0;
-DGNode *head = nar->head,
- *tail = nar->tail;
+DGNode *head = nar->head,
+ *tail = nar->tail;
DGArc **ars=NULL,*probe=NULL;
/*fprintf(stderr,"AttachArc %ld\n",dg->numArcs); */
- if ( !tail || !head ) return arcId;
- if ( dg->numArcs == dg->maxArcs-1 ) {
- dg->maxArcs += BLOCK_SIZE;
+ if ( !tail || !head ) return arcId;
+ if ( dg->numArcs == dg->maxArcs-1 ) {
+ dg->maxArcs += BLOCK_SIZE;
ars =(DGArc **) calloc(dg->maxArcs,sizeof(DGArc*));
- memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
- free(dg->arc);
- dg->arc=ars;
- }
- for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
- probe = tail->outArc[ i];
- if(probe->head == head
- &&
- probe->length == nar->length
+ memcpy(ars,dg->arc,(dg->maxArcs-BLOCK_SIZE)*sizeof(DGArc*));
+ free(dg->arc);
+ dg->arc=ars;
+ }
+ for(i = 0; i < tail->outDegree; i++ ) { /* parallel arc */
+ probe = tail->outArc[ i];
+ if(probe->head == head
+ &&
+ probe->length == nar->length
){
free(nar);
- return probe->id;
- }
- }
-
- nar->id = dg->numArcs;
- arcId=dg->numArcs;
- dg->arc[dg->numArcs] = nar;
- dg->numArcs++;
-
- head->inArc[ head->inDegree] = nar;
- head->inDegree++;
- if ( head->inDegree >= head->maxInDegree ) {
- newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
+ return probe->id;
+ }
+ }
+
+ nar->id = dg->numArcs;
+ arcId=dg->numArcs;
+ dg->arc[dg->numArcs] = nar;
+ dg->numArcs++;
+
+ head->inArc[ head->inDegree] = nar;
+ head->inDegree++;
+ if ( head->inDegree >= head->maxInDegree ) {
+ newNumber = head->maxInDegree + SMALL_BLOCK_SIZE;
ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
- memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
- free(head->inArc);
- head->inArc=ars;
- head->maxInDegree = newNumber;
- }
- tail->outArc[ tail->outDegree] = nar;
- tail->outDegree++;
- if(tail->outDegree >= tail->maxOutDegree ) {
- newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
+ memcpy(ars,head->inArc,(head->inDegree)*sizeof(DGArc*));
+ free(head->inArc);
+ head->inArc=ars;
+ head->maxInDegree = newNumber;
+ }
+ tail->outArc[ tail->outDegree] = nar;
+ tail->outDegree++;
+ if(tail->outDegree >= tail->maxOutDegree ) {
+ newNumber = tail->maxOutDegree + SMALL_BLOCK_SIZE;
ars =(DGArc **) calloc(newNumber,sizeof(DGArc*));
- memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
- free(tail->outArc);
- tail->outArc=ars;
- tail->maxOutDegree = newNumber;
- }
+ memcpy(ars,tail->outArc,(tail->outDegree)*sizeof(DGArc*));
+ free(tail->outArc);
+ tail->outArc=ars;
+ tail->maxOutDegree = newNumber;
+ }
/*fprintf(stderr,"AttachArc: head->in=%d tail->out=%ld\n",head->inDegree,tail->outDegree);*/
return arcId;
}
DGNode *focusNode = dg->node[ i];
if(DetailsLevel >= 2) {
for (j = 0; j < focusNode->inDegree; j++ ) {
- fprintf(stderr,"\t ");
- nodeShow(focusNode->inArc[ j]->tail);
+ fprintf(stderr,"\t ");
+ nodeShow(focusNode->inArc[ j]->tail);
}
}
nodeShow(focusNode);
for (j = 0; j < focusNode->outDegree; j++ ) {
fprintf(stderr, "\t ");
nodeShow(focusNode->outArc[ j]->head);
- }
+ }
fprintf(stderr, "---\n");
}
fprintf(stderr,"----------------------------------------\n");
* *
* N A S P A R A L L E L B E N C H M A R K S 3.3 *
* *
- * D T *
+ * D T *
* *
*************************************************************************
* *
* *
*************************************************************************
* *
- * Author: M. Frumkin * *
+ * Author: M. Frumkin * *
* *
*************************************************************************/
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
char *cmpi_inc,
char *cflags,
char *clinkflags );
-
+
void timer_clear( int n );
void timer_start( int n );
void timer_stop( int n );
verified = 0;
}else if(cls=='W') {
if(strstr(bmname,"BH")){
- verify_value = 4102461.0;
+ verify_value = 4102461.0;
}else if(strstr(bmname,"WH")){
- verify_value = 204280762.0;
+ verify_value = 204280762.0;
}else if(strstr(bmname,"SH")){
- verify_value = 186944764.0;
+ verify_value = 186944764.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
verified = 0;
}else if(cls=='A') {
if(strstr(bmname,"BH")){
- verify_value = 17809491.0;
+ verify_value = 17809491.0;
}else if(strstr(bmname,"WH")){
- verify_value = 1289925229.0;
+ verify_value = 1289925229.0;
}else if(strstr(bmname,"SH")){
- verify_value = 610856482.0;
+ verify_value = 610856482.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
- verified = 0;
+ verified = 0;
}else if(cls=='B') {
if(strstr(bmname,"BH")){
- verify_value = 4317114.0;
+ verify_value = 4317114.0;
}else if(strstr(bmname,"WH")){
- verify_value = 7877279917.0;
+ verify_value = 7877279917.0;
}else if(strstr(bmname,"SH")){
- verify_value = 1836863082.0;
+ verify_value = 1836863082.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
- verified = 0;
+ verified = 0;
}
}else if(cls=='C') {
if(strstr(bmname,"BH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"WH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"SH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
- verified = -1;
+ verified = -1;
}
}else if(cls=='D') {
if(strstr(bmname,"BH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"WH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else if(strstr(bmname,"SH")){
- verify_value = 0.0;
+ verify_value = 0.0;
}else{
fprintf(stderr,"No such benchmark as %s.\n",bmname);
}
}
fprintf(stderr," %s L2 Norm = %f\n",bmname,rnm2);
if(verified==-1){
- fprintf(stderr," No verification was performed.\n");
+ fprintf(stderr," No verification was performed.\n");
}else if( rnm2 - verify_value < epsilon &&
rnm2 - verify_value > -epsilon) { /* abs here does not work on ALTIX */
- verified = 1;
- fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
+ verified = 1;
+ fprintf(stderr," Deviation = %f\n",(rnm2 - verify_value));
}else{
- verified = 0;
- fprintf(stderr," The correct verification value = %f\n",verify_value);
- fprintf(stderr," Got value = %f\n",rnm2);
+ verified = 0;
+ fprintf(stderr," The correct verification value = %f\n",verify_value);
+ fprintf(stderr," Got value = %f\n",rnm2);
}
}else{
verified = -1;
id=AttachNode(dg,nd);
for(j=0;j<maxInDeg;j++){
sid=i*maxInDeg+j;
- if(sid>=numPrevLayerNodes) break;
+ if(sid>=numPrevLayerNodes) break;
snd=dg->node[firstLayerNode+sid];
ar=newArc(dg->node[id],snd);
AttachArc(dg,ar);
id=AttachNode(dg,nd);
for(j=0;j<maxInDeg;j++){
sid=i*maxInDeg+j;
- if(sid>=numPrevLayerNodes) break;
+ if(sid>=numPrevLayerNodes) break;
snd=dg->node[firstLayerNode+sid];
ar=newArc(snd,dg->node[id]);
AttachArc(dg,ar);
if(a->len>b->len) Resample(b,a->len);
for(i=fielddim;i<a->len-fielddim;i+=fielddim){
rms0=(a->val[i]-b->val[i])*(a->val[i]-b->val[i])
- +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
- +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
- +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
+ +(a->val[i+1]-b->val[i+1])*(a->val[i+1]-b->val[i+1])
+ +(a->val[i+2]-b->val[i+2])*(a->val[i+2]-b->val[i+2])
+ +(a->val[i+3]-b->val[i+3])*(a->val[i+3]-b->val[i+3]);
j=i+fielddim;
rms1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
- +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
- +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
- +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+ +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+ +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+ +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
j=i-fielddim;
rmsm1=(a->val[j]-b->val[j])*(a->val[j]-b->val[j])
- +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
- +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
- +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
+ +(a->val[j+1]-b->val[j+1])*(a->val[j+1]-b->val[j+1])
+ +(a->val[j+2]-b->val[j+2])*(a->val[j+2]-b->val[j+2])
+ +(a->val[j+3]-b->val[j+3])*(a->val[j+3]-b->val[j+3]);
k=0;
if(rms1<rms0){
k=1;
a->val[i+1]=weight*b->val[j+1];
a->val[i+2]=weight*b->val[j+2];
a->val[i+3]=weight*b->val[j+3];
- }
+ }
}
if(timer_on){
timer_stop(w);
timer_stop(0);
tot_time=timer_read(0);
c_print_results( dg->name,
- CLASS,
- featnum,
- 0,
- 0,
- dg->numNodes,
- 0,
- comm_size,
- tot_time,
- bytes_sent/tot_time,
- "bytes transmitted",
- verified,
- NPBVERSION,
- COMPILETIME,
- MPICC,
- CLINK,
- CMPI_LIB,
- CMPI_INC,
- CFLAGS,
- CLINKFLAGS );
+ CLASS,
+ featnum,
+ 0,
+ 0,
+ dg->numNodes,
+ 0,
+ comm_size,
+ tot_time,
+ bytes_sent/tot_time,
+ "bytes transmitted",
+ verified,
+ NPBVERSION,
+ COMPILETIME,
+ MPICC,
+ CLINK,
+ CMPI_LIB,
+ CMPI_INC,
+ CFLAGS,
+ CLINKFLAGS );
}
MPI_Finalize();
return 1;
{
int i;
long i246m1=0x00003FFFFFFFFFFF;
- long LLx, Lx, La;
+ long LLx, Lx, La;
double d2m46;
// This doesn't work, because the compiler does the calculation in 32
La = (long)a;
//fprintf(stdout,("================== Vranlc ================");
//fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
- LLx = Lx;
- for (i=0; i< n; i++) {
- Lx = Lx*La & i246m1 ;
- LLx = Lx;
- y[i] = d2m46 * (double)LLx;
- /*
- if(i == 0) {
- fprintf(stdout,("After loop 0:");
- fprintf(stdout,("Lx = " + Lx + ", La = " + La);
- fprintf(stdout,("d2m46 = " + d2m46);
- fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
- fprintf(stdout,("Y[0]" + y[0]);
- }
- */
- }
+ LLx = Lx;
+ for (i=0; i< n; i++) {
+ Lx = Lx*La & i246m1 ;
+ LLx = Lx;
+ y[i] = d2m46 * (double)LLx;
+ /*
+ if(i == 0) {
+ fprintf(stdout,("After loop 0:");
+ fprintf(stdout,("Lx = " + Lx + ", La = " + La);
+ fprintf(stdout,("d2m46 = " + d2m46);
+ fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
+ fprintf(stdout,("Y[0]" + y[0]);
+ }
+ */
+ }
x = (double)LLx;
/*
//-------------- the core (unique function) -----------
void doTest(int argc, char **argv) {
- double dum[3] = {1.,1.,1.};
- double x1, x2, sx, sy, tm, an, tt, gc;
- double Mops;
- double epsilon=1.0E-8, a = 1220703125., s=271828183.;
- double t1, t2, t3, t4;
- double sx_verify_value, sy_verify_value, sx_err, sy_err;
+ double dum[3] = {1.,1.,1.};
+ double x1, x2, sx, sy, tm, an, tt, gc;
+ double Mops;
+ double epsilon=1.0E-8, a = 1220703125., s=271828183.;
+ double t1, t2, t3, t4;
+ double sx_verify_value, sy_verify_value, sx_err, sy_err;
#include "npbparams.h"
- int mk=16,
- // --> set by make : in npbparams.h
- //m=28, // for CLASS=A
- //m=30, // for CLASS=B
- //npm=2, // NPROCS
- mm = m-mk,
- nn = (int)(pow(2,mm)),
- nk = (int)(pow(2,mk)),
- nq=10,
- np,
- node,
- no_nodes,
- i,
- ik,
- kk,
- l,
- k, nit, no_large_nodes,
- np_add, k_offset, j;
- int me, nprocs, root=0, dp_type;
- int verified,
- timers_enabled=true;
- char size[500]; // mind the size of the string to represent a big number
-
- //Use in randlc..
- int KS = 0;
- double R23, R46, T23, T46;
-
- double *qq = (double *) malloc (10000*sizeof(double));
- double *start = (double *) malloc (64*sizeof(double));
- double *elapsed = (double *) malloc (64*sizeof(double));
-
- double *x = (double *) malloc (2*nk*sizeof(double));
- double *q = (double *) malloc (nq*sizeof(double));
-
- MPI_Init( &argc, &argv );
- MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
- MPI_Comm_rank( MPI_COMM_WORLD, &node);
+ int mk=16,
+ // --> set by make : in npbparams.h
+ //m=28, // for CLASS=A
+ //m=30, // for CLASS=B
+ //npm=2, // NPROCS
+ mm = m-mk,
+ nn = (int)(pow(2,mm)),
+ nk = (int)(pow(2,mk)),
+ nq=10,
+ np,
+ node,
+ no_nodes,
+ i,
+ ik,
+ kk,
+ l,
+ k, nit, no_large_nodes,
+ np_add, k_offset, j;
+ int me, nprocs, root=0, dp_type;
+ int verified,
+ timers_enabled=true;
+ char size[500]; // mind the size of the string to represent a big number
+
+ //Use in randlc..
+ int KS = 0;
+ double R23, R46, T23, T46;
+
+ double *qq = (double *) malloc (10000*sizeof(double));
+ double *start = (double *) malloc (64*sizeof(double));
+ double *elapsed = (double *) malloc (64*sizeof(double));
+
+ double *x = (double *) malloc (2*nk*sizeof(double));
+ double *q = (double *) malloc (nq*sizeof(double));
+
+ MPI_Init( &argc, &argv );
+ MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
+ MPI_Comm_rank( MPI_COMM_WORLD, &node);
#ifdef USE_MPE
MPE_Init_log();
#endif
- root = 0;
- if (node == root ) {
-
- /* Because the size of the problem is too large to store in a 32-bit
- * integer for some classes, we put it into a string (for printing).
- * Have to strip off the decimal point put in there by the floating
- * point print statement (internal file)
- */
- fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
- sprintf(size,"%d",pow(2,m+1));
- //size = size.replace('.', ' ');
- fprintf(stdout," Number of random numbers generated: %s\n",size);
- fprintf(stdout," Number of active processes: %d\n",no_nodes);
-
- }
- verified = false;
-
- /* c Compute the number of "batches" of random number pairs generated
- c per processor. Adjust if the number of processors does not evenly
- c divide the total number
+ root = 0;
+ if (node == root ) {
+
+ /* Because the size of the problem is too large to store in a 32-bit
+ * integer for some classes, we put it into a string (for printing).
+ * Have to strip off the decimal point put in there by the floating
+ * point print statement (internal file)
+ */
+ fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
+ sprintf(size,"%d",pow(2,m+1));
+ //size = size.replace('.', ' ');
+ fprintf(stdout," Number of random numbers generated: %s\n",size);
+ fprintf(stdout," Number of active processes: %d\n",no_nodes);
+
+ }
+ verified = false;
+
+ /* c Compute the number of "batches" of random number pairs generated
+ c per processor. Adjust if the number of processors does not evenly
+ c divide the total number
*/
np = nn / no_nodes;
c sure these initializations cannot be eliminated as dead code.
*/
- //call vranlc(0, dum[1], dum[2], dum[3]);
- // Array indexes start at 1 in Fortran, 0 in Java
- vranlc(0, dum[0], dum[1], &(dum[2]));
-
- dum[0] = randlc(&(dum[1]),&(dum[2]));
- /////////////////////////////////
- for (i=0;i<2*nk;i++) {
- x[i] = -1e99;
- }
- Mops = log(sqrt(abs(1)));
-
- /*
- c---------------------------------------------------------------------
- c Synchronize before placing time stamp
- c---------------------------------------------------------------------
- */
+ //call vranlc(0, dum[1], dum[2], dum[3]);
+ // Array indexes start at 1 in Fortran, 0 in Java
+ vranlc(0, dum[0], dum[1], &(dum[2]));
+
+ dum[0] = randlc(&(dum[1]),&(dum[2]));
+ /////////////////////////////////
+ for (i=0;i<2*nk;i++) {
+ x[i] = -1e99;
+ }
+ Mops = log(sqrt(abs(1)));
+
+ /*
+ c---------------------------------------------------------------------
+ c Synchronize before placing time stamp
+ c---------------------------------------------------------------------
+ */
MPI_Barrier( MPI_COMM_WORLD );
timer_clear(&(elapsed[1]));
timer_start(&(start[1]));
t1 = a;
- //fprintf(stdout,("(ep.f:160) t1 = " + t1);
+ //fprintf(stdout,("(ep.f:160) t1 = " + t1);
t1 = vranlc(0, t1, a, x);
- //fprintf(stdout,("(ep.f:161) t1 = " + t1);
-
+ //fprintf(stdout,("(ep.f:161) t1 = " + t1);
+
/* c Compute AN = A ^ (2 * NK) (mod 2^46). */
t1 = a;
- //fprintf(stdout,("(ep.f:165) t1 = " + t1);
+ //fprintf(stdout,("(ep.f:165) t1 = " + t1);
for (i=1; i <= mk+1; i++) {
t2 = randlc(&t1, &t1);
- //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
+ //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
}
an = t1;
- //fprintf(stdout,("(ep.f:172) s = " + s);
+ //fprintf(stdout,("(ep.f:172) s = " + s);
tt = s;
gc = 0.;
sx = 0.;
for (i=1;i<=100 && !stop;i++) {
ik = kk / 2;
- //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
+ //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
if (2 * ik != kk) {
t3 = randlc(&t1, &t2);
//fprintf(stdout,("(ep.f:200) t1= " +t1 );
// Compute uniform pseudorandom numbers.
//if (timers_enabled) timer_start(3);
- timer_start(&(start[3]));
+ timer_start(&(start[3]));
//call vranlc(2 * nk, t1, a, x) --> t1 and y are modified
- //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
- //fprintf(stdout,"2*nk = " + (2*nk));
- //fprintf(stdout,"t1 = " + t1);
- //fprintf(stdout,"a = " + a);
- //fprintf(stdout,"x[0] = " + x[0]);
- //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+ //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
+ //fprintf(stdout,"2*nk = " + (2*nk));
+ //fprintf(stdout,"t1 = " + t1);
+ //fprintf(stdout,"a = " + a);
+ //fprintf(stdout,"x[0] = " + x[0]);
+ //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
- t1 = vranlc(2 * nk, t1, a, x);
-
- //fprintf(stdout,(">>>>>>>>>>>After Enter vranlc (l.210)<<<<<<");
- //fprintf(stdout,("2*nk = " + (2*nk));
- //fprintf(stdout,("t1 = " + t1);
- //fprintf(stdout,("a = " + a);
- //fprintf(stdout,("x[0] = " + x[0]);
- //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+ t1 = vranlc(2 * nk, t1, a, x);
+
+ //fprintf(stdout,(">>>>>>>>>>>After Enter vranlc (l.210)<<<<<<");
+ //fprintf(stdout,("2*nk = " + (2*nk));
+ //fprintf(stdout,("t1 = " + t1);
+ //fprintf(stdout,("a = " + a);
+ //fprintf(stdout,("x[0] = " + x[0]);
+ //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
//if (timers_enabled) timer_stop(3);
- timer_stop(3,elapsed,start);
+ timer_stop(3,elapsed,start);
/* Compute Gaussian deviates by acceptance-rejection method and
* tally counts in concentric square annuli. This loop is not
* vectorizable.
*/
//if (timers_enabled) timer_start(2);
- timer_start(&(start[2]));
+ timer_start(&(start[2]));
for(i=1; i<=nk;i++) {
x1 = 2. * x[2*i-2] -1.0;
x2 = 2. * x[2*i-1] - 1.0;
sx = sx + t3;
sy = sy + t4;
}
- /*
- if(i == 1) {
+ /*
+ if(i == 1) {
fprintf(stdout,"x1 = " + x1);
fprintf(stdout,"x2 = " + x2);
fprintf(stdout,"t1 = " + t1);
fprintf(stdout,"q[l] = " + q[l]);
fprintf(stdout,"sx = " + sx);
fprintf(stdout,"sy = " + sy);
- }
- */
+ }
+ */
}
//if (timers_enabled) timer_stop(2);
- timer_stop(2,elapsed,start);
+ timer_stop(2,elapsed,start);
}
//int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
- MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
- sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1
+ MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+ sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1
MPI_Allreduce(&sy, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
sy = x[0];
MPI_Allreduce(q, x, nq, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
for(i = 0; i < nq; i++) {
- q[i] = x[i];
- }
- for(i = 0; i < nq; i++) {
- gc += q[i];
- }
+ q[i] = x[i];
+ }
+ for(i = 0; i < nq; i++) {
+ gc += q[i];
+ }
- timer_stop(1,elapsed,start);
+ timer_stop(1,elapsed,start);
tm = timer_read(1,elapsed);
- MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
- tm = x[0];
-
- if(node == root) {
- nit = 0;
- verified = true;
-
- if(m == 24) {
- sx_verify_value = -3.247834652034740E3;
- sy_verify_value = -6.958407078382297E3;
- } else if(m == 25) {
- sx_verify_value = -2.863319731645753E3;
- sy_verify_value = -6.320053679109499E3;
- } else if(m == 28) {
- sx_verify_value = -4.295875165629892E3;
- sy_verify_value = -1.580732573678431E4;
- } else if(m == 30) {
- sx_verify_value = 4.033815542441498E4;
- sy_verify_value = -2.660669192809235E4;
- } else if(m == 32) {
- sx_verify_value = 4.764367927995374E4;
- sy_verify_value = -8.084072988043731E4;
- } else if(m == 36) {
- sx_verify_value = 1.982481200946593E5;
- sy_verify_value = -1.020596636361769E5;
- } else {
- verified = false;
- }
-
- /*
- fprintf(stdout,("sx = " + sx);
- fprintf(stdout,("sx_verify = " + sx_verify_value);
- fprintf(stdout,("sy = " + sy);
- fprintf(stdout,("sy_verify = " + sy_verify_value);
- */
- if(verified) {
- sx_err = abs((sx - sx_verify_value)/sx_verify_value);
- sy_err = abs((sy - sy_verify_value)/sy_verify_value);
- /*
- fprintf(stdout,("sx_err = " + sx_err);
- fprintf(stdout,("sy_err = " + sx_err);
- fprintf(stdout,("epsilon= " + epsilon);
- */
- verified = ((sx_err < epsilon) && (sy_err < epsilon));
- }
-
- Mops = (pow(2.0, m+1))/tm/1000;
-
- fprintf(stdout,"EP Benchmark Results:\n");
- fprintf(stdout,"CPU Time=%d\n",tm);
- fprintf(stdout,"N = 2^%d\n",m);
- fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
- fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
- fprintf(stdout,"Count:");
- for(i = 0; i < nq; i++) {
- fprintf(stdout,"%d\t %ld\n",i,q[i]);
- }
-
- /*
- print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
- "Random numbers generated", verified, npbversion,
- compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
- fprintf(stdout,"\nEP Benchmark Completed\n");
+ MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+ tm = x[0];
+
+ if(node == root) {
+ nit = 0;
+ verified = true;
+
+ if(m == 24) {
+ sx_verify_value = -3.247834652034740E3;
+ sy_verify_value = -6.958407078382297E3;
+ } else if(m == 25) {
+ sx_verify_value = -2.863319731645753E3;
+ sy_verify_value = -6.320053679109499E3;
+ } else if(m == 28) {
+ sx_verify_value = -4.295875165629892E3;
+ sy_verify_value = -1.580732573678431E4;
+ } else if(m == 30) {
+ sx_verify_value = 4.033815542441498E4;
+ sy_verify_value = -2.660669192809235E4;
+ } else if(m == 32) {
+ sx_verify_value = 4.764367927995374E4;
+ sy_verify_value = -8.084072988043731E4;
+ } else if(m == 36) {
+ sx_verify_value = 1.982481200946593E5;
+ sy_verify_value = -1.020596636361769E5;
+ } else {
+ verified = false;
+ }
+
+ /*
+ fprintf(stdout,("sx = " + sx);
+ fprintf(stdout,("sx_verify = " + sx_verify_value);
+ fprintf(stdout,("sy = " + sy);
+ fprintf(stdout,("sy_verify = " + sy_verify_value);
+ */
+ if(verified) {
+ sx_err = abs((sx - sx_verify_value)/sx_verify_value);
+ sy_err = abs((sy - sy_verify_value)/sy_verify_value);
+ /*
+ fprintf(stdout,("sx_err = " + sx_err);
+ fprintf(stdout,("sy_err = " + sx_err);
+ fprintf(stdout,("epsilon= " + epsilon);
+ */
+ verified = ((sx_err < epsilon) && (sy_err < epsilon));
+ }
+
+ Mops = (pow(2.0, m+1))/tm/1000;
+
+ fprintf(stdout,"EP Benchmark Results:\n");
+ fprintf(stdout,"CPU Time=%d\n",tm);
+ fprintf(stdout,"N = 2^%d\n",m);
+ fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
+ fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+ fprintf(stdout,"Count:");
+ for(i = 0; i < nq; i++) {
+ fprintf(stdout,"%d\t %ld\n",i,q[i]);
+ }
+
+ /*
+ print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
+ "Random numbers generated", verified, npbversion,
+ compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
+ fprintf(stdout,"\nEP Benchmark Completed\n");
fprintf(stdout,"Class = %s\n", _class);
- fprintf(stdout,"Size = %s\n", size);
- fprintf(stdout,"Iteration = %d\n", nit);
- fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
- fprintf(stdout,"Total processes = %d\n",no_nodes);
- fprintf(stdout,"Mops/s total = %lf\n",Mops);
- fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes);
- fprintf(stdout,"Operation type = Random number generated\n");
- if(verified) {
- fprintf(stdout,"Verification = SUCCESSFUL\n");
- } else {
- fprintf(stdout,"Verification = UNSUCCESSFUL\n");
- }
- fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000));
- fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
- fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
- }
+ fprintf(stdout,"Size = %s\n", size);
+ fprintf(stdout,"Iteration = %d\n", nit);
+ fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+ fprintf(stdout,"Total processes = %d\n",no_nodes);
+ fprintf(stdout,"Mops/s total = %lf\n",Mops);
+ fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes);
+ fprintf(stdout,"Operation type = Random number generated\n");
+ if(verified) {
+ fprintf(stdout,"Verification = SUCCESSFUL\n");
+ } else {
+ fprintf(stdout,"Verification = UNSUCCESSFUL\n");
+ }
+ fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000));
+ fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
+ fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+ }
#ifdef USE_MPE
MPE_Finish_log(argv[0]);
#endif
/************* portable random number generator ************/
/*****************************************************************/
-double randlc( double *X, double *A )
+double randlc( double *X, double *A )
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
{
int i;
long i246m1=0x00003FFFFFFFFFFF;
- long LLx, Lx, La;
+ long LLx, Lx, La;
double d2m46;
// This doesn't work, because the compiler does the calculation in 32
La = (long)a;
//fprintf(stdout,("================== Vranlc ================");
//fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
- LLx = Lx;
- for (i=0; i< n; i++) {
- Lx = Lx*La & i246m1 ;
- LLx = Lx;
- y[i] = d2m46 * (double)LLx;
- /*
- if(i == 0) {
- fprintf(stdout,("After loop 0:");
- fprintf(stdout,("Lx = " + Lx + ", La = " + La);
- fprintf(stdout,("d2m46 = " + d2m46);
- fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
- fprintf(stdout,("Y[0]" + y[0]);
- }
- */
- }
+ LLx = Lx;
+ for (i=0; i< n; i++) {
+ Lx = Lx*La & i246m1 ;
+ LLx = Lx;
+ y[i] = d2m46 * (double)LLx;
+ /*
+ if(i == 0) {
+ fprintf(stdout,("After loop 0:");
+ fprintf(stdout,("Lx = " + Lx + ", La = " + La);
+ fprintf(stdout,("d2m46 = " + d2m46);
+ fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
+ fprintf(stdout,("Y[0]" + y[0]);
+ }
+ */
+ }
x = (double)LLx;
/*
//-------------- the core (unique function) -----------
void doTest(int argc, char **argv) {
- double dum[3] = {1.,1.,1.};
- double x1, x2, sx, sy, tm, an, tt, gc;
- double Mops;
- double epsilon=1.0E-8, a = 1220703125., s=271828183.;
- double t1, t2, t3, t4;
- double sx_verify_value, sy_verify_value, sx_err, sy_err;
+ double dum[3] = {1.,1.,1.};
+ double x1, x2, sx, sy, tm, an, tt, gc;
+ double Mops;
+ double epsilon=1.0E-8, a = 1220703125., s=271828183.;
+ double t1, t2, t3, t4;
+ double sx_verify_value, sy_verify_value, sx_err, sy_err;
#include "npbparams.h"
- int mk=16,
- // --> set by make : in npbparams.h
- //m=28, // for CLASS=A
- //m=30, // for CLASS=B
- //npm=2, // NPROCS
- mm = m-mk,
- nn = (int)(pow(2,mm)),
- nk = (int)(pow(2,mk)),
- nq=10,
- np,
- node,
- no_nodes,
- i,
- ik,
- kk,
- l,
- k, nit, no_large_nodes,
- np_add, k_offset, j;
- int me, nprocs, root=0, dp_type;
- int verified,
- timers_enabled=true;
- char size[500]; // mind the size of the string to represent a big number
-
- //Use in randlc..
- int KS = 0;
- double R23, R46, T23, T46;
-
- double *qq = (double *) malloc (10000*sizeof(double));
- double *start = (double *) malloc (64*sizeof(double));
- double *elapsed = (double *) malloc (64*sizeof(double));
-
- double *x = (double *) malloc (2*nk*sizeof(double));
- double *q = (double *) malloc (nq*sizeof(double));
+ int mk=16,
+ // --> set by make : in npbparams.h
+ //m=28, // for CLASS=A
+ //m=30, // for CLASS=B
+ //npm=2, // NPROCS
+ mm = m-mk,
+ nn = (int)(pow(2,mm)),
+ nk = (int)(pow(2,mk)),
+ nq=10,
+ np,
+ node,
+ no_nodes,
+ i,
+ ik,
+ kk,
+ l,
+ k, nit, no_large_nodes,
+ np_add, k_offset, j;
+ int me, nprocs, root=0, dp_type;
+ int verified,
+ timers_enabled=true;
+ char size[500]; // mind the size of the string to represent a big number
+
+ //Use in randlc..
+ int KS = 0;
+ double R23, R46, T23, T46;
+
+ double *qq = (double *) malloc (10000*sizeof(double));
+ double *start = (double *) malloc (64*sizeof(double));
+ double *elapsed = (double *) malloc (64*sizeof(double));
+
+ double *x = (double *) malloc (2*nk*sizeof(double));
+ double *q = (double *) malloc (nq*sizeof(double));
TRACE_smpi_set_category ("start");
- MPI_Init( &argc, &argv );
- MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
- MPI_Comm_rank( MPI_COMM_WORLD, &node);
+ MPI_Init( &argc, &argv );
+ MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
+ MPI_Comm_rank( MPI_COMM_WORLD, &node);
#ifdef USE_MPE
MPE_Init_log();
#endif
- root = 0;
- if (node == root ) {
-
- /* Because the size of the problem is too large to store in a 32-bit
- * integer for some classes, we put it into a string (for printing).
- * Have to strip off the decimal point put in there by the floating
- * point print statement (internal file)
- */
- fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
- sprintf(size,"%d",pow(2,m+1));
- //size = size.replace('.', ' ');
- fprintf(stdout," Number of random numbers generated: %s\n",size);
- fprintf(stdout," Number of active processes: %d\n",no_nodes);
-
- }
- verified = false;
-
- /* c Compute the number of "batches" of random number pairs generated
- c per processor. Adjust if the number of processors does not evenly
- c divide the total number
+ root = 0;
+ if (node == root ) {
+
+ /* Because the size of the problem is too large to store in a 32-bit
+ * integer for some classes, we put it into a string (for printing).
+ * Have to strip off the decimal point put in there by the floating
+ * point print statement (internal file)
+ */
+ fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
+ sprintf(size,"%d",pow(2,m+1));
+ //size = size.replace('.', ' ');
+ fprintf(stdout," Number of random numbers generated: %s\n",size);
+ fprintf(stdout," Number of active processes: %d\n",no_nodes);
+
+ }
+ verified = false;
+
+ /* c Compute the number of "batches" of random number pairs generated
+ c per processor. Adjust if the number of processors does not evenly
+ c divide the total number
*/
np = nn / no_nodes;
c sure these initializations cannot be eliminated as dead code.
*/
- //call vranlc(0, dum[1], dum[2], dum[3]);
- // Array indexes start at 1 in Fortran, 0 in Java
- vranlc(0, dum[0], dum[1], &(dum[2]));
-
- dum[0] = randlc(&(dum[1]),&(dum[2]));
- /////////////////////////////////
- for (i=0;i<2*nk;i++) {
- x[i] = -1e99;
- }
- Mops = log(sqrt(abs(1)));
-
- /*
- c---------------------------------------------------------------------
- c Synchronize before placing time stamp
- c---------------------------------------------------------------------
- */
+ //call vranlc(0, dum[1], dum[2], dum[3]);
+ // Array indexes start at 1 in Fortran, 0 in Java
+ vranlc(0, dum[0], dum[1], &(dum[2]));
+
+ dum[0] = randlc(&(dum[1]),&(dum[2]));
+ /////////////////////////////////
+ for (i=0;i<2*nk;i++) {
+ x[i] = -1e99;
+ }
+ Mops = log(sqrt(abs(1)));
+
+ /*
+ c---------------------------------------------------------------------
+ c Synchronize before placing time stamp
+ c---------------------------------------------------------------------
+ */
MPI_Barrier( MPI_COMM_WORLD );
timer_start(&(start[1]));
t1 = a;
- //fprintf(stdout,("(ep.f:160) t1 = " + t1);
+ //fprintf(stdout,("(ep.f:160) t1 = " + t1);
t1 = vranlc(0, t1, a, x);
- //fprintf(stdout,("(ep.f:161) t1 = " + t1);
-
+ //fprintf(stdout,("(ep.f:161) t1 = " + t1);
+
/* c Compute AN = A ^ (2 * NK) (mod 2^46). */
t1 = a;
- //fprintf(stdout,("(ep.f:165) t1 = " + t1);
+ //fprintf(stdout,("(ep.f:165) t1 = " + t1);
for (i=1; i <= mk+1; i++) {
t2 = randlc(&t1, &t1);
- //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
+ //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
}
an = t1;
- //fprintf(stdout,("(ep.f:172) s = " + s);
+ //fprintf(stdout,("(ep.f:172) s = " + s);
tt = s;
gc = 0.;
sx = 0.;
for (i=1;i<=100 && !stop;i++) {
ik = kk / 2;
- //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
+ //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
if (2 * ik != kk) {
t3 = randlc(&t1, &t2);
//fprintf(stdout,("(ep.f:200) t1= " +t1 );
// Compute uniform pseudorandom numbers.
//if (timers_enabled) timer_start(3);
- timer_start(&(start[3]));
+ timer_start(&(start[3]));
//call vranlc(2 * nk, t1, a, x) --> t1 and y are modified
- //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
- //fprintf(stdout,"2*nk = " + (2*nk));
- //fprintf(stdout,"t1 = " + t1);
- //fprintf(stdout,"a = " + a);
- //fprintf(stdout,"x[0] = " + x[0]);
- //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+ //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
+ //fprintf(stdout,"2*nk = " + (2*nk));
+ //fprintf(stdout,"t1 = " + t1);
+ //fprintf(stdout,"a = " + a);
+ //fprintf(stdout,"x[0] = " + x[0]);
+ //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
- t1 = vranlc(2 * nk, t1, a, x);
-
- //fprintf(stdout,(">>>>>>>>>>>After Enter vranlc (l.210)<<<<<<");
- //fprintf(stdout,("2*nk = " + (2*nk));
- //fprintf(stdout,("t1 = " + t1);
- //fprintf(stdout,("a = " + a);
- //fprintf(stdout,("x[0] = " + x[0]);
- //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+ t1 = vranlc(2 * nk, t1, a, x);
+
+ //fprintf(stdout,(">>>>>>>>>>>After Enter vranlc (l.210)<<<<<<");
+ //fprintf(stdout,("2*nk = " + (2*nk));
+ //fprintf(stdout,("t1 = " + t1);
+ //fprintf(stdout,("a = " + a);
+ //fprintf(stdout,("x[0] = " + x[0]);
+ //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
//if (timers_enabled) timer_stop(3);
- timer_stop(3,elapsed,start);
+ timer_stop(3,elapsed,start);
/* Compute Gaussian deviates by acceptance-rejection method and
* tally counts in concentric square annuli. This loop is not
* vectorizable.
*/
//if (timers_enabled) timer_start(2);
- timer_start(&(start[2]));
+ timer_start(&(start[2]));
for(i=1; i<=nk;i++) {
x1 = 2. * x[2*i-2] -1.0;
x2 = 2. * x[2*i-1] - 1.0;
sx = sx + t3;
sy = sy + t4;
}
- /*
- if(i == 1) {
+ /*
+ if(i == 1) {
fprintf(stdout,"x1 = " + x1);
fprintf(stdout,"x2 = " + x2);
fprintf(stdout,"t1 = " + t1);
fprintf(stdout,"q[l] = " + q[l]);
fprintf(stdout,"sx = " + sx);
fprintf(stdout,"sy = " + sy);
- }
- */
+ }
+ */
}
//if (timers_enabled) timer_stop(2);
- timer_stop(2,elapsed,start);
+ timer_stop(2,elapsed,start);
}
TRACE_smpi_set_category ("finalize");
//int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
- MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
- sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1
+ MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+ sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1
MPI_Allreduce(&sy, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
sy = x[0];
MPI_Allreduce(q, x, nq, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
for(i = 0; i < nq; i++) {
- q[i] = x[i];
- }
- for(i = 0; i < nq; i++) {
- gc += q[i];
- }
+ q[i] = x[i];
+ }
+ for(i = 0; i < nq; i++) {
+ gc += q[i];
+ }
- timer_stop(1,elapsed,start);
+ timer_stop(1,elapsed,start);
tm = timer_read(1,elapsed);
- MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
- tm = x[0];
-
- if(node == root) {
- nit = 0;
- verified = true;
-
- if(m == 24) {
- sx_verify_value = -3.247834652034740E3;
- sy_verify_value = -6.958407078382297E3;
- } else if(m == 25) {
- sx_verify_value = -2.863319731645753E3;
- sy_verify_value = -6.320053679109499E3;
- } else if(m == 28) {
- sx_verify_value = -4.295875165629892E3;
- sy_verify_value = -1.580732573678431E4;
- } else if(m == 30) {
- sx_verify_value = 4.033815542441498E4;
- sy_verify_value = -2.660669192809235E4;
- } else if(m == 32) {
- sx_verify_value = 4.764367927995374E4;
- sy_verify_value = -8.084072988043731E4;
- } else if(m == 36) {
- sx_verify_value = 1.982481200946593E5;
- sy_verify_value = -1.020596636361769E5;
- } else {
- verified = false;
- }
-
- /*
- fprintf(stdout,("sx = " + sx);
- fprintf(stdout,("sx_verify = " + sx_verify_value);
- fprintf(stdout,("sy = " + sy);
- fprintf(stdout,("sy_verify = " + sy_verify_value);
- */
- if(verified) {
- sx_err = abs((sx - sx_verify_value)/sx_verify_value);
- sy_err = abs((sy - sy_verify_value)/sy_verify_value);
- /*
- fprintf(stdout,("sx_err = " + sx_err);
- fprintf(stdout,("sy_err = " + sx_err);
- fprintf(stdout,("epsilon= " + epsilon);
- */
- verified = ((sx_err < epsilon) && (sy_err < epsilon));
- }
-
- Mops = (pow(2.0, m+1))/tm/1000;
-
- fprintf(stdout,"EP Benchmark Results:\n");
- fprintf(stdout,"CPU Time=%d\n",tm);
- fprintf(stdout,"N = 2^%d\n",m);
- fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
- fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
- fprintf(stdout,"Count:");
- for(i = 0; i < nq; i++) {
- fprintf(stdout,"%d\t %ld\n",i,q[i]);
- }
-
- /*
- print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
- "Random numbers generated", verified, npbversion,
- compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
- fprintf(stdout,"\nEP Benchmark Completed\n");
+ MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+ tm = x[0];
+
+ if(node == root) {
+ nit = 0;
+ verified = true;
+
+ if(m == 24) {
+ sx_verify_value = -3.247834652034740E3;
+ sy_verify_value = -6.958407078382297E3;
+ } else if(m == 25) {
+ sx_verify_value = -2.863319731645753E3;
+ sy_verify_value = -6.320053679109499E3;
+ } else if(m == 28) {
+ sx_verify_value = -4.295875165629892E3;
+ sy_verify_value = -1.580732573678431E4;
+ } else if(m == 30) {
+ sx_verify_value = 4.033815542441498E4;
+ sy_verify_value = -2.660669192809235E4;
+ } else if(m == 32) {
+ sx_verify_value = 4.764367927995374E4;
+ sy_verify_value = -8.084072988043731E4;
+ } else if(m == 36) {
+ sx_verify_value = 1.982481200946593E5;
+ sy_verify_value = -1.020596636361769E5;
+ } else {
+ verified = false;
+ }
+
+ /*
+ fprintf(stdout,("sx = " + sx);
+ fprintf(stdout,("sx_verify = " + sx_verify_value);
+ fprintf(stdout,("sy = " + sy);
+ fprintf(stdout,("sy_verify = " + sy_verify_value);
+ */
+ if(verified) {
+ sx_err = abs((sx - sx_verify_value)/sx_verify_value);
+ sy_err = abs((sy - sy_verify_value)/sy_verify_value);
+ /*
+ fprintf(stdout,("sx_err = " + sx_err);
+ fprintf(stdout,("sy_err = " + sx_err);
+ fprintf(stdout,("epsilon= " + epsilon);
+ */
+ verified = ((sx_err < epsilon) && (sy_err < epsilon));
+ }
+
+ Mops = (pow(2.0, m+1))/tm/1000;
+
+ fprintf(stdout,"EP Benchmark Results:\n");
+ fprintf(stdout,"CPU Time=%d\n",tm);
+ fprintf(stdout,"N = 2^%d\n",m);
+ fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
+ fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+ fprintf(stdout,"Count:");
+ for(i = 0; i < nq; i++) {
+ fprintf(stdout,"%d\t %ld\n",i,q[i]);
+ }
+
+ /*
+ print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
+ "Random numbers generated", verified, npbversion,
+ compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
+ fprintf(stdout,"\nEP Benchmark Completed\n");
fprintf(stdout,"Class = %s\n", _class);
- fprintf(stdout,"Size = %s\n", size);
- fprintf(stdout,"Iteration = %d\n", nit);
- fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
- fprintf(stdout,"Total processes = %d\n",no_nodes);
- fprintf(stdout,"Mops/s total = %lf\n",Mops);
- fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes);
- fprintf(stdout,"Operation type = Random number generated\n");
- if(verified) {
- fprintf(stdout,"Verification = SUCCESSFUL\n");
- } else {
- fprintf(stdout,"Verification = UNSUCCESSFUL\n");
- }
- fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000));
- fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
- fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
- }
+ fprintf(stdout,"Size = %s\n", size);
+ fprintf(stdout,"Iteration = %d\n", nit);
+ fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+ fprintf(stdout,"Total processes = %d\n",no_nodes);
+ fprintf(stdout,"Mops/s total = %lf\n",Mops);
+ fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes);
+ fprintf(stdout,"Operation type = Random number generated\n");
+ if(verified) {
+ fprintf(stdout,"Verification = SUCCESSFUL\n");
+ } else {
+ fprintf(stdout,"Verification = UNSUCCESSFUL\n");
+ }
+ fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000));
+ fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
+ fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+ }
#ifdef USE_MPE
MPE_Finish_log(argv[0]);
#endif
/************* portable random number generator ************/
/*****************************************************************/
-double randlc( double *X, double *A )
+double randlc( double *X, double *A )
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
{
int i;
long i246m1=0x00003FFFFFFFFFFF;
- long LLx, Lx, La;
+ long LLx, Lx, La;
double d2m46;
// This doesn't work, because the compiler does the calculation in 32
La = (long)a;
//fprintf(stdout,("================== Vranlc ================");
//fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
- LLx = Lx;
- for (i=0; i< n; i++) {
- Lx = Lx*La & i246m1 ;
- LLx = Lx;
- y[i] = d2m46 * (double)LLx;
- /*
- if(i == 0) {
- fprintf(stdout,("After loop 0:");
- fprintf(stdout,("Lx = " + Lx + ", La = " + La);
- fprintf(stdout,("d2m46 = " + d2m46);
- fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
- fprintf(stdout,("Y[0]" + y[0]);
- }
- */
- }
+ LLx = Lx;
+ for (i=0; i< n; i++) {
+ Lx = Lx*La & i246m1 ;
+ LLx = Lx;
+ y[i] = d2m46 * (double)LLx;
+ /*
+ if(i == 0) {
+ fprintf(stdout,("After loop 0:");
+ fprintf(stdout,("Lx = " + Lx + ", La = " + La);
+ fprintf(stdout,("d2m46 = " + d2m46);
+ fprintf(stdout,("LLX(Lx) = " + LLX.doubleValue());
+ fprintf(stdout,("Y[0]" + y[0]);
+ }
+ */
+ }
x = (double)LLx;
/*
//-------------- the core (unique function) -----------
void doTest(int argc, char **argv) {
- double dum[3] = {1.,1.,1.};
- double x1, x2, sx, sy, tm, an, tt, gc;
- double Mops;
- double epsilon=1.0E-8, a = 1220703125., s=271828183.;
- double t1, t2, t3, t4;
- double sx_verify_value, sy_verify_value, sx_err, sy_err;
+ double dum[3] = {1.,1.,1.};
+ double x1, x2, sx, sy, tm, an, tt, gc;
+ double Mops;
+ double epsilon=1.0E-8, a = 1220703125., s=271828183.;
+ double t1, t2, t3, t4;
+ double sx_verify_value, sy_verify_value, sx_err, sy_err;
#include "npbparams.h"
- int mk=16,
- // --> set by make : in npbparams.h
- //m=28, // for CLASS=A
- //m=30, // for CLASS=B
- //npm=2, // NPROCS
- mm = m-mk,
- nn = (int)(pow(2,mm)),
- nk = (int)(pow(2,mk)),
- nq=10,
- np,
- node,
- no_nodes,
- i,
- ik,
- kk,
- l,
- k, nit, no_large_nodes,
- np_add, k_offset, j;
- int me, nprocs, root=0, dp_type;
- int verified,
- timers_enabled=true;
- char size[500]; // mind the size of the string to represent a big number
-
- //Use in randlc..
- int KS = 0;
- double R23, R46, T23, T46;
-
- double *qq = (double *) malloc (10000*sizeof(double));
- double *start = (double *) malloc (64*sizeof(double));
- double *elapsed = (double *) malloc (64*sizeof(double));
-
- double *x = (double *) malloc (2*nk*sizeof(double));
- double *q = (double *) malloc (nq*sizeof(double));
-
- MPI_Init( &argc, &argv );
- MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
- MPI_Comm_rank( MPI_COMM_WORLD, &node);
+ int mk=16,
+ // --> set by make : in npbparams.h
+ //m=28, // for CLASS=A
+ //m=30, // for CLASS=B
+ //npm=2, // NPROCS
+ mm = m-mk,
+ nn = (int)(pow(2,mm)),
+ nk = (int)(pow(2,mk)),
+ nq=10,
+ np,
+ node,
+ no_nodes,
+ i,
+ ik,
+ kk,
+ l,
+ k, nit, no_large_nodes,
+ np_add, k_offset, j;
+ int me, nprocs, root=0, dp_type;
+ int verified,
+ timers_enabled=true;
+ char size[500]; // mind the size of the string to represent a big number
+
+ //Use in randlc..
+ int KS = 0;
+ double R23, R46, T23, T46;
+
+ double *qq = (double *) malloc (10000*sizeof(double));
+ double *start = (double *) malloc (64*sizeof(double));
+ double *elapsed = (double *) malloc (64*sizeof(double));
+
+ double *x = (double *) malloc (2*nk*sizeof(double));
+ double *q = (double *) malloc (nq*sizeof(double));
+
+ MPI_Init( &argc, &argv );
+ MPI_Comm_size( MPI_COMM_WORLD, &no_nodes);
+ MPI_Comm_rank( MPI_COMM_WORLD, &node);
#ifdef USE_MPE
MPE_Init_log();
#endif
- root = 0;
- if (node == root ) {
-
- /* Because the size of the problem is too large to store in a 32-bit
- * integer for some classes, we put it into a string (for printing).
- * Have to strip off the decimal point put in there by the floating
- * point print statement (internal file)
- */
- fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
- sprintf(size,"%d",pow(2,m+1));
- //size = size.replace('.', ' ');
- fprintf(stdout," Number of random numbers generated: %s\n",size);
- fprintf(stdout," Number of active processes: %d\n",no_nodes);
-
- }
- verified = false;
-
- /* c Compute the number of "batches" of random number pairs generated
- c per processor. Adjust if the number of processors does not evenly
- c divide the total number
+ root = 0;
+ if (node == root ) {
+
+ /* Because the size of the problem is too large to store in a 32-bit
+ * integer for some classes, we put it into a string (for printing).
+ * Have to strip off the decimal point put in there by the floating
+ * point print statement (internal file)
+ */
+ fprintf(stdout," NAS Parallel Benchmarks 3.2 -- EP Benchmark");
+ sprintf(size,"%d",pow(2,m+1));
+ //size = size.replace('.', ' ');
+ fprintf(stdout," Number of random numbers generated: %s\n",size);
+ fprintf(stdout," Number of active processes: %d\n",no_nodes);
+
+ }
+ verified = false;
+
+ /* c Compute the number of "batches" of random number pairs generated
+ c per processor. Adjust if the number of processors does not evenly
+ c divide the total number
*/
np = nn / no_nodes;
c sure these initializations cannot be eliminated as dead code.
*/
- //call vranlc(0, dum[1], dum[2], dum[3]);
- // Array indexes start at 1 in Fortran, 0 in Java
- vranlc(0, dum[0], dum[1], &(dum[2]));
-
- dum[0] = randlc(&(dum[1]),&(dum[2]));
- /////////////////////////////////
- for (i=0;i<2*nk;i++) {
- x[i] = -1e99;
- }
- Mops = log(sqrt(abs(1)));
-
- /*
- c---------------------------------------------------------------------
- c Synchronize before placing time stamp
- c---------------------------------------------------------------------
- */
+ //call vranlc(0, dum[1], dum[2], dum[3]);
+ // Array indexes start at 1 in Fortran, 0 in Java
+ vranlc(0, dum[0], dum[1], &(dum[2]));
+
+ dum[0] = randlc(&(dum[1]),&(dum[2]));
+ /////////////////////////////////
+ for (i=0;i<2*nk;i++) {
+ x[i] = -1e99;
+ }
+ Mops = log(sqrt(abs(1)));
+
+ /*
+ c---------------------------------------------------------------------
+ c Synchronize before placing time stamp
+ c---------------------------------------------------------------------
+ */
MPI_Barrier( MPI_COMM_WORLD );
timer_clear(&(elapsed[1]));
timer_start(&(start[1]));
t1 = a;
- //fprintf(stdout,("(ep.f:160) t1 = " + t1);
+ //fprintf(stdout,("(ep.f:160) t1 = " + t1);
t1 = vranlc(0, t1, a, x);
- //fprintf(stdout,("(ep.f:161) t1 = " + t1);
-
+ //fprintf(stdout,("(ep.f:161) t1 = " + t1);
+
/* c Compute AN = A ^ (2 * NK) (mod 2^46). */
t1 = a;
- //fprintf(stdout,("(ep.f:165) t1 = " + t1);
+ //fprintf(stdout,("(ep.f:165) t1 = " + t1);
for (i=1; i <= mk+1; i++) {
t2 = randlc(&t1, &t1);
- //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
+ //fprintf(stdout,("(ep.f:168)[loop i=" + i +"] t1 = " + t1);
}
an = t1;
- //fprintf(stdout,("(ep.f:172) s = " + s);
+ //fprintf(stdout,("(ep.f:172) s = " + s);
tt = s;
gc = 0.;
sx = 0.;
for (i=1;i<=100 && !stop;i++) {
ik = kk / 2;
- //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
+ //fprintf(stdout,("(ep.f:199) ik = " +ik+", kk = " + kk);
if (2 * ik != kk) {
t3 = randlc(&t1, &t2);
//fprintf(stdout,("(ep.f:200) t1= " +t1 );
// Compute uniform pseudorandom numbers.
//if (timers_enabled) timer_start(3);
- timer_start(&(start[3]));
+ timer_start(&(start[3]));
//call vranlc(2 * nk, t1, a, x) --> t1 and y are modified
- //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
- //fprintf(stdout,"2*nk = " + (2*nk));
- //fprintf(stdout,"t1 = " + t1);
- //fprintf(stdout,"a = " + a);
- //fprintf(stdout,"x[0] = " + x[0]);
- //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+ //fprintf(stdout,">>>>>>>>>>>Before vranlc(l.210)<<<<<<<<<<<<<");
+ //fprintf(stdout,"2*nk = " + (2*nk));
+ //fprintf(stdout,"t1 = " + t1);
+ //fprintf(stdout,"a = " + a);
+ //fprintf(stdout,"x[0] = " + x[0]);
+ //fprintf(stdout,">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
- t1 = vranlc(2 * nk, t1, a, x);
-
- //fprintf(stdout,(">>>>>>>>>>>After Enter vranlc (l.210)<<<<<<");
- //fprintf(stdout,("2*nk = " + (2*nk));
- //fprintf(stdout,("t1 = " + t1);
- //fprintf(stdout,("a = " + a);
- //fprintf(stdout,("x[0] = " + x[0]);
- //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
+ t1 = vranlc(2 * nk, t1, a, x);
+
+ //fprintf(stdout,(">>>>>>>>>>>After Enter vranlc (l.210)<<<<<<");
+ //fprintf(stdout,("2*nk = " + (2*nk));
+ //fprintf(stdout,("t1 = " + t1);
+ //fprintf(stdout,("a = " + a);
+ //fprintf(stdout,("x[0] = " + x[0]);
+ //fprintf(stdout,(">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<");
//if (timers_enabled) timer_stop(3);
- timer_stop(3,elapsed,start);
+ timer_stop(3,elapsed,start);
/* Compute Gaussian deviates by acceptance-rejection method and
* tally counts in concentric square annuli. This loop is not
* vectorizable.
*/
//if (timers_enabled) timer_start(2);
- timer_start(&(start[2]));
+ timer_start(&(start[2]));
for(i=1; i<=nk;i++) {
x1 = 2. * x[2*i-2] -1.0;
x2 = 2. * x[2*i-1] - 1.0;
sx = sx + t3;
sy = sy + t4;
}
- /*
- if(i == 1) {
+ /*
+ if(i == 1) {
fprintf(stdout,"x1 = " + x1);
fprintf(stdout,"x2 = " + x2);
fprintf(stdout,"t1 = " + t1);
fprintf(stdout,"q[l] = " + q[l]);
fprintf(stdout,"sx = " + sx);
fprintf(stdout,"sy = " + sy);
- }
- */
+ }
+ */
}
//if (timers_enabled) timer_stop(2);
- timer_stop(2,elapsed,start);
+ timer_stop(2,elapsed,start);
}
//int MPI_Allreduce(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
- MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
- sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1
+ MPI_Allreduce(&sx, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+ sx = x[0]; //FIXME : x[0] or x[1] => x[0] because fortran starts with 1
MPI_Allreduce(&sy, x, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
sy = x[0];
MPI_Allreduce(q, x, nq, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
for(i = 0; i < nq; i++) {
- q[i] = x[i];
- }
- for(i = 0; i < nq; i++) {
- gc += q[i];
- }
+ q[i] = x[i];
+ }
+ for(i = 0; i < nq; i++) {
+ gc += q[i];
+ }
- timer_stop(1,elapsed,start);
+ timer_stop(1,elapsed,start);
tm = timer_read(1,elapsed);
- MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
- tm = x[0];
-
- if(node == root) {
- nit = 0;
- verified = true;
-
- if(m == 24) {
- sx_verify_value = -3.247834652034740E3;
- sy_verify_value = -6.958407078382297E3;
- } else if(m == 25) {
- sx_verify_value = -2.863319731645753E3;
- sy_verify_value = -6.320053679109499E3;
- } else if(m == 28) {
- sx_verify_value = -4.295875165629892E3;
- sy_verify_value = -1.580732573678431E4;
- } else if(m == 30) {
- sx_verify_value = 4.033815542441498E4;
- sy_verify_value = -2.660669192809235E4;
- } else if(m == 32) {
- sx_verify_value = 4.764367927995374E4;
- sy_verify_value = -8.084072988043731E4;
- } else if(m == 36) {
- sx_verify_value = 1.982481200946593E5;
- sy_verify_value = -1.020596636361769E5;
- } else {
- verified = false;
- }
-
- /*
- fprintf(stdout,("sx = " + sx);
- fprintf(stdout,("sx_verify = " + sx_verify_value);
- fprintf(stdout,("sy = " + sy);
- fprintf(stdout,("sy_verify = " + sy_verify_value);
- */
- if(verified) {
- sx_err = abs((sx - sx_verify_value)/sx_verify_value);
- sy_err = abs((sy - sy_verify_value)/sy_verify_value);
- /*
- fprintf(stdout,("sx_err = " + sx_err);
- fprintf(stdout,("sy_err = " + sx_err);
- fprintf(stdout,("epsilon= " + epsilon);
- */
- verified = ((sx_err < epsilon) && (sy_err < epsilon));
- }
-
- Mops = (pow(2.0, m+1))/tm/1000;
-
- fprintf(stdout,"EP Benchmark Results:\n");
- fprintf(stdout,"CPU Time=%d\n",tm);
- fprintf(stdout,"N = 2^%d\n",m);
- fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
- fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
- fprintf(stdout,"Count:");
- for(i = 0; i < nq; i++) {
- fprintf(stdout,"%d\t %ld\n",i,q[i]);
- }
-
- /*
- print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
- "Random numbers generated", verified, npbversion,
- compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
- fprintf(stdout,"\nEP Benchmark Completed\n");
+ MPI_Allreduce(&tm, x, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+ tm = x[0];
+
+ if(node == root) {
+ nit = 0;
+ verified = true;
+
+ if(m == 24) {
+ sx_verify_value = -3.247834652034740E3;
+ sy_verify_value = -6.958407078382297E3;
+ } else if(m == 25) {
+ sx_verify_value = -2.863319731645753E3;
+ sy_verify_value = -6.320053679109499E3;
+ } else if(m == 28) {
+ sx_verify_value = -4.295875165629892E3;
+ sy_verify_value = -1.580732573678431E4;
+ } else if(m == 30) {
+ sx_verify_value = 4.033815542441498E4;
+ sy_verify_value = -2.660669192809235E4;
+ } else if(m == 32) {
+ sx_verify_value = 4.764367927995374E4;
+ sy_verify_value = -8.084072988043731E4;
+ } else if(m == 36) {
+ sx_verify_value = 1.982481200946593E5;
+ sy_verify_value = -1.020596636361769E5;
+ } else {
+ verified = false;
+ }
+
+ /*
+ fprintf(stdout,("sx = " + sx);
+ fprintf(stdout,("sx_verify = " + sx_verify_value);
+ fprintf(stdout,("sy = " + sy);
+ fprintf(stdout,("sy_verify = " + sy_verify_value);
+ */
+ if(verified) {
+ sx_err = abs((sx - sx_verify_value)/sx_verify_value);
+ sy_err = abs((sy - sy_verify_value)/sy_verify_value);
+ /*
+ fprintf(stdout,("sx_err = " + sx_err);
+ fprintf(stdout,("sy_err = " + sx_err);
+ fprintf(stdout,("epsilon= " + epsilon);
+ */
+ verified = ((sx_err < epsilon) && (sy_err < epsilon));
+ }
+
+ Mops = (pow(2.0, m+1))/tm/1000;
+
+ fprintf(stdout,"EP Benchmark Results:\n");
+ fprintf(stdout,"CPU Time=%d\n",tm);
+ fprintf(stdout,"N = 2^%d\n",m);
+ fprintf(stdout,"No. Gaussain Pairs =%d\n",gc);
+ fprintf(stdout,"Sum = %lf %ld\n",sx,sy);
+ fprintf(stdout,"Count:");
+ for(i = 0; i < nq; i++) {
+ fprintf(stdout,"%d\t %ld\n",i,q[i]);
+ }
+
+ /*
+ print_results("EP", _class, m+1, 0, 0, nit, npm, no_nodes, tm, Mops,
+ "Random numbers generated", verified, npbversion,
+ compiletime, cs1, cs2, cs3, cs4, cs5, cs6, cs7) */
+ fprintf(stdout,"\nEP Benchmark Completed\n");
fprintf(stdout,"Class = %s\n", _class);
- fprintf(stdout,"Size = %s\n", size);
- fprintf(stdout,"Iteration = %d\n", nit);
- fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
- fprintf(stdout,"Total processes = %d\n",no_nodes);
- fprintf(stdout,"Mops/s total = %lf\n",Mops);
- fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes);
- fprintf(stdout,"Operation type = Random number generated\n");
- if(verified) {
- fprintf(stdout,"Verification = SUCCESSFUL\n");
- } else {
- fprintf(stdout,"Verification = UNSUCCESSFUL\n");
- }
- fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000));
- fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
- fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
- }
+ fprintf(stdout,"Size = %s\n", size);
+ fprintf(stdout,"Iteration = %d\n", nit);
+ fprintf(stdout,"Time in seconds = %lf\n",(tm/1000));
+ fprintf(stdout,"Total processes = %d\n",no_nodes);
+ fprintf(stdout,"Mops/s total = %lf\n",Mops);
+ fprintf(stdout,"Mops/s/process = %lf\n", Mops/no_nodes);
+ fprintf(stdout,"Operation type = Random number generated\n");
+ if(verified) {
+ fprintf(stdout,"Verification = SUCCESSFUL\n");
+ } else {
+ fprintf(stdout,"Verification = UNSUCCESSFUL\n");
+ }
+ fprintf(stdout,"Total time: %lf\n",(timer_read(1,elapsed)/1000));
+ fprintf(stdout,"Gaussian pairs: %lf\n",(timer_read(2,elapsed)/1000));
+ fprintf(stdout,"Random numbers: %lf\n",(timer_read(3,elapsed)/1000));
+ }
#ifdef USE_MPE
MPE_Finish_log(argv[0]);
#endif
/************* portable random number generator ************/
/*****************************************************************/
-double randlc( double *X, double *A )
+double randlc( double *X, double *A )
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
/***********************/
/* function prototypes */
/***********************/
-double randlc( double *X, double *A );
+double randlc( double *X, double *A );
void full_verify( global_data* gd );
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
/************* portable random number generator ************/
/*****************************************************************/
-double randlc( double *X, double *A )
+double randlc( double *X, double *A )
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
/************* C R E A T E _ S E Q ************/
/*****************************************************************/
-void create_seq( global_data* gd, double seed, double a )
+void create_seq( global_data* gd, double seed, double a )
{
- double x;
- int i, k;
+ double x;
+ int i, k;
k = MAX_KEY/4;
- for (i=0; i<NUM_KEYS; i++)
- {
- x = randlc(&seed, &a);
- x += randlc(&seed, &a);
- x += randlc(&seed, &a);
- x += randlc(&seed, &a);
+ for (i=0; i<NUM_KEYS; i++)
+ {
+ x = randlc(&seed, &a);
+ x += randlc(&seed, &a);
+ x += randlc(&seed, &a);
+ x += randlc(&seed, &a);
gd->key_array[i] = k*x;
- }
+ }
}
break;
case 'A':
if( i <= 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+(iteration-1) )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-(iteration-1) )
break;
case 'B':
if( i == 1 || i == 2 || i == 4 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
break;
case 'C':
if( i <= 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
break;
case 'D':
if( i < 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
/***********************/
/* function prototypes */
/***********************/
-double randlc( double *X, double *A );
+double randlc( double *X, double *A );
void full_verify( global_data* gd );
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
/************* portable random number generator ************/
/*****************************************************************/
-double randlc( double *X, double *A )
+double randlc( double *X, double *A )
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
/************* C R E A T E _ S E Q ************/
/*****************************************************************/
-void create_seq( global_data* gd, double seed, double a )
+void create_seq( global_data* gd, double seed, double a )
{
- double x;
- int i, k;
+ double x;
+ int i, k;
k = MAX_KEY/4;
- for (i=0; i<NUM_KEYS; i++)
- {
- x = randlc(&seed, &a);
- x += randlc(&seed, &a);
- x += randlc(&seed, &a);
- x += randlc(&seed, &a);
+ for (i=0; i<NUM_KEYS; i++)
+ {
+ x = randlc(&seed, &a);
+ x += randlc(&seed, &a);
+ x += randlc(&seed, &a);
+ x += randlc(&seed, &a);
gd->key_array[i] = k*x;
- }
+ }
}
break;
case 'A':
if( i <= 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+(iteration-1) )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-(iteration-1) )
break;
case 'B':
if( i == 1 || i == 2 || i == 4 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
break;
case 'C':
if( i <= 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
break;
case 'D':
if( i < 2 )
- {
+ {
if( key_rank != gd->test_rank_array[i]+iteration )
failed = 1;
else
gd->passed_verification++;
- }
+ }
else
{
if( key_rank != gd->test_rank_array[i]-iteration )
int nprocs_total,
double t,
double mops,
- char *optype,
+ char *optype,
int passed_verification,
char *npbversion,
char *compiletime,
// This function is C verson of random number generator randdp.f
//---------------------------------------------------------------------
-double randlc(X, A)
+double randlc(X, A)
double *X;
double *A;
{
static int KS=0;
- static double R23, R46, T23, T46;
- double T1, T2, T3, T4;
- double A1;
- double A2;
- double X1;
- double X2;
- double Z;
- int i, j;
+ static double R23, R46, T23, T46;
+ double T1, T2, T3, T4;
+ double A1;
+ double A2;
+ double X1;
+ double X2;
+ double Z;
+ int i, j;
if (KS == 0)
{
#endif
void get_info(int argc, char *argv[], int *typep, int *nprocsp, char *classp,
- int* subtypep);
+ int* subtypep);
void check_info(int type, int nprocs, char class);
void read_info(int type, int *nprocsp, char *classp, int *subtypep);
void write_info(int type, int nprocs, char class, int subtype);
if (class != 'U') {
#ifdef VERBOSE
printf("setparams: For benchmark %s: number of processors = %d class = %c\n",
- argv[1], nprocs, class);
+ argv[1], nprocs, class);
#endif
check_info(type, nprocs, class);
}
if (class_old != 'X') {
#ifdef VERBOSE
printf("setparams: old settings: number of processors = %d class = %c\n",
- nprocs_old, class_old);
+ nprocs_old, class_old);
#endif
}
} else {
if (class_old != 'X') {
#ifdef VERBOSE
printf("setparams: Previous settings were CLASS=%c NPROCS=%d\n",
- class_old, nprocs_old);
+ class_old, nprocs_old);
#endif
}
exit(1); /* exit on class==U */
*/
void get_info(int argc, char *argv[], int *typep, int *nprocsp, char *classp,
- int *subtypep)
+ int *subtypep)
{
if (argc < 4) {
switch(type) {
case BT: {
- char subtype_str[100];
+ char subtype_str[100];
nread = fscanf(fp, BT_DESC_LINE, nprocsp, classp, subtype_str);
if (nread != 3) {
if (nread != 2) {
printf("setparams: Error parsing config file %s. Ignoring previous settings\n", FILENAME);
goto abort;
- }
- *subtypep = 0;
- break;
+ }
+ *subtypep = 0;
+ break;
}
if (!strcmp(subtype_str, "full") || !strcmp(subtype_str, "FULL")) {
- *subtypep = FULL;
+ *subtypep = FULL;
} else if (!strcmp(subtype_str, "simple") ||
- !strcmp(subtype_str, "SIMPLE")) {
- *subtypep = SIMPLE;
+ !strcmp(subtype_str, "SIMPLE")) {
+ *subtypep = SIMPLE;
} else if (!strcmp(subtype_str, "epio") || !strcmp(subtype_str, "EPIO")) {
- *subtypep = EPIO;
+ *subtypep = EPIO;
} else if (!strcmp(subtype_str, "fortran") ||
- !strcmp(subtype_str, "FORTRAN")) {
- *subtypep = FORTRAN;
+ !strcmp(subtype_str, "FORTRAN")) {
+ *subtypep = FORTRAN;
} else {
- *subtypep = -1;
- }
+ *subtypep = -1;
+ }
break;
}
switch(type) {
case BT:
/* Write out the header */
- if (subtype == -1 || subtype == 0) {
+ if (subtype == -1 || subtype == 0) {
fprintf(fp, DESC_LINE, nprocs, class);
- } else {
+ } else {
fprintf(fp, BT_DESC_LINE, nprocs, class, BT_TYPES[subtype]);
- }
+ }
/* Print out a warning so bozos don't mess with the file */
fprintf(fp, "\
c \n\
c \n");
break;
-
+
case SP:
case FT:
case MG:
c \n");
break;
- case EP:
+ case EP:
case IS:
case DT:
fprintf(fp, DEF_CLASS_LINE, class);
}
fprintf(fp, "%sinteger maxcells, problem_size, niter_default\n", FINDENT);
fprintf(fp, "%sparameter (maxcells=%d, problem_size=%d, niter_default=%d)\n",
- FINDENT, maxcells, problem_size, niter);
+ FINDENT, maxcells, problem_size, niter);
fprintf(fp, "%sdouble precision dt_default\n", FINDENT);
fprintf(fp, "%sparameter (dt_default = %s)\n", FINDENT, dt);
}
wr_interval = 5;
fprintf(fp, "%sinteger maxcells, problem_size, niter_default\n", FINDENT);
fprintf(fp, "%sparameter (maxcells=%d, problem_size=%d, niter_default=%d)\n",
- FINDENT, maxcells, problem_size, niter);
+ FINDENT, maxcells, problem_size, niter);
fprintf(fp, "%sdouble precision dt_default\n", FINDENT);
fprintf(fp, "%sparameter (dt_default = %s)\n", FINDENT, dt);
fprintf(fp, "%sinteger wr_default\n", FINDENT);
if (io) {
fprintf(fp, "%scharacter*(*) filenm\n", FINDENT);
switch (io) {
- case FULL:
- fprintf(fp, "%sparameter (filenm = 'btio.full.out')\n", FINDENT);
- break;
- case SIMPLE:
- fprintf(fp, "%sparameter (filenm = 'btio.simple.out')\n", FINDENT);
- break;
- case EPIO:
- fprintf(fp, "%sparameter (filenm = 'btio.epio.out')\n", FINDENT);
- break;
- case FORTRAN:
- fprintf(fp, "%sparameter (filenm = 'btio.fortran.out')\n", FINDENT);
- fprintf(fp, "%sinteger fortran_rec_sz\n", FINDENT);
- fprintf(fp, "%sparameter (fortran_rec_sz = %d)\n",
- FINDENT, fortran_rec_size);
- break;
- default:
- break;
+ case FULL:
+ fprintf(fp, "%sparameter (filenm = 'btio.full.out')\n", FINDENT);
+ break;
+ case SIMPLE:
+ fprintf(fp, "%sparameter (filenm = 'btio.simple.out')\n", FINDENT);
+ break;
+ case EPIO:
+ fprintf(fp, "%sparameter (filenm = 'btio.epio.out')\n", FINDENT);
+ break;
+ case FORTRAN:
+ fprintf(fp, "%sparameter (filenm = 'btio.fortran.out')\n", FINDENT);
+ fprintf(fp, "%sinteger fortran_rec_sz\n", FINDENT);
+ fprintf(fp, "%sparameter (fortran_rec_sz = %d)\n",
+ FINDENT, fortran_rec_size);
+ break;
+ default:
+ break;
}
}
}
fprintf(fp, "\nc full problem size\n");
fprintf(fp, "%sinteger isiz01, isiz02, isiz03\n", FINDENT);
fprintf(fp, "%sparameter (isiz01=%d, isiz02=%d, isiz03=%d)\n",
- FINDENT, problem_size, problem_size, problem_size);
+ FINDENT, problem_size, problem_size, problem_size);
fprintf(fp, "\nc sub-domain array size\n");
fprintf(fp, "%sinteger isiz1, isiz2, isiz3\n", FINDENT);
fprintf(fp, "%sparameter (isiz1=%d, isiz2=%d, isiz3=isiz03)\n",
- FINDENT, isiz1, isiz2);
+ FINDENT, isiz1, isiz2);
fprintf(fp, "\nc number of iterations and how often to print the norm\n");
fprintf(fp, "%sinteger itmax_default, inorm_default\n", FINDENT);
fprintf(fp, "%sparameter (itmax_default=%d, inorm_default=%d)\n",
- FINDENT, itmax, inorm);
+ FINDENT, itmax, inorm);
fprintf(fp, "%sdouble precision dt_default\n", FINDENT);
fprintf(fp, "%sparameter (dt_default = %s)\n", FINDENT, dt_default);
fprintf(fp, "%sparameter (nprocs_compiled = %d)\n", FINDENT, nprocs);
fprintf(fp, "%sinteger nx_default, ny_default, nz_default\n", FINDENT);
fprintf(fp, "%sparameter (nx_default=%d, ny_default=%d, nz_default=%d)\n",
- FINDENT, problem_size, problem_size, problem_size);
+ FINDENT, problem_size, problem_size, problem_size);
fprintf(fp, "%sinteger nit_default, lm, lt_default\n", FINDENT);
fprintf(fp, "%sparameter (nit_default=%d, lm = %d, lt_default=%d)\n",
- FINDENT, nit, lm, lt_default);
+ FINDENT, nit, lm, lt_default);
fprintf(fp, "%sinteger debug_default\n", FINDENT);
fprintf(fp, "%sparameter (debug_default=%d)\n", FINDENT, 0);
fprintf(fp, "%sinteger ndim1, ndim2, ndim3\n", FINDENT);
fprintf(fp, "%sparameter (ndim1 = %d, ndim2 = %d, ndim3 = %d)\n",
- FINDENT, ndim1, ndim2, ndim3);
+ FINDENT, ndim1, ndim2, ndim3);
}
put_string(fp, "cs4", fmpi_inc);
put_string(fp, "cs5", fflags);
put_string(fp, "cs6", flinkflags);
- put_string(fp, "cs7", randfile);
+ put_string(fp, "cs7", randfile);
break;
case IS:
case EP:
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank==1) {
- data=22;
- MPI_Send(&data,1,MPI_INT,(rank+1)%2,666,MPI_COMM_WORLD);
-// smpi_sleep(1000);
+ data=22;
+ MPI_Send(&data,1,MPI_INT,(rank+1)%2,666,MPI_COMM_WORLD);
+// smpi_sleep(1000);
} else {
- MPI_Recv(&data,1,MPI_INT,-1,666,MPI_COMM_WORLD,NULL);
- if (data !=22) {
- printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
- }
+ MPI_Recv(&data,1,MPI_INT,-1,666,MPI_COMM_WORLD,NULL);
+ if (data !=22) {
+ printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
+ }
}
XBT_INFO("rank %d: data exchanged", rank);
-#define THREAD_THREADS_MAX ((unsigned int)10)
+#define THREAD_THREADS_MAX ((unsigned int)10)
/*
* the thread funtion.
"Messages specific for this sem example");
#ifndef ENOBUFS
-#define ENOBUFS 1024
+#define ENOBUFS 1024
#endif
-#define CTX_MAX ((unsigned int)1000)
+#define CTX_MAX ((unsigned int)1000)
-#define MAX_ARG 30
-#define MAX_ARGS 10
+#define MAX_ARG 30
+#define MAX_ARGS 10
typedef int (*pfn_func_t) (int, char **);
#ifdef HAVE_JEDULE
struct jed_event {
- int event_id;
- char *name;
- double start_time;
- double end_time;
- char *type;
- xbt_dynar_t resource_subsets;
- xbt_dynar_t characteristics_list; /* just a list of names (strings) */
- xbt_dict_t info_hash; /* key/value pairs */
+ int event_id;
+ char *name;
+ double start_time;
+ double end_time;
+ char *type;
+ xbt_dynar_t resource_subsets;
+ xbt_dynar_t characteristics_list; /* just a list of names (strings) */
+ xbt_dict_t info_hash; /* key/value pairs */
};
typedef struct jed_event s_jed_event_t, *jed_event_t;
void jedule_store_event(jed_event_t event);
void write_jedule_output(FILE *file, jedule_t jedule,
- xbt_dynar_t event_list, xbt_dict_t meta_info_dict);
+ xbt_dynar_t event_list, xbt_dict_t meta_info_dict);
#endif
#ifdef HAVE_JEDULE
typedef struct jed_simgrid_container s_jed_simgrid_container_t,
- *jed_simgrid_container_t;
+ *jed_simgrid_container_t;
struct jed_simgrid_container {
- char *name;
- xbt_dynar_t container_children;
- jed_simgrid_container_t parent;
- xbt_dynar_t resource_list;
- xbt_dict_t name2id;
- int last_id;
- int is_lowest;
+ char *name;
+ xbt_dynar_t container_children;
+ jed_simgrid_container_t parent;
+ xbt_dynar_t resource_list;
+ xbt_dict_t name2id;
+ int last_id;
+ int is_lowest;
};
*
*/
struct jed_res_subset {
- jed_simgrid_container_t parent;
- int start_idx; // start idx in resource_list of container
- int nres; // number of resources spanning starting at start_idx
+ jed_simgrid_container_t parent;
+ int start_idx; // start idx in resource_list of container
+ int nres; // number of resources spanning starting at start_idx
};
typedef struct jed_res_subset s_jed_res_subset_t, *jed_res_subset_t;
struct jedule_struct {
- jed_simgrid_container_t root_container;
- xbt_dict_t jedule_meta_info;
+ jed_simgrid_container_t root_container;
+ xbt_dict_t jedule_meta_info;
};
typedef struct jedule_struct s_jedule_t, *jedule_t;
void jed_simgrid_create_container(jed_simgrid_container_t *container, char *name);
void jed_simgrid_add_container(jed_simgrid_container_t parent,
- jed_simgrid_container_t child);
+ jed_simgrid_container_t child);
void jed_simgrid_add_resources(jed_simgrid_container_t parent,
- xbt_dynar_t host_names);
+ xbt_dynar_t host_names);
/**
*
* host_names is the list of host_names associated with an event
*/
void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
- xbt_dynar_t host_names);
+ xbt_dynar_t host_names);
/*
global:
- hash host_id -> container
+ hash host_id -> container
container:
- hash host_id -> jed_host_id
+ hash host_id -> jed_host_id
- list <- [ jed_host_ids ]
- list <- sort( list )
- list_chunks <- chunk( list ) -> [ 1, 3-5, 7-9 ]
+ list <- [ jed_host_ids ]
+ list <- sort( list )
+ list_chunks <- chunk( list ) -> [ 1, 3-5, 7-9 ]
*/
SD_NOT_SCHEDULED = 0, /**< @brief Initial state (not valid for SD_watch and SD_unwatch). */
SD_SCHEDULABLE = 0x0001, /**< @brief A task becomes SD_READY as soon as its dependencies are satisfied */
SD_SCHEDULED = 0x0002, /**< @brief A task becomes SD_SCHEDULED when you call function
- SD_task_schedule. SD_simulate will execute it when it becomes SD_RUNNABLE. */
+ SD_task_schedule. SD_simulate will execute it when it becomes SD_RUNNABLE. */
SD_RUNNABLE = 0x0004, /**< @brief A scheduled task becomes runnable is SD_simulate as soon as its dependencies are satisfied. */
SD_IN_FIFO = 0x0008, /**< @brief A runnable task can have to wait in a workstation fifo if the workstation is sequential */
SD_RUNNING = 0x0010, /**< @brief An SD_RUNNABLE or SD_IN_FIFO becomes SD_RUNNING when it is launched. */
XBT_PUBLIC(SD_task_t) SD_task_create_comp_seq(const char *name, void *data,
double amount);
XBT_PUBLIC(SD_task_t) SD_task_create_comp_par_amdahl(const char *name,
- void *data,
- double amount,
- double alpha);
+ void *data,
+ double amount,
+ double alpha);
XBT_PUBLIC(SD_task_t) SD_task_create_comm_e2e(const char *name, void *data,
double amount);
/* Process handling */
XBT_PUBLIC(void) simcall_process_cleanup(smx_process_t process);
XBT_PUBLIC(void) simcall_process_change_host(smx_process_t process,
- smx_host_t dest);
+ smx_host_t dest);
XBT_PUBLIC(void) simcall_process_suspend(smx_process_t process);
XBT_PUBLIC(void) simcall_process_resume(smx_process_t process);
extern xbt_lib_t host_lib;
extern int ROUTING_HOST_LEVEL; //Routing level
-extern int SURF_CPU_LEVEL; //Surf cpu level
-extern int SURF_WKS_LEVEL; //Surf workstation level
-extern int SIMIX_HOST_LEVEL; //Simix level
-extern int MSG_HOST_LEVEL; //Msg level
-extern int SD_HOST_LEVEL; //Simdag level
-extern int COORD_HOST_LEVEL; //Coordinates level
-extern int NS3_HOST_LEVEL; //host node for ns3
+extern int SURF_CPU_LEVEL; //Surf cpu level
+extern int SURF_WKS_LEVEL; //Surf workstation level
+extern int SIMIX_HOST_LEVEL; //Simix level
+extern int MSG_HOST_LEVEL; //Msg level
+extern int SD_HOST_LEVEL; //Simdag level
+extern int COORD_HOST_LEVEL; //Coordinates level
+extern int NS3_HOST_LEVEL; //host node for ns3
extern xbt_lib_t link_lib;
-extern int SD_LINK_LEVEL; //Simdag level
-extern int SURF_LINK_LEVEL; //Surf level
-extern int NS3_LINK_LEVEL; //link for ns3
+extern int SD_LINK_LEVEL; //Simdag level
+extern int SURF_LINK_LEVEL; //Surf level
+extern int NS3_LINK_LEVEL; //link for ns3
extern xbt_lib_t as_router_lib;
-extern int ROUTING_ASR_LEVEL; //Routing level
-extern int COORD_ASR_LEVEL; //Coordinates level
-extern int NS3_ASR_LEVEL; //host node for ns3
+extern int ROUTING_ASR_LEVEL; //Routing level
+extern int COORD_ASR_LEVEL; //Coordinates level
+extern int NS3_ASR_LEVEL; //host node for ns3
extern xbt_lib_t storage_lib;
extern int ROUTING_STORAGE_LEVEL; //Routing storage level
#define xbt_assert(...) ((void)0)
#else
/** @brief The condition which failed will be displayed.
- @hideinitializer */
+ @hideinitializer */
#define xbt_assert(...) \
_XBT_IF_ONE_ARG(_xbt_assert_ARG1, _xbt_assert_ARGN, __VA_ARGS__)(__VA_ARGS__)
#define _xbt_assert_ARG1(cond) \
XBT_PUBLIC(xbt_exp_label_t) new_label(int type, ...);
XBT_PUBLIC(xbt_automaton_t) get_automaton(void);
-
+
XBT_PUBLIC(void) display_automaton(void);
SG_END_DECL()
(xbt_datadesc_by_name_or_null(#name) ? \
xbt_datadesc_by_name_or_null(#name) : \
xbt_datadesc_parse(#name, \
- _xbt_this_type_symbol_does_not_exist__##name) \
+ _xbt_this_type_symbol_does_not_exist__##name) \
)
/** @def XBT_ANNOTE
*/
#define xbt_dynar_foreach(_dynar,_cursor,_data) \
for (_xbt_dynar_cursor_first(_dynar,&(_cursor)) ; \
- _xbt_dynar_cursor_get(_dynar,_cursor,&_data) ; \
+ _xbt_dynar_cursor_get(_dynar,_cursor,&_data) ; \
(_cursor)++ )
/** @} */
# define MAYDAY_CATCH(e) printf("%d %s:%d Catched '%s'\n", \
xbt_getpid(), __FILE__, __LINE__, \
(e).msg \
- ),
+ ),
#else
# define MAYDAY_SAVE(m)
# define MAYDAY_RESTORE(m)
# define XBT_LOG_DEFAULT_CATEGORY(cname)
#else
# define XBT_LOG_DEFAULT_CATEGORY(cname) \
- static xbt_log_category_t _XBT_LOGV(default) _XBT_GNUC_UNUSED = &_XBT_LOGV(cname)
+ static xbt_log_category_t _XBT_LOGV(default) _XBT_GNUC_UNUSED = &_XBT_LOGV(cname)
#endif
/**
/* Attributes are only in recent versions of GCC */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
# define _XBT_GNUC_PRINTF( format_idx, arg_idx ) \
- __attribute__((__format__ (__printf__, format_idx, arg_idx)))
+ __attribute__((__format__ (__printf__, format_idx, arg_idx)))
# define _XBT_GNUC_SCANF( format_idx, arg_idx ) \
- __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
+ __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
# define _XBT_GNUC_NORETURN __attribute__((__noreturn__))
# define _XBT_GNUC_UNUSED __attribute__((__unused__))
/* Constructor priorities exist since gcc 4.3. Apparently, they are however not
# define XBT_INLINE
# endif
# else
-# if defined (__VISUALC__)
-# define XBT_INLINE __inline
-# else
-# define XBT_INLINE inline
-# endif
+# if defined (__VISUALC__)
+# define XBT_INLINE __inline
+# else
+# define XBT_INLINE inline
+# endif
# endif /* __cplusplus */
#endif
# define XBT_PUBLIC(type) __declspec(dllexport) type
# define XBT_EXPORT_NO_IMPORT(type) __declspec(dllexport) type
# define XBT_IMPORT_NO_EXPORT(type) type
-# define XBT_PUBLIC_DATA(type) __declspec(dllexport) type
+# define XBT_PUBLIC_DATA(type) __declspec(dllexport) type
/* Pack everything up statically */
#elif defined(DLL_STATIC)
/* Link against the DLL */
#elif (defined(_XBT_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
-# define XBT_PUBLIC(type) __declspec(dllimport) type
-# define XBT_EXPORT_NO_IMPORT(type) type
-# define XBT_IMPORT_NO_EXPORT(type) __declspec(dllimport) type
-# define XBT_PUBLIC_DATA(type) __declspec(dllimport) type
+# define XBT_PUBLIC(type) __declspec(dllimport) type
+# define XBT_EXPORT_NO_IMPORT(type) type
+# define XBT_IMPORT_NO_EXPORT(type) __declspec(dllimport) type
+# define XBT_PUBLIC_DATA(type) __declspec(dllimport) type
/* UNIX build */
#else
#endif
#if !defined (max) && !defined(__cplusplus)
-# define max(a,b) (((a) > (b)) ? (a) : (b))
+# define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#if !defined (min) && !defined(__cplusplus)
-# define min(a,b) (((a) < (b)) ? (a) : (b))
+# define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#define TRUE 1
SG_BEGIN_DECL()
/** \addtogroup XBT_parmap
- * \ingroup XBT_misc
+ * \ingroup XBT_misc
* \brief Parallel map.
*
* A function is applied to all elements of a dynar in parallel with n worker
#define xbt_swag_foreach_safe(obj,obj_next,swag) \
for((obj)=xbt_swag_getFirst((swag)), \
((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)): \
- (obj_next=NULL)); \
+ (obj_next=NULL)); \
(obj)!=NULL; \
(obj)=obj_next, \
((obj)?(obj_next=xbt_swag_getNext((obj),(swag)->offset)): \
-/* xbt/time.h -- Time tools */
+/* xbt/time.h -- Time tools */
/* Usable in simulator, (or in real life when mixing with GRAS) */
/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
while (1) {
msg = gras_msg_recv_any();
if (msg->type != msg_wakeup_listener_t) {
- /* Cannot display who sent this since in SG, xbt_socket_peer_* wont work:
- I'm not the user process but I'm just the listener. Too bad */
+ /* Cannot display who sent this since in SG, xbt_socket_peer_* wont work:
+ I'm not the user process but I'm just the listener. Too bad */
XBT_VERB("Got a '%s' message (%s) from sock %p. Queue it for handling by main thread",
gras_msgtype_get_name(msg->type),e_gras_msg_kind_names[msg->kind],msg->expe);
xbt_queue_push(me->incoming_messages, msg);
listener_thread = ((fake_gras_msg_listener_t)l)->listener;
client_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
if (client_listener_process == SIMIX_process_self()) {
- XBT_VERB("I am the listener of the client");
+ XBT_VERB("I am the listener of the client");
return 0;
}
}
xbt_socket_t _gras_lastly_selected_socket = NULL;
#ifdef KILLME
-/**
+/**
* gras_trp_select:
*
* Returns the next socket to service having a message awaiting.
double cost; /**< cost */
double priority; /**< priority (1.0 by default) */
double max_duration; /**< max_duration (may fluctuate until
- the task is completed) */
+ the task is completed) */
double remains; /**< How much of that cost remains to
- * be done in the currently running task */
+ * be done in the currently running task */
#ifdef HAVE_LATENCY_BOUND_TRACKING
int latency_limited; /**< Set to 1 if is limited by latency, 0 otherwise */
#endif
double start; /**< start time */
double finish; /**< finish time : this is modified during the run
- * and fluctuates until the task is completed */
+ * and fluctuates until the task is completed */
void *data; /**< for your convenience */
int refcount;
surf_model_t model_type;
*/
typedef struct surf_workstation_model_extension_public {
surf_action_t(*execute) (void *workstation, double size); /**< Execute a computation amount on a workstation
- and create the corresponding action */
+ and create the corresponding action */
surf_action_t(*sleep) (void *workstation, double duration); /**< Make a workstation sleep during a given duration */
e_surf_resource_state_t(*get_state) (void *workstation); /**< Return the CPU state of a workstation */
double (*get_speed) (void *workstation, double load); /**< Return the speed of a workstation */
void surf_model_exit(surf_model_t model);
static inline void *surf_cpu_resource_by_name(const char *name) {
- return xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL);
+ return xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL);
}
static inline void *surf_workstation_resource_by_name(const char *name){
- return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL);
+ return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL);
}
static inline void *surf_storage_resource_by_name(const char *name){
return xbt_lib_get_or_null(storage_lib, name, SURF_STORAGE_LEVEL);
typedef struct s_surf_parsing_link_up_down *surf_parsing_link_up_down_t;
typedef struct s_surf_parsing_link_up_down {
- void* link_up;
- void* link_down;
+ void* link_up;
+ void* link_down;
} s_surf_parsing_link_up_down_t;
#endif /* SURFXML_PARSE_VALUES_H_ */
* \brief Free a trace event structure
*
* This function frees a trace_event if it can be freed, ie, if it has the free_me flag set to 1. This flag indicates whether the structure is still used somewhere or not.
- * \param trace_event Trace event structure
+ * \param trace_event Trace event structure
* \return 1 if the structure was freed, 0 otherwise
*/
XBT_PUBLIC(int) tmgr_trace_event_free(tmgr_trace_event_t trace_event);
return;
}
XBT_DEBUG("%s: insert event_type=%d, timestamp=%f, buffersize=%lu)",
- __FUNCTION__, (int)tbi->event_type, tbi->timestamp, xbt_dynar_length(buffer));
+ __FUNCTION__, (int)tbi->event_type, tbi->timestamp, xbt_dynar_length(buffer));
unsigned int i;
for (i = xbt_dynar_length(buffer); i > 0; i--) {
#ifdef HAVE_JEDULE
void jed_event_add_resources(jed_event_t event, xbt_dynar_t host_selection) {
- xbt_dynar_t resource_subset_list;
- jed_res_subset_t res_set;
- unsigned int i;
+ xbt_dynar_t resource_subset_list;
+ jed_res_subset_t res_set;
+ unsigned int i;
- resource_subset_list = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
+ resource_subset_list = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
- jed_simgrid_get_resource_selection_by_hosts(resource_subset_list, host_selection);
- xbt_dynar_foreach(resource_subset_list, i, res_set) {
- xbt_dynar_push(event->resource_subsets, &res_set);
- }
+ jed_simgrid_get_resource_selection_by_hosts(resource_subset_list, host_selection);
+ xbt_dynar_foreach(resource_subset_list, i, res_set) {
+ xbt_dynar_push(event->resource_subsets, &res_set);
+ }
- xbt_dynar_free(&resource_subset_list);
+ xbt_dynar_free(&resource_subset_list);
}
void jed_event_add_characteristic(jed_event_t event, char *characteristic) {
- xbt_assert( characteristic != NULL );
- xbt_dynar_push(event->characteristics_list, &characteristic);
+ xbt_assert( characteristic != NULL );
+ xbt_dynar_push(event->characteristics_list, &characteristic);
}
void jed_event_add_info(jed_event_t event, char *key, char *value) {
- char *val_cp;
+ char *val_cp;
- xbt_assert(key != NULL);
- xbt_assert(value != NULL);
+ xbt_assert(key != NULL);
+ xbt_assert(value != NULL);
- val_cp = strdup(value);
- xbt_dict_set(event->info_hash, key, val_cp, NULL);
+ val_cp = strdup(value);
+ xbt_dict_set(event->info_hash, key, val_cp, NULL);
}
void create_jed_event(jed_event_t *event, char *name, double start_time,
- double end_time, const char *type) {
+ double end_time, const char *type) {
- *event = (jed_event_t) calloc(1, sizeof(s_jed_event_t));
- (*event)->name = xbt_strdup(name);
+ *event = (jed_event_t) calloc(1, sizeof(s_jed_event_t));
+ (*event)->name = xbt_strdup(name);
- (*event)->start_time = start_time;
- (*event)->end_time = end_time;
+ (*event)->start_time = start_time;
+ (*event)->end_time = end_time;
- (*event)->type = xbt_strdup(type);
+ (*event)->type = xbt_strdup(type);
- (*event)->resource_subsets = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
- (*event)->characteristics_list = xbt_dynar_new(sizeof(char*), NULL);
- (*event)->info_hash = xbt_dict_new_homogeneous(NULL);
+ (*event)->resource_subsets = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
+ (*event)->characteristics_list = xbt_dynar_new(sizeof(char*), NULL);
+ (*event)->info_hash = xbt_dict_new_homogeneous(NULL);
}
void jed_event_free(jed_event_t event) {
- free(event->name);
- free(event->type);
+ free(event->name);
+ free(event->type);
- xbt_dynar_free(&event->resource_subsets);
+ xbt_dynar_free(&event->resource_subsets);
- xbt_dynar_free(&event->characteristics_list);
- xbt_dict_free(&event->info_hash);
+ xbt_dynar_free(&event->characteristics_list);
+ xbt_dict_free(&event->info_hash);
- free(event);
+ free(event);
}
#endif
static void get_hierarchy_list(xbt_dynar_t hier_list, jed_simgrid_container_t container) {
- xbt_assert( container != NULL );
+ xbt_assert( container != NULL );
- if( container->parent != NULL ) {
+ if( container->parent != NULL ) {
- if( container->parent->container_children == NULL ) {
- // we are in the last level
- get_hierarchy_list(hier_list, container->parent);
+ if( container->parent->container_children == NULL ) {
+ // we are in the last level
+ get_hierarchy_list(hier_list, container->parent);
- } else {
- unsigned int i;
- int child_nb = -1;
- jed_simgrid_container_t child_container;
+ } else {
+ unsigned int i;
+ int child_nb = -1;
+ jed_simgrid_container_t child_container;
- xbt_dynar_foreach(container->parent->container_children, i, child_container) {
- if( child_container == container ) {
- child_nb = i;
- break;
- }
- }
+ xbt_dynar_foreach(container->parent->container_children, i, child_container) {
+ if( child_container == container ) {
+ child_nb = i;
+ break;
+ }
+ }
- xbt_assert( child_nb > - 1);
+ xbt_assert( child_nb > - 1);
- xbt_dynar_insert_at(hier_list, 0, &child_nb);
+ xbt_dynar_insert_at(hier_list, 0, &child_nb);
- get_hierarchy_list(hier_list, container->parent);
- }
- } else {
- int top_level = 0;
- xbt_dynar_insert_at(hier_list, 0, &top_level);
- }
+ get_hierarchy_list(hier_list, container->parent);
+ }
+ } else {
+ int top_level = 0;
+ xbt_dynar_insert_at(hier_list, 0, &top_level);
+ }
}
}
static void print_key_value_dict(xbt_dict_t key_value_dict) {
- xbt_dict_cursor_t cursor=NULL;
- char *key,*data;
-
- if( key_value_dict != NULL ) {
- xbt_dict_foreach(key_value_dict,cursor,key,data) {
- fprintf(jed_file, "<prop key=\"%s\" value=\"%s\" />\n",key,data);
- }
- }
+ xbt_dict_cursor_t cursor=NULL;
+ char *key,*data;
+
+ if( key_value_dict != NULL ) {
+ xbt_dict_foreach(key_value_dict,cursor,key,data) {
+ fprintf(jed_file, "<prop key=\"%s\" value=\"%s\" />\n",key,data);
+ }
+ }
}
static void print_container(jed_simgrid_container_t container) {
- unsigned int i;
- jed_simgrid_container_t child_container;
-
- xbt_assert( container != NULL );
-
- fprintf(jed_file, "<res name=\"%s\">\n", container->name);
- if( container->container_children != NULL ) {
- xbt_dynar_foreach(container->container_children, i, child_container) {
- print_container(child_container);
- }
- } else {
- print_resources(container);
- }
- fprintf(jed_file, "</res>\n");
+ unsigned int i;
+ jed_simgrid_container_t child_container;
+
+ xbt_assert( container != NULL );
+
+ fprintf(jed_file, "<res name=\"%s\">\n", container->name);
+ if( container->container_children != NULL ) {
+ xbt_dynar_foreach(container->container_children, i, child_container) {
+ print_container(child_container);
+ }
+ } else {
+ print_resources(container);
+ }
+ fprintf(jed_file, "</res>\n");
}
static void print_resources(jed_simgrid_container_t resource_parent) {
- int res_nb;
- unsigned int i;
- char *res_name;
+ int res_nb;
+ unsigned int i;
+ char *res_name;
char resid[1024];
- xbt_assert( resource_parent->resource_list != NULL );
+ xbt_assert( resource_parent->resource_list != NULL );
- res_nb = xbt_dynar_length(resource_parent->resource_list);
+ res_nb = xbt_dynar_length(resource_parent->resource_list);
get_hierarchy_string(resource_parent, resid);
- fprintf(jed_file, "<rset id=\"%s\" nb=\"%d\" names=\"", resid, res_nb);
- xbt_dynar_foreach(resource_parent->resource_list, i, res_name) {
- fprintf(jed_file, "%s", res_name);
- if( i != res_nb-1 ) {
- fprintf(jed_file, "|");
- }
- }
- fprintf(jed_file, "\" />\n");
+ fprintf(jed_file, "<rset id=\"%s\" nb=\"%d\" names=\"", resid, res_nb);
+ xbt_dynar_foreach(resource_parent->resource_list, i, res_name) {
+ fprintf(jed_file, "%s", res_name);
+ if( i != res_nb-1 ) {
+ fprintf(jed_file, "|");
+ }
+ }
+ fprintf(jed_file, "\" />\n");
}
static void print_platform(jed_simgrid_container_t root_container) {
- fprintf(jed_file, "<platform>\n");
- print_container(root_container);
- fprintf(jed_file, "</platform>\n");
+ fprintf(jed_file, "<platform>\n");
+ print_container(root_container);
+ fprintf(jed_file, "</platform>\n");
}
static void print_event(jed_event_t event) {
- unsigned int i;
- jed_res_subset_t subset;
+ unsigned int i;
+ jed_res_subset_t subset;
- xbt_assert( event != NULL );
- xbt_assert( event->resource_subsets != NULL );
+ xbt_assert( event != NULL );
+ xbt_assert( event->resource_subsets != NULL );
- fprintf(jed_file, "<event>\n");
+ fprintf(jed_file, "<event>\n");
- fprintf(jed_file, "<prop key=\"name\" value=\"%s\" />\n", event->name);
- fprintf(jed_file, "<prop key=\"start\" value=\"%g\" />\n", event->start_time);
- fprintf(jed_file, "<prop key=\"end\" value=\"%g\" />\n", event->end_time);
- fprintf(jed_file, "<prop key=\"type\" value=\"%s\" />\n", event->type);
+ fprintf(jed_file, "<prop key=\"name\" value=\"%s\" />\n", event->name);
+ fprintf(jed_file, "<prop key=\"start\" value=\"%g\" />\n", event->start_time);
+ fprintf(jed_file, "<prop key=\"end\" value=\"%g\" />\n", event->end_time);
+ fprintf(jed_file, "<prop key=\"type\" value=\"%s\" />\n", event->type);
- fprintf(jed_file, "<res_util>\n");
+ fprintf(jed_file, "<res_util>\n");
- xbt_dynar_foreach(event->resource_subsets, i, subset) {
+ xbt_dynar_foreach(event->resource_subsets, i, subset) {
- int start = subset->start_idx;
- int end = subset->start_idx + subset->nres - 1;
+ int start = subset->start_idx;
+ int end = subset->start_idx + subset->nres - 1;
char resid[1024];
get_hierarchy_string(subset->parent, resid);
- fprintf(jed_file, "<select resources=\"");
+ fprintf(jed_file, "<select resources=\"");
fprintf(jed_file, "%s", resid);
- fprintf(jed_file, ".[%d-%d]", start, end);
- fprintf(jed_file, "\" />\n");
+ fprintf(jed_file, ".[%d-%d]", start, end);
+ fprintf(jed_file, "\" />\n");
- }
+ }
- fprintf(jed_file, "</res_util>\n");
+ fprintf(jed_file, "</res_util>\n");
- fprintf(jed_file, "<characteristics>\n");
- {
- char *ch;
- unsigned int iter;
- xbt_dynar_foreach(event->characteristics_list, iter, ch) {
- fprintf(jed_file, "<characteristic name=\"%s\" />\n", ch);
- }
- }
- fprintf(jed_file, "</characteristics>\n");
+ fprintf(jed_file, "<characteristics>\n");
+ {
+ char *ch;
+ unsigned int iter;
+ xbt_dynar_foreach(event->characteristics_list, iter, ch) {
+ fprintf(jed_file, "<characteristic name=\"%s\" />\n", ch);
+ }
+ }
+ fprintf(jed_file, "</characteristics>\n");
- fprintf(jed_file, "<info>\n");
- print_key_value_dict(event->info_hash);
- fprintf(jed_file, "</info>\n");
+ fprintf(jed_file, "<info>\n");
+ print_key_value_dict(event->info_hash);
+ fprintf(jed_file, "</info>\n");
- fprintf(jed_file, "</event>\n");
+ fprintf(jed_file, "</event>\n");
}
static void print_events(xbt_dynar_t event_list) {
- unsigned int i;
- jed_event_t event;
-
- fprintf(jed_file, "<events>\n");
- xbt_dynar_foreach(event_list, i, event) {
- print_event(event);
- }
- fprintf(jed_file, "</events>\n");
+ unsigned int i;
+ jed_event_t event;
+
+ fprintf(jed_file, "<events>\n");
+ xbt_dynar_foreach(event_list, i, event) {
+ print_event(event);
+ }
+ fprintf(jed_file, "</events>\n");
}
void write_jedule_output(FILE *file, jedule_t jedule,
- xbt_dynar_t event_list, xbt_dict_t meta_info_dict) {
+ xbt_dynar_t event_list, xbt_dict_t meta_info_dict) {
-// xbt_assert( jed_file != NULL );
+// xbt_assert( jed_file != NULL );
- jed_file = file;
+ jed_file = file;
- fprintf(jed_file, "<jedule>\n");
+ fprintf(jed_file, "<jedule>\n");
- fprintf(jed_file, "<jedule_meta>\n");
- print_key_value_dict(jedule->jedule_meta_info);
- fprintf(jed_file, "</jedule_meta>\n");
+ fprintf(jed_file, "<jedule_meta>\n");
+ print_key_value_dict(jedule->jedule_meta_info);
+ fprintf(jed_file, "</jedule_meta>\n");
- print_platform(jedule->root_container);
+ print_platform(jedule->root_container);
- print_events(event_list);
+ print_events(event_list);
- fprintf(jed_file, "</jedule>\n");
+ fprintf(jed_file, "</jedule>\n");
}
void jedule_init_output() {
- jedule_event_list = xbt_dynar_new(sizeof(jed_event_t), NULL);
+ jedule_event_list = xbt_dynar_new(sizeof(jed_event_t), NULL);
}
void jedule_cleanup_output() {
- xbt_dynar_free(&jedule_event_list);
+ xbt_dynar_free(&jedule_event_list);
}
void jedule_store_event(jed_event_t event) {
- xbt_assert(event != NULL);
- xbt_dynar_push(jedule_event_list, &event);
+ xbt_assert(event != NULL);
+ xbt_dynar_push(jedule_event_list, &event);
}
#endif
/********************************************************************/
static void add_subset_to(xbt_dynar_t subset_list, int start, int end,
- jed_simgrid_container_t parent);
+ jed_simgrid_container_t parent);
static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup,
- jed_simgrid_container_t parent);
+ jed_simgrid_container_t parent);
static void jed_free_container(jed_simgrid_container_t container);
/********************************************************************/
static int compare_hostnames(const void *host1, const void *host2) {
- const char *hp1 = *((const char**) host1);
- const char *hp2 = *((const char**) host2);
- return strcmp (hp1, hp2);
+ const char *hp1 = *((const char**) host1);
+ const char *hp2 = *((const char**) host2);
+ return strcmp (hp1, hp2);
}
static int compare_ids(const void *num1, const void *num2) {
- int *i1 = (int*) num1;
- int *i2 = (int*) num2;
- return *i1 - *i2;
+ int *i1 = (int*) num1;
+ int *i2 = (int*) num2;
+ return *i1 - *i2;
}
static void jed_free_container(jed_simgrid_container_t container) {
- xbt_dict_free(&container->name2id);
- xbt_dynar_free(&container->resource_list);
+ xbt_dict_free(&container->name2id);
+ xbt_dynar_free(&container->resource_list);
- if( container->container_children != NULL ) {
- unsigned int iter;
- jed_simgrid_container_t child_container;
- xbt_dynar_foreach(container->container_children, iter, child_container) {
- jed_free_container(child_container);
- }
- }
+ if( container->container_children != NULL ) {
+ unsigned int iter;
+ jed_simgrid_container_t child_container;
+ xbt_dynar_foreach(container->container_children, iter, child_container) {
+ jed_free_container(child_container);
+ }
+ }
- free(container->name);
- free(container);
+ free(container->name);
+ free(container);
}
void jed_simgrid_create_container(jed_simgrid_container_t *container, char *name) {
- xbt_assert( name != NULL );
+ xbt_assert( name != NULL );
- *container = (jed_simgrid_container_t)calloc(1,sizeof(s_jed_simgrid_container_t));
- (*container)->name = xbt_strdup(name);
- (*container)->is_lowest = 0;
- (*container)->container_children = xbt_dynar_new(sizeof(jed_simgrid_container_t), NULL);
- (*container)->parent = NULL;
+ *container = (jed_simgrid_container_t)calloc(1,sizeof(s_jed_simgrid_container_t));
+ (*container)->name = xbt_strdup(name);
+ (*container)->is_lowest = 0;
+ (*container)->container_children = xbt_dynar_new(sizeof(jed_simgrid_container_t), NULL);
+ (*container)->parent = NULL;
- xbt_dict_set(container_name2container, (*container)->name, *container, NULL);
+ xbt_dict_set(container_name2container, (*container)->name, *container, NULL);
}
void jed_simgrid_add_container(jed_simgrid_container_t parent,
- jed_simgrid_container_t child) {
- xbt_assert(parent != NULL);
- xbt_assert(child != NULL);
- xbt_dynar_push(parent->container_children, &child);
- child->parent = parent;
+ jed_simgrid_container_t child) {
+ xbt_assert(parent != NULL);
+ xbt_assert(child != NULL);
+ xbt_dynar_push(parent->container_children, &child);
+ child->parent = parent;
}
void jed_simgrid_add_resources(jed_simgrid_container_t parent,
- xbt_dynar_t host_names) {
+ xbt_dynar_t host_names) {
- unsigned int iter;
- char *host_name;
- char *buf;
+ unsigned int iter;
+ char *host_name;
+ char *buf;
- parent->is_lowest = 1;
- xbt_dynar_free(&parent->container_children);
- parent->container_children = NULL;
- parent->name2id = xbt_dict_new_homogeneous(xbt_free);
- parent->last_id = 0;
- parent->resource_list = xbt_dynar_new(sizeof(char *), NULL);
+ parent->is_lowest = 1;
+ xbt_dynar_free(&parent->container_children);
+ parent->container_children = NULL;
+ parent->name2id = xbt_dict_new_homogeneous(xbt_free);
+ parent->last_id = 0;
+ parent->resource_list = xbt_dynar_new(sizeof(char *), NULL);
- xbt_dynar_sort (host_names, &compare_hostnames);
+ xbt_dynar_sort (host_names, &compare_hostnames);
- xbt_dynar_foreach(host_names, iter, host_name) {
- buf = bprintf("%d", parent->last_id);
- (parent->last_id)++;
- xbt_dict_set(parent->name2id, host_name, buf, NULL);
- xbt_dict_set(host2_simgrid_parent_container, host_name, parent, NULL);
- xbt_dynar_push(parent->resource_list, &host_name);
- }
+ xbt_dynar_foreach(host_names, iter, host_name) {
+ buf = bprintf("%d", parent->last_id);
+ (parent->last_id)++;
+ xbt_dict_set(parent->name2id, host_name, buf, NULL);
+ xbt_dict_set(host2_simgrid_parent_container, host_name, parent, NULL);
+ xbt_dynar_push(parent->resource_list, &host_name);
+ }
}
static void add_subset_to(xbt_dynar_t subset_list, int start, int end,
- jed_simgrid_container_t parent) {
+ jed_simgrid_container_t parent) {
- jed_res_subset_t subset;
+ jed_res_subset_t subset;
- xbt_assert( subset_list != NULL );
- xbt_assert( parent != NULL );
+ xbt_assert( subset_list != NULL );
+ xbt_assert( parent != NULL );
- // printf(">>> start=%d end=%d\n", start, end);
+ // printf(">>> start=%d end=%d\n", start, end);
- subset = (jed_res_subset_t)calloc(1,sizeof(s_jed_res_subset_t));
- subset->start_idx = start;
- subset->nres = end-start+1;
- subset->parent = parent;
+ subset = (jed_res_subset_t)calloc(1,sizeof(s_jed_res_subset_t));
+ subset->start_idx = start;
+ subset->nres = end-start+1;
+ subset->parent = parent;
- xbt_dynar_push(subset_list, &subset);
+ xbt_dynar_push(subset_list, &subset);
}
static void add_subsets_to(xbt_dynar_t subset_list, xbt_dynar_t hostgroup,
- jed_simgrid_container_t parent) {
+ jed_simgrid_container_t parent) {
- unsigned int iter;
- char *host_name;
- xbt_dynar_t id_list;
- int *id_ar;
- int nb_ids;
- char *id_str;
+ unsigned int iter;
+ char *host_name;
+ xbt_dynar_t id_list;
+ int *id_ar;
+ int nb_ids;
+ char *id_str;
- // get ids for each host
- // sort ids
- // compact ids
- // create subset for each id group
+ // get ids for each host
+ // sort ids
+ // compact ids
+ // create subset for each id group
- xbt_assert( host2_simgrid_parent_container != NULL );
- xbt_assert( subset_list != NULL );
- xbt_assert( hostgroup != NULL );
- xbt_assert( parent != NULL );
+ xbt_assert( host2_simgrid_parent_container != NULL );
+ xbt_assert( subset_list != NULL );
+ xbt_assert( hostgroup != NULL );
+ xbt_assert( parent != NULL );
- id_list = xbt_dynar_new(sizeof(char *), NULL);
+ id_list = xbt_dynar_new(sizeof(char *), NULL);
- xbt_dynar_foreach(hostgroup, iter, host_name) {
- jed_simgrid_container_t parent;
- xbt_assert( host_name != NULL );
- parent = xbt_dict_get(host2_simgrid_parent_container, host_name);
- id_str = xbt_dict_get(parent->name2id, host_name);
- xbt_dynar_push(id_list, &id_str);
- }
+ xbt_dynar_foreach(hostgroup, iter, host_name) {
+ jed_simgrid_container_t parent;
+ xbt_assert( host_name != NULL );
+ parent = xbt_dict_get(host2_simgrid_parent_container, host_name);
+ id_str = xbt_dict_get(parent->name2id, host_name);
+ xbt_dynar_push(id_list, &id_str);
+ }
- nb_ids = xbt_dynar_length(id_list);
- id_ar = (int*)calloc(nb_ids, sizeof(int));
- xbt_dynar_foreach(id_list, iter, id_str) {
- id_ar[iter] = atoi(id_str);
- }
+ nb_ids = xbt_dynar_length(id_list);
+ id_ar = (int*)calloc(nb_ids, sizeof(int));
+ xbt_dynar_foreach(id_list, iter, id_str) {
+ id_ar[iter] = atoi(id_str);
+ }
- qsort (id_ar, nb_ids, sizeof(int), &compare_ids);
+ qsort (id_ar, nb_ids, sizeof(int), &compare_ids);
- if( nb_ids > 0 ) {
- int start = 0;
- int pos;
- int i;
+ if( nb_ids > 0 ) {
+ int start = 0;
+ int pos;
+ int i;
- pos = start;
- for(i=0; i<nb_ids; i++) {
+ pos = start;
+ for(i=0; i<nb_ids; i++) {
- if( id_ar[i] - id_ar[pos] > 1 ) {
+ if( id_ar[i] - id_ar[pos] > 1 ) {
- add_subset_to( subset_list, id_ar[start], id_ar[pos], parent );
- start = i;
+ add_subset_to( subset_list, id_ar[start], id_ar[pos], parent );
+ start = i;
- if( i == nb_ids-1 ) {
- add_subset_to( subset_list, id_ar[i], id_ar[i], parent );
- }
+ if( i == nb_ids-1 ) {
+ add_subset_to( subset_list, id_ar[i], id_ar[i], parent );
+ }
- } else {
- if( i == nb_ids-1 ) {
- add_subset_to( subset_list, id_ar[start], id_ar[i], parent );
- }
- }
+ } else {
+ if( i == nb_ids-1 ) {
+ add_subset_to( subset_list, id_ar[start], id_ar[i], parent );
+ }
+ }
- pos = i;
- }
- }
+ pos = i;
+ }
+ }
- free(id_ar);
- xbt_dynar_free(&id_list);
+ free(id_ar);
+ xbt_dynar_free(&id_list);
}
void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
- xbt_dynar_t host_names) {
+ xbt_dynar_t host_names) {
- char *host_name;
- unsigned int iter;
- xbt_dict_t parent2hostgroup; // group hosts by parent
+ char *host_name;
+ unsigned int iter;
+ xbt_dict_t parent2hostgroup; // group hosts by parent
- parent2hostgroup = xbt_dict_new_homogeneous(NULL);
+ parent2hostgroup = xbt_dict_new_homogeneous(NULL);
- xbt_assert( host_names != NULL );
+ xbt_assert( host_names != NULL );
- // for each host name
- // find parent container
- // group by parent container
+ // for each host name
+ // find parent container
+ // group by parent container
- xbt_dynar_foreach(host_names, iter, host_name) {
- jed_simgrid_container_t parent;
- xbt_dynar_t hostgroup;
+ xbt_dynar_foreach(host_names, iter, host_name) {
+ jed_simgrid_container_t parent;
+ xbt_dynar_t hostgroup;
- //printf("checking %s \n", host_name);
+ //printf("checking %s \n", host_name);
- parent = xbt_dict_get(host2_simgrid_parent_container, host_name);
- xbt_assert( parent != NULL );
+ parent = xbt_dict_get(host2_simgrid_parent_container, host_name);
+ xbt_assert( parent != NULL );
- hostgroup = xbt_dict_get_or_null (parent2hostgroup, parent->name);
- if( hostgroup == NULL ) {
- hostgroup = xbt_dynar_new(sizeof(char*), NULL);
- xbt_dict_set(parent2hostgroup, parent->name, hostgroup, NULL);
- }
+ hostgroup = xbt_dict_get_or_null (parent2hostgroup, parent->name);
+ if( hostgroup == NULL ) {
+ hostgroup = xbt_dynar_new(sizeof(char*), NULL);
+ xbt_dict_set(parent2hostgroup, parent->name, hostgroup, NULL);
+ }
- xbt_dynar_push(hostgroup, &host_name);
- }
+ xbt_dynar_push(hostgroup, &host_name);
+ }
- {
- xbt_dict_cursor_t cursor=NULL;
- char *parent_name;
- xbt_dynar_t hostgroup;
- jed_simgrid_container_t parent;
+ {
+ xbt_dict_cursor_t cursor=NULL;
+ char *parent_name;
+ xbt_dynar_t hostgroup;
+ jed_simgrid_container_t parent;
- xbt_dict_foreach(parent2hostgroup,cursor,parent_name,hostgroup) {
- parent = xbt_dict_get(container_name2container, parent_name);
- // printf("subset parent >>> %s\n", parent->name);
- add_subsets_to(subset_list, hostgroup, parent);
- }
+ xbt_dict_foreach(parent2hostgroup,cursor,parent_name,hostgroup) {
+ parent = xbt_dict_get(container_name2container, parent_name);
+ // printf("subset parent >>> %s\n", parent->name);
+ add_subsets_to(subset_list, hostgroup, parent);
+ }
- }
+ }
- xbt_dict_free(&parent2hostgroup);
+ xbt_dict_free(&parent2hostgroup);
}
void jedule_add_meta_info(jedule_t jedule, char *key, char *value) {
- char *val_cp;
+ char *val_cp;
- xbt_assert(key != NULL);
- xbt_assert(value != NULL);
+ xbt_assert(key != NULL);
+ xbt_assert(value != NULL);
- val_cp = strdup(value);
- xbt_dict_set(jedule->jedule_meta_info, key, val_cp, NULL);
+ val_cp = strdup(value);
+ xbt_dict_set(jedule->jedule_meta_info, key, val_cp, NULL);
}
void jed_create_jedule(jedule_t *jedule) {
- *jedule = (jedule_t)calloc(1,sizeof(s_jedule_t));
- host2_simgrid_parent_container = xbt_dict_new_homogeneous(NULL);
- container_name2container = xbt_dict_new_homogeneous(NULL);
- (*jedule)->jedule_meta_info = xbt_dict_new_homogeneous(NULL);
+ *jedule = (jedule_t)calloc(1,sizeof(s_jedule_t));
+ host2_simgrid_parent_container = xbt_dict_new_homogeneous(NULL);
+ container_name2container = xbt_dict_new_homogeneous(NULL);
+ (*jedule)->jedule_meta_info = xbt_dict_new_homogeneous(NULL);
}
void jed_free_jedule(jedule_t jedule) {
- jed_free_container(jedule->root_container);
+ jed_free_container(jedule->root_container);
- xbt_dict_free(&jedule->jedule_meta_info);
- free(jedule);
+ xbt_dict_free(&jedule->jedule_meta_info);
+ free(jedule);
- xbt_dict_free(&host2_simgrid_parent_container);
- xbt_dict_free(&container_name2container);
+ xbt_dict_free(&host2_simgrid_parent_container);
+ xbt_dict_free(&container_name2container);
}
#endif
jedule_t jedule;
void jedule_log_sd_event(SD_task_t task) {
- xbt_dynar_t host_list;
- jed_event_t event;
- int i;
+ xbt_dynar_t host_list;
+ jed_event_t event;
+ int i;
- xbt_assert(task != NULL);
+ xbt_assert(task != NULL);
- host_list = xbt_dynar_new(sizeof(char*), NULL);
+ host_list = xbt_dynar_new(sizeof(char*), NULL);
- for(i=0; i<task->workstation_nb; i++) {
- char *hostname = (char*)surf_resource_name(task->workstation_list[i]->surf_workstation);
- xbt_dynar_push(host_list, &hostname);
- }
+ for(i=0; i<task->workstation_nb; i++) {
+ char *hostname = (char*)surf_resource_name(task->workstation_list[i]->surf_workstation);
+ xbt_dynar_push(host_list, &hostname);
+ }
- create_jed_event(&event,
- (char*)SD_task_get_name(task),
- task->start_time,
- task->finish_time,
- "SD");
+ create_jed_event(&event,
+ (char*)SD_task_get_name(task),
+ task->start_time,
+ task->finish_time,
+ "SD");
- jed_event_add_resources(event, host_list);
- jedule_store_event(event);
+ jed_event_add_resources(event, host_list);
+ jedule_store_event(event);
- xbt_dynar_free(&host_list);
+ xbt_dynar_free(&host_list);
}
static void create_hierarchy(AS_t current_comp,
- jed_simgrid_container_t current_container) {
- xbt_dict_cursor_t cursor = NULL;
- unsigned int dynar_cursor;
- char *key;
- AS_t elem;
- sg_routing_edge_t network_elem;
-
- if(xbt_dict_is_empty(current_comp->routing_sons)) {
- // I am no AS
- // add hosts to jedule platform
- xbt_dynar_t hosts;
-
- hosts = xbt_dynar_new(sizeof(char*), NULL);
-
- xbt_dynar_foreach(current_comp->index_network_elm,
- dynar_cursor, network_elem) {
- char *hostname;
- hostname = strdup(network_elem->name);
- xbt_dynar_push(hosts, &hostname);
- }
-
- jed_simgrid_add_resources(current_container, hosts);
-
- } else {
- xbt_dict_foreach(current_comp->routing_sons, cursor, key, elem) {
- jed_simgrid_container_t child_container;
- jed_simgrid_create_container(&child_container, elem->name);
- jed_simgrid_add_container(current_container, child_container);
- XBT_DEBUG("name : %s\n", elem->name);
- create_hierarchy(elem, child_container);
- }
- }
+ jed_simgrid_container_t current_container) {
+ xbt_dict_cursor_t cursor = NULL;
+ unsigned int dynar_cursor;
+ char *key;
+ AS_t elem;
+ sg_routing_edge_t network_elem;
+
+ if(xbt_dict_is_empty(current_comp->routing_sons)) {
+ // I am no AS
+ // add hosts to jedule platform
+ xbt_dynar_t hosts;
+
+ hosts = xbt_dynar_new(sizeof(char*), NULL);
+
+ xbt_dynar_foreach(current_comp->index_network_elm,
+ dynar_cursor, network_elem) {
+ char *hostname;
+ hostname = strdup(network_elem->name);
+ xbt_dynar_push(hosts, &hostname);
+ }
+
+ jed_simgrid_add_resources(current_container, hosts);
+
+ } else {
+ xbt_dict_foreach(current_comp->routing_sons, cursor, key, elem) {
+ jed_simgrid_container_t child_container;
+ jed_simgrid_create_container(&child_container, elem->name);
+ jed_simgrid_add_container(current_container, child_container);
+ XBT_DEBUG("name : %s\n", elem->name);
+ create_hierarchy(elem, child_container);
+ }
+ }
}
void jedule_setup_platform() {
- AS_t root_comp;
- // e_surf_network_element_type_t type;
+ AS_t root_comp;
+ // e_surf_network_element_type_t type;
- jed_simgrid_container_t root_container;
+ jed_simgrid_container_t root_container;
- jed_create_jedule(&jedule);
+ jed_create_jedule(&jedule);
- root_comp = routing_platf->root;
- XBT_DEBUG("root name %s\n", root_comp->name);
+ root_comp = routing_platf->root;
+ XBT_DEBUG("root name %s\n", root_comp->name);
- // that doesn't work
- // type = root_comp->get_network_element_type(root_comp->name);
+ // that doesn't work
+ // type = root_comp->get_network_element_type(root_comp->name);
- jed_simgrid_create_container(&root_container, root_comp->name);
- jedule->root_container = root_container;
+ jed_simgrid_create_container(&root_container, root_comp->name);
+ jedule->root_container = root_container;
- create_hierarchy(root_comp, root_container);
+ create_hierarchy(root_comp, root_container);
}
void jedule_sd_cleanup() {
- jedule_cleanup_output();
+ jedule_cleanup_output();
}
void jedule_sd_init() {
- jedule_init_output();
+ jedule_init_output();
}
void jedule_sd_dump() {
- FILE *fh;
+ FILE *fh;
char fname[1024];
fname[0] = '\0';
strcat(fname, xbt_binary_name);
strcat(fname, ".jed\0");
- fh = fopen(fname, "w");
+ fh = fopen(fname, "w");
- write_jedule_output(fh, jedule, jedule_event_list, NULL);
+ write_jedule_output(fh, jedule, jedule_event_list, NULL);
- fclose(fh);
+ fclose(fh);
}
while(i < maps->mapsize){
r = maps->regions[i];
if (maps->regions[i].pathname != NULL){
- if (!memcmp(maps->regions[i].pathname, "[stack]", 7)){
- size_t diff = (char*)reg->start_addr - (char*)r.start_addr;
- void *segment = malloc(reg->size + diff);
- XBT_DEBUG("Size of segment : %zu", sizeof(segment));
- memcpy((char *)segment + diff, reg->data, reg->size);
- memcpy(r.start_addr, segment, sizeof(segment));
- XBT_DEBUG("Memcpy region ok");
- break;
- }
+ if (!memcmp(maps->regions[i].pathname, "[stack]", 7)){
+ size_t diff = (char*)reg->start_addr - (char*)r.start_addr;
+ void *segment = malloc(reg->size + diff);
+ XBT_DEBUG("Size of segment : %zu", sizeof(segment));
+ memcpy((char *)segment + diff, reg->data, reg->size);
+ memcpy(r.start_addr, segment, sizeof(segment));
+ XBT_DEBUG("Memcpy region ok");
+ break;
+ }
}
i++;
}
if ((reg.prot & PROT_WRITE)){
if (maps->regions[i].pathname == NULL){
if (reg.start_addr == std_heap){ // only save the std heap (and not the raw one)
- MC_snapshot_add_region(snapshot, 0, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr);
+ MC_snapshot_add_region(snapshot, 0, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr);
}
} else {
if (!memcmp(basename(maps->regions[i].pathname), "libsimgrid", 10)){
MC_snapshot_add_region(snapshot, 1, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr);
} else {
- if (!memcmp(basename(maps->regions[i].pathname), basename(xbt_binary_name), strlen(basename(xbt_binary_name)))){
- MC_snapshot_add_region(snapshot, 2, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr);
- }
- }
+ if (!memcmp(basename(maps->regions[i].pathname), basename(xbt_binary_name), strlen(basename(xbt_binary_name)))){
+ MC_snapshot_add_region(snapshot, 2, reg.start_addr, (char*)reg.end_addr - (char*)reg.start_addr);
+ }
+ }
}
}
i++;
/**
- * \brief Perform the model-checking operation using a depth-first search exploration
+ * \brief Perform the model-checking operation using a depth-first search exploration
* with Dynamic Partial Order Reductions
*/
void MC_dpor(void)
/* Debug information */
if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
- req_str = MC_request_to_string(req, value);
- //XBT_INFO("Visited states = %lu",mc_stats->visited_states );
- XBT_DEBUG("Execute: %s",req_str);
- xbt_free(req_str);
+ req_str = MC_request_to_string(req, value);
+ //XBT_INFO("Visited states = %lu",mc_stats->visited_states );
+ XBT_DEBUG("Execute: %s",req_str);
+ xbt_free(req_str);
}
MC_state_set_executed_request(current_state->graph_state, req, value);
/* Get an enabled process and insert it in the interleave set of the next graph_state */
xbt_swag_foreach(process, simix_global->process_list){
- if(MC_process_is_enabled(process)){
- MC_state_interleave_process(next_graph_state, process);
- break;
- }
+ if(MC_process_is_enabled(process)){
+ MC_state_interleave_process(next_graph_state, process);
+ break;
+ }
}
next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
MC_SET_RAW_MEM;
while((current_state = xbt_fifo_shift(mc_stack_safety_stateful)) != NULL){
- req = MC_state_get_internal_request(current_state->graph_state);
- xbt_fifo_foreach(mc_stack_safety_stateful, item, prev_state, mc_state_ws_t) {
+ req = MC_state_get_internal_request(current_state->graph_state);
+ xbt_fifo_foreach(mc_stack_safety_stateful, item, prev_state, mc_state_ws_t) {
if(MC_request_depend(req, MC_state_get_internal_request(prev_state->graph_state))){
if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
XBT_DEBUG("Dependent Transitions:");
if(!MC_state_process_is_done(prev_state->graph_state, req->issuer)){
MC_state_interleave_process(prev_state->graph_state, req->issuer);
-
- } else {
+
+ } else {
XBT_DEBUG("Process %p is in done set", req->issuer);
- }
+ }
break;
}
}
- if(MC_state_interleave_size(current_state->graph_state)){
- MC_restore_snapshot(current_state->system_state);
- xbt_fifo_unshift(mc_stack_safety_stateful, current_state);
- XBT_DEBUG("Back-tracking to depth %d", xbt_fifo_size(mc_stack_safety_stateful));
- MC_UNSET_RAW_MEM;
- break;
- }
+ if(MC_state_interleave_size(current_state->graph_state)){
+ MC_restore_snapshot(current_state->system_state);
+ xbt_fifo_unshift(mc_stack_safety_stateful, current_state);
+ XBT_DEBUG("Back-tracking to depth %d", xbt_fifo_size(mc_stack_safety_stateful));
+ MC_UNSET_RAW_MEM;
+ break;
+ }
}
MC_UNSET_RAW_MEM;
if(pair->requests > 0){
- saved_req = MC_state_get_executed_request(state, &value);
- //XBT_DEBUG("SavedReq->call %u", saved_req->call);
+ saved_req = MC_state_get_executed_request(state, &value);
+ //XBT_DEBUG("SavedReq->call %u", saved_req->call);
- if(saved_req != NULL){
- /* because we got a copy of the executed request, we have to fetch the
- real one, pointed by the request field of the issuer process */
- req = &saved_req->issuer->simcall;
- //XBT_DEBUG("Req->call %u", req->call);
-
- /* Debug information */
- if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
- req_str = MC_request_to_string(req, value);
- XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
- xbt_free(req_str);
- }
-
- }
+ if(saved_req != NULL){
+ /* because we got a copy of the executed request, we have to fetch the
+ real one, pointed by the request field of the issuer process */
+ req = &saved_req->issuer->simcall;
+ //XBT_DEBUG("Req->call %u", req->call);
+
+ /* Debug information */
+ if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+ req_str = MC_request_to_string(req, value);
+ XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
+ xbt_free(req_str);
+ }
+
+ }
- SIMIX_simcall_pre(req, value);
- MC_wait_for_requests();
+ SIMIX_simcall_pre(req, value);
+ MC_wait_for_requests();
}
depth++;
/* Traverse the stack from the initial state and re-execute the transitions */
for (item = xbt_fifo_get_last_item(stack);
- item != xbt_fifo_get_first_item(stack);
- item = xbt_fifo_get_prev_item(item)) {
+ item != xbt_fifo_get_first_item(stack);
+ item = xbt_fifo_get_prev_item(item)) {
pair = (mc_pair_stateless_t) xbt_fifo_get_item_content(item);
state = (mc_state_t) pair->graph_state;
if(pair->requests > 0){
- saved_req = MC_state_get_executed_request(state, &value);
- //XBT_DEBUG("SavedReq->call %u", saved_req->call);
+ saved_req = MC_state_get_executed_request(state, &value);
+ //XBT_DEBUG("SavedReq->call %u", saved_req->call);
- if(saved_req != NULL){
- /* because we got a copy of the executed request, we have to fetch the
- real one, pointed by the request field of the issuer process */
- req = &saved_req->issuer->simcall;
- //XBT_DEBUG("Req->call %u", req->call);
-
- /* Debug information */
- if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
- req_str = MC_request_to_string(req, value);
- XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
- xbt_free(req_str);
- }
-
- }
+ if(saved_req != NULL){
+ /* because we got a copy of the executed request, we have to fetch the
+ real one, pointed by the request field of the issuer process */
+ req = &saved_req->issuer->simcall;
+ //XBT_DEBUG("Req->call %u", req->call);
+
+ /* Debug information */
+ if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+ req_str = MC_request_to_string(req, value);
+ XBT_DEBUG("Replay (depth = %d) : %s (%p)", depth, req_str, state);
+ xbt_free(req_str);
+ }
+
+ }
- SIMIX_simcall_pre(req, value);
- MC_wait_for_requests();
+ SIMIX_simcall_pre(req, value);
+ MC_wait_for_requests();
}
depth++;
req = MC_state_get_executed_request(pair->graph_state, &value);
if(req){
if(pair->requests>0){
- req_str = MC_request_to_string(req, value);
- XBT_INFO("%s", req_str);
- xbt_free(req_str);
+ req_str = MC_request_to_string(req, value);
+ XBT_INFO("%s", req_str);
+ xbt_free(req_str);
}else{
- XBT_INFO("End of system requests but evolution in Büchi automaton");
+ XBT_INFO("End of system requests but evolution in Büchi automaton");
}
}
}
for(i=0 ; i< s1->num_reg ; i++){
if(s1->regions[i]->type != s2->regions[i]->type){
- XBT_INFO("Different type of region");
- errors++;
+ XBT_INFO("Different type of region");
+ errors++;
}
switch(s1->regions[i]->type){
case 0:
if(s1->regions[i]->size != s2->regions[i]->size){
- XBT_INFO("Different size of heap (s1 = %zu, s2 = %zu)", s1->regions[i]->size, s2->regions[i]->size);
- errors++;
+ XBT_INFO("Different size of heap (s1 = %zu, s2 = %zu)", s1->regions[i]->size, s2->regions[i]->size);
+ errors++;
}
if(s1->regions[i]->start_addr != s2->regions[i]->start_addr){
- XBT_INFO("Different start addr of heap (s1 = %p, s2 = %p)", s1->regions[i]->start_addr, s2->regions[i]->start_addr);
- errors++;
+ XBT_INFO("Different start addr of heap (s1 = %p, s2 = %p)", s1->regions[i]->start_addr, s2->regions[i]->start_addr);
+ errors++;
}
if(mmalloc_compare_heap(s1->regions[i]->data, s2->regions[i]->data)){
- XBT_INFO("Different heap (mmalloc_compare)");
- errors++;
+ XBT_INFO("Different heap (mmalloc_compare)");
+ errors++;
}
break;
case 1 :
if(s1->regions[i]->size != s2->regions[i]->size){
- XBT_INFO("Different size of libsimgrid (s1 = %zu, s2 = %zu)", s1->regions[i]->size, s2->regions[i]->size);
- errors++;
+ XBT_INFO("Different size of libsimgrid (s1 = %zu, s2 = %zu)", s1->regions[i]->size, s2->regions[i]->size);
+ errors++;
}
if(s1->regions[i]->start_addr != s2->regions[i]->start_addr){
- XBT_INFO("Different start addr of libsimgrid (s1 = %p, s2 = %p)", s1->regions[i]->start_addr, s2->regions[i]->start_addr);
- errors++;
+ XBT_INFO("Different start addr of libsimgrid (s1 = %p, s2 = %p)", s1->regions[i]->start_addr, s2->regions[i]->start_addr);
+ errors++;
}
if(data_libsimgrid_region_compare(s1->regions[i]->data, s2->regions[i]->data, s1->regions[i]->size) != 0){
- XBT_INFO("Different memcmp for data in libsimgrid");
- errors++;
+ XBT_INFO("Different memcmp for data in libsimgrid");
+ errors++;
}
break;
case 2 :
if(s1->regions[i]->size != s2->regions[i]->size){
- XBT_INFO("Different size of data program (s1 = %zu, s2 = %zu)", s1->regions[i]->size, s2->regions[i]->size);
- errors++;
+ XBT_INFO("Different size of data program (s1 = %zu, s2 = %zu)", s1->regions[i]->size, s2->regions[i]->size);
+ errors++;
}
if(s1->regions[i]->start_addr != s2->regions[i]->start_addr){
- XBT_INFO("Different start addr of data program (s1 = %p, s2 = %p)", s1->regions[i]->start_addr, s2->regions[i]->start_addr);
- errors++;
+ XBT_INFO("Different start addr of data program (s1 = %p, s2 = %p)", s1->regions[i]->start_addr, s2->regions[i]->start_addr);
+ errors++;
}
if(data_program_region_compare(s1->regions[i]->data, s2->regions[i]->data, s1->regions[i]->size) != 0){
- XBT_INFO("Different memcmp for data in program");
- errors++;
+ XBT_INFO("Different memcmp for data in program");
+ errors++;
}
break;
default:
xbt_dynar_foreach(reached_pairs, cursor, pair_test){
XBT_INFO("Pair reached #%d", pair_test->nb);
if(automaton_state_compare(pair_test->automaton_state, st) == 0){
- if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
- //XBT_INFO("Rdv points size %d - %d", xbt_dict_length(pair_test->rdv_points), xbt_dict_length(current_rdv_points));
- //if(xbt_dict_length(pair_test->rdv_points) == xbt_dict_length(current_rdv_points)){
- //if(rdv_points_compare(pair_test->rdv_points, current_rdv_points) == 0){
- if(snapshot_compare(pair_test->system_state, sn) == 0){
-
- MC_free_snapshot(sn);
- xbt_dynar_reset(prop_ato);
- xbt_free(prop_ato);
- MC_UNSET_RAW_MEM;
- return 1;
- }
- /* }
- }else{
- XBT_INFO("Different size of rdv points (%d - %d)",xbt_dict_length(pair_test->rdv_points), xbt_dict_length(current_rdv_points) );
- }*/
- }else{
- XBT_INFO("Different values of propositional symbols");
- }
+ if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
+ //XBT_INFO("Rdv points size %d - %d", xbt_dict_length(pair_test->rdv_points), xbt_dict_length(current_rdv_points));
+ //if(xbt_dict_length(pair_test->rdv_points) == xbt_dict_length(current_rdv_points)){
+ //if(rdv_points_compare(pair_test->rdv_points, current_rdv_points) == 0){
+ if(snapshot_compare(pair_test->system_state, sn) == 0){
+
+ MC_free_snapshot(sn);
+ xbt_dynar_reset(prop_ato);
+ xbt_free(prop_ato);
+ MC_UNSET_RAW_MEM;
+ return 1;
+ }
+ /* }
+ }else{
+ XBT_INFO("Different size of rdv points (%d - %d)",xbt_dict_length(pair_test->rdv_points), xbt_dict_length(current_rdv_points) );
+ }*/
+ }else{
+ XBT_INFO("Different values of propositional symbols");
+ }
}else{
- XBT_INFO("Different automaton state");
+ XBT_INFO("Different automaton state");
}
}
return 1;
}else{
if(xbt_fifo_size(rdv1->comm_fifo) != xbt_fifo_size(rdv2->comm_fifo)){
- XBT_INFO("Different total of actions in mailbox \"%s\" (%d - %d)", rdv1->name, xbt_fifo_size(rdv1->comm_fifo),xbt_fifo_size(rdv2->comm_fifo) );
- return 1;
+ XBT_INFO("Different total of actions in mailbox \"%s\" (%d - %d)", rdv1->name, xbt_fifo_size(rdv1->comm_fifo),xbt_fifo_size(rdv2->comm_fifo) );
+ return 1;
}else{
-
- XBT_INFO("Total of actions in mailbox \"%s\" : %d", rdv1->name, xbt_fifo_size(rdv1->comm_fifo));
-
- item1 = xbt_fifo_get_first_item(rdv1->comm_fifo);
- item2 = xbt_fifo_get_first_item(rdv2->comm_fifo);
-
- while(i<xbt_fifo_size(rdv1->comm_fifo)){
- action1 = (smx_action_t) xbt_fifo_get_item_content(item1);
- action2 = (smx_action_t) xbt_fifo_get_item_content(item2);
-
- if(action1->type != action2->type){
- XBT_INFO("Different type of action");
- return 1;
- }
-
- if(action1->state != action2->state){
- XBT_INFO("Different state of action");
- return 1;
- }
-
- if(xbt_fifo_size(action1->simcalls) != xbt_fifo_size(action2->simcalls)){
- XBT_INFO("Different size of simcall list (%d - %d", xbt_fifo_size(action1->simcalls), xbt_fifo_size(action2->simcalls));
- return 1;
- }else{
-
- item_req1 = xbt_fifo_get_first_item(action1->simcalls);
- item_req2 = xbt_fifo_get_first_item(action2->simcalls);
-
- while(j<xbt_fifo_size(action1->simcalls)){
-
- req1 = (smx_simcall_t) xbt_fifo_get_item_content(item_req1);
- req2 = (smx_simcall_t) xbt_fifo_get_item_content(item_req2);
-
- if(req1->call != req2->call){
- XBT_INFO("Different simcall call in simcalls of action (%d - %d)", (int)req1->call, (int)req2->call);
- return 1;
- }
- if(req1->issuer->pid != req2->issuer->pid){
- XBT_INFO("Different simcall issuer in simcalls of action (%lu- %lu)", req1->issuer->pid, req2->issuer->pid);
- return 1;
- }
-
- item_req1 = xbt_fifo_get_next_item(item_req1);
- item_req2 = xbt_fifo_get_next_item(item_req2);
- j++;
-
- }
- }
-
- switch(action1->type){
- case 0: /* execution */
- case 1: /* parallel execution */
- if(strcmp(action1->execution.host->name, action2->execution.host->name) != 0)
- return 1;
- break;
- case 2: /* comm */
- if(action1->comm.type != action2->comm.type)
- return 1;
- //XBT_INFO("Type of comm : %d", action1->comm.type);
-
- switch(action1->comm.type){
- case 0: /* SEND */
- if(action1->comm.src_proc->pid != action2->comm.src_proc->pid)
- return 1;
- if(strcmp(action1->comm.src_proc->smx_host->name, action2->comm.src_proc->smx_host->name) != 0)
- return 1;
- break;
- case 1: /* RECEIVE */
- if(action1->comm.dst_proc->pid != action2->comm.dst_proc->pid)
- return 1;
- if(strcmp(action1->comm.dst_proc->smx_host->name, action2->comm.dst_proc->smx_host->name) != 0)
- return 1;
- break;
- case 2: /* READY */
- if(action1->comm.src_proc->pid != action2->comm.src_proc->pid)
- return 1;
- if(strcmp(action1->comm.src_proc->smx_host->name, action2->comm.src_proc->smx_host->name) != 0)
- return 1;
- if(action1->comm.dst_proc->pid != action2->comm.dst_proc->pid)
- return 1;
- if(strcmp(action1->comm.dst_proc->smx_host->name, action2->comm.dst_proc->smx_host->name) != 0)
- return 1;
- break;
- case 3: /* DONE */
- if(action1->comm.src_proc->pid != action2->comm.src_proc->pid)
- return 1;
- if(strcmp(action1->comm.src_proc->smx_host->name, action2->comm.src_proc->smx_host->name) != 0)
- return 1;
- if(action1->comm.dst_proc->pid != action2->comm.dst_proc->pid)
- return 1;
- if(strcmp(action1->comm.dst_proc->smx_host->name, action2->comm.dst_proc->smx_host->name) != 0)
- return 1;
- break;
-
- } /* end of switch on type of comm */
-
- if(action1->comm.refcount != action2->comm.refcount)
- return 1;
- if(action1->comm.detached != action2->comm.detached)
- return 1;
- if(action1->comm.rate != action2->comm.rate)
- return 1;
- if(action1->comm.task_size != action2->comm.task_size)
- return 1;
- if(action1->comm.src_buff != action2->comm.src_buff)
- return 1;
- if(action1->comm.dst_buff != action2->comm.dst_buff)
- return 1;
- if(action1->comm.src_data != action2->comm.src_data)
- return 1;
- if(action1->comm.dst_data != action2->comm.dst_data)
- return 1;
-
- break;
- case 3: /* sleep */
- if(strcmp(action1->sleep.host->name, action2->sleep.host->name) != 0)
- return 1;
- break;
- case 4: /* synchro */
-
- break;
- default:
- break;
- }
-
- item1 = xbt_fifo_get_next_item(item1);
- item2 = xbt_fifo_get_next_item(item2);
- i++;
- }
+
+ XBT_INFO("Total of actions in mailbox \"%s\" : %d", rdv1->name, xbt_fifo_size(rdv1->comm_fifo));
+
+ item1 = xbt_fifo_get_first_item(rdv1->comm_fifo);
+ item2 = xbt_fifo_get_first_item(rdv2->comm_fifo);
+
+ while(i<xbt_fifo_size(rdv1->comm_fifo)){
+ action1 = (smx_action_t) xbt_fifo_get_item_content(item1);
+ action2 = (smx_action_t) xbt_fifo_get_item_content(item2);
+
+ if(action1->type != action2->type){
+ XBT_INFO("Different type of action");
+ return 1;
+ }
+
+ if(action1->state != action2->state){
+ XBT_INFO("Different state of action");
+ return 1;
+ }
+
+ if(xbt_fifo_size(action1->simcalls) != xbt_fifo_size(action2->simcalls)){
+ XBT_INFO("Different size of simcall list (%d - %d", xbt_fifo_size(action1->simcalls), xbt_fifo_size(action2->simcalls));
+ return 1;
+ }else{
+
+ item_req1 = xbt_fifo_get_first_item(action1->simcalls);
+ item_req2 = xbt_fifo_get_first_item(action2->simcalls);
+
+ while(j<xbt_fifo_size(action1->simcalls)){
+
+ req1 = (smx_simcall_t) xbt_fifo_get_item_content(item_req1);
+ req2 = (smx_simcall_t) xbt_fifo_get_item_content(item_req2);
+
+ if(req1->call != req2->call){
+ XBT_INFO("Different simcall call in simcalls of action (%d - %d)", (int)req1->call, (int)req2->call);
+ return 1;
+ }
+ if(req1->issuer->pid != req2->issuer->pid){
+ XBT_INFO("Different simcall issuer in simcalls of action (%lu- %lu)", req1->issuer->pid, req2->issuer->pid);
+ return 1;
+ }
+
+ item_req1 = xbt_fifo_get_next_item(item_req1);
+ item_req2 = xbt_fifo_get_next_item(item_req2);
+ j++;
+
+ }
+ }
+
+ switch(action1->type){
+ case 0: /* execution */
+ case 1: /* parallel execution */
+ if(strcmp(action1->execution.host->name, action2->execution.host->name) != 0)
+ return 1;
+ break;
+ case 2: /* comm */
+ if(action1->comm.type != action2->comm.type)
+ return 1;
+ //XBT_INFO("Type of comm : %d", action1->comm.type);
+
+ switch(action1->comm.type){
+ case 0: /* SEND */
+ if(action1->comm.src_proc->pid != action2->comm.src_proc->pid)
+ return 1;
+ if(strcmp(action1->comm.src_proc->smx_host->name, action2->comm.src_proc->smx_host->name) != 0)
+ return 1;
+ break;
+ case 1: /* RECEIVE */
+ if(action1->comm.dst_proc->pid != action2->comm.dst_proc->pid)
+ return 1;
+ if(strcmp(action1->comm.dst_proc->smx_host->name, action2->comm.dst_proc->smx_host->name) != 0)
+ return 1;
+ break;
+ case 2: /* READY */
+ if(action1->comm.src_proc->pid != action2->comm.src_proc->pid)
+ return 1;
+ if(strcmp(action1->comm.src_proc->smx_host->name, action2->comm.src_proc->smx_host->name) != 0)
+ return 1;
+ if(action1->comm.dst_proc->pid != action2->comm.dst_proc->pid)
+ return 1;
+ if(strcmp(action1->comm.dst_proc->smx_host->name, action2->comm.dst_proc->smx_host->name) != 0)
+ return 1;
+ break;
+ case 3: /* DONE */
+ if(action1->comm.src_proc->pid != action2->comm.src_proc->pid)
+ return 1;
+ if(strcmp(action1->comm.src_proc->smx_host->name, action2->comm.src_proc->smx_host->name) != 0)
+ return 1;
+ if(action1->comm.dst_proc->pid != action2->comm.dst_proc->pid)
+ return 1;
+ if(strcmp(action1->comm.dst_proc->smx_host->name, action2->comm.dst_proc->smx_host->name) != 0)
+ return 1;
+ break;
+
+ } /* end of switch on type of comm */
+
+ if(action1->comm.refcount != action2->comm.refcount)
+ return 1;
+ if(action1->comm.detached != action2->comm.detached)
+ return 1;
+ if(action1->comm.rate != action2->comm.rate)
+ return 1;
+ if(action1->comm.task_size != action2->comm.task_size)
+ return 1;
+ if(action1->comm.src_buff != action2->comm.src_buff)
+ return 1;
+ if(action1->comm.dst_buff != action2->comm.dst_buff)
+ return 1;
+ if(action1->comm.src_data != action2->comm.src_data)
+ return 1;
+ if(action1->comm.dst_data != action2->comm.dst_data)
+ return 1;
+
+ break;
+ case 3: /* sleep */
+ if(strcmp(action1->sleep.host->name, action2->sleep.host->name) != 0)
+ return 1;
+ break;
+ case 4: /* synchro */
+
+ break;
+ default:
+ break;
+ }
+
+ item1 = xbt_fifo_get_next_item(item1);
+ item2 = xbt_fifo_get_next_item(item2);
+ i++;
+ }
}
}
}
xbt_fifo_push(new_rdv->comm_fifo, a);
XBT_INFO("New action (type = %d, state = %d) in mailbox \"%s\"", action->type, action->state, key);
if(action->type==2)
- XBT_INFO("Type of communication : %d, Ref count = %d", action->comm.type, action->comm.refcount);
+ XBT_INFO("Type of communication : %d, Ref count = %d", action->comm.type, action->comm.refcount);
}
//new_rdv->comm_fifo = xbt_fifo_copy(((smx_rdv_t)data)->comm_fifo);
xbt_dict_set(pair->rdv_points, new_rdv->name, new_rdv, NULL);
xbt_dynar_foreach(reached_pairs_hash, cursor, pair_test){
if(automaton_state_compare(pair_test->automaton_state, st) == 0){
- if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
- for(j=0 ; j< sn->num_reg ; j++){
- if(hash_regions[j] != pair_test->hash_regions[j]){
- region_diff++;
- }
- }
- if(region_diff == 0){
- MC_free_snapshot(sn);
- xbt_dynar_reset(prop_ato);
- xbt_free(prop_ato);
- MC_UNSET_RAW_MEM;
- return 1;
- }else{
- XBT_INFO("Different snapshot");
- }
- }else{
- XBT_INFO("Different values of propositional symbols");
- }
+ if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
+ for(j=0 ; j< sn->num_reg ; j++){
+ if(hash_regions[j] != pair_test->hash_regions[j]){
+ region_diff++;
+ }
+ }
+ if(region_diff == 0){
+ MC_free_snapshot(sn);
+ xbt_dynar_reset(prop_ato);
+ xbt_free(prop_ato);
+ MC_UNSET_RAW_MEM;
+ return 1;
+ }else{
+ XBT_INFO("Different snapshot");
+ }
+ }else{
+ XBT_INFO("Different values of propositional symbols");
+ }
}else{
- XBT_INFO("Different automaton state");
+ XBT_INFO("Different automaton state");
}
region_diff = 0;
xbt_dynar_foreach(visited_pairs, cursor, pair_test){
if(pair_test->search_cycle == sc) {
- if(automaton_state_compare(pair_test->automaton_state, st) == 0){
- if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
- if(snapshot_compare(pair_test->system_state, sn) == 0){
-
- MC_free_snapshot(sn);
- xbt_dynar_reset(prop_ato);
- xbt_free(prop_ato);
- MC_UNSET_RAW_MEM;
-
- return 1;
-
- }else{
- XBT_INFO("Different snapshot");
- }
- }else{
- XBT_INFO("Different values of propositional symbols");
- }
- }else{
- XBT_INFO("Different automaton state");
- }
+ if(automaton_state_compare(pair_test->automaton_state, st) == 0){
+ if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
+ if(snapshot_compare(pair_test->system_state, sn) == 0){
+
+ MC_free_snapshot(sn);
+ xbt_dynar_reset(prop_ato);
+ xbt_free(prop_ato);
+ MC_UNSET_RAW_MEM;
+
+ return 1;
+
+ }else{
+ XBT_INFO("Different snapshot");
+ }
+ }else{
+ XBT_INFO("Different values of propositional symbols");
+ }
+ }else{
+ XBT_INFO("Different automaton state");
+ }
}else{
- XBT_INFO("Different value of search_cycle");
+ XBT_INFO("Different value of search_cycle");
}
}
xbt_dynar_foreach(visited_pairs_hash, cursor, pair_test){
if(pair_test->search_cycle == sc) {
- if(automaton_state_compare(pair_test->automaton_state, st) == 0){
- if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
- for(j=0 ; j< sn->num_reg ; j++){
- if(hash_regions[j] != pair_test->hash_regions[j]){
- region_diff++;
- }
- }
- if(region_diff == 0){
- MC_free_snapshot(sn);
- xbt_dynar_reset(prop_ato);
- xbt_free(prop_ato);
- MC_UNSET_RAW_MEM;
- return 1;
- }else{
- //XBT_INFO("Different snapshot");
- }
- }else{
- //XBT_INFO("Different values of propositional symbols");
- }
- }else{
- //XBT_INFO("Different automaton state");
- }
+ if(automaton_state_compare(pair_test->automaton_state, st) == 0){
+ if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
+ for(j=0 ; j< sn->num_reg ; j++){
+ if(hash_regions[j] != pair_test->hash_regions[j]){
+ region_diff++;
+ }
+ }
+ if(region_diff == 0){
+ MC_free_snapshot(sn);
+ xbt_dynar_reset(prop_ato);
+ xbt_free(prop_ato);
+ MC_UNSET_RAW_MEM;
+ return 1;
}else{
- //XBT_INFO("Different value of search_cycle");
+ //XBT_INFO("Different snapshot");
+ }
+ }else{
+ //XBT_INFO("Different values of propositional symbols");
+ }
+ }else{
+ //XBT_INFO("Different automaton state");
+ }
+ }else{
+ //XBT_INFO("Different value of search_cycle");
}
region_diff = 0;
int_f_void_t f;
xbt_dynar_foreach(automaton->propositional_symbols, cursor, p){
if(strcmp(p->pred, l->u.predicat) == 0){
- f = (int_f_void_t)p->function;
- return (*f)();
+ f = (int_f_void_t)p->function;
+ return (*f)();
}
}
return -1;
MC_UNSET_RAW_MEM;
if(cursor != 0){
- MC_restore_snapshot(initial_snapshot_liveness);
- MC_UNSET_RAW_MEM;
+ MC_restore_snapshot(initial_snapshot_liveness);
+ MC_UNSET_RAW_MEM;
}
MC_ddfs(0);
}else{
if(state->type == 2){
- MC_SET_RAW_MEM;
- mc_initial_pair = new_pair_stateless(initial_graph_state, state, MC_state_interleave_size(initial_graph_state));
- xbt_fifo_unshift(mc_stack_liveness, mc_initial_pair);
- MC_UNSET_RAW_MEM;
-
- set_pair_reached(state);
- //set_pair_reached_hash(state);
-
- if(cursor != 0){
- MC_restore_snapshot(initial_snapshot_liveness);
- MC_UNSET_RAW_MEM;
- }
-
- MC_ddfs(1);
-
+ MC_SET_RAW_MEM;
+ mc_initial_pair = new_pair_stateless(initial_graph_state, state, MC_state_interleave_size(initial_graph_state));
+ xbt_fifo_unshift(mc_stack_liveness, mc_initial_pair);
+ MC_UNSET_RAW_MEM;
+
+ set_pair_reached(state);
+ //set_pair_reached_hash(state);
+
+ if(cursor != 0){
+ MC_restore_snapshot(initial_snapshot_liveness);
+ MC_UNSET_RAW_MEM;
+ }
+
+ MC_ddfs(1);
+
}
}
}
while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
- /* Debug information */
+ /* Debug information */
- req_str = MC_request_to_string(req, value);
- XBT_INFO("Execute: %s", req_str);
- xbt_free(req_str);
+ req_str = MC_request_to_string(req, value);
+ XBT_INFO("Execute: %s", req_str);
+ xbt_free(req_str);
- MC_state_set_executed_request(current_pair->graph_state, req, value);
+ MC_state_set_executed_request(current_pair->graph_state, req, value);
- /* Answer the request */
- SIMIX_simcall_pre(req, value);
+ /* Answer the request */
+ SIMIX_simcall_pre(req, value);
- /* Wait for requests (schedules processes) */
- MC_wait_for_requests();
+ /* Wait for requests (schedules processes) */
+ MC_wait_for_requests();
- MC_SET_RAW_MEM;
+ MC_SET_RAW_MEM;
- /* Create the new expanded graph_state */
- next_graph_state = MC_state_pair_new();
+ /* Create the new expanded graph_state */
+ next_graph_state = MC_state_pair_new();
- /* Get enabled process and insert it in the interleave set of the next graph_state */
- xbt_swag_foreach(process, simix_global->process_list){
- if(MC_process_is_enabled(process)){
- MC_state_interleave_process(next_graph_state, process);
- }
- }
+ /* Get enabled process and insert it in the interleave set of the next graph_state */
+ xbt_swag_foreach(process, simix_global->process_list){
+ if(MC_process_is_enabled(process)){
+ MC_state_interleave_process(next_graph_state, process);
+ }
+ }
- xbt_dynar_reset(successors);
+ xbt_dynar_reset(successors);
- MC_UNSET_RAW_MEM;
+ MC_UNSET_RAW_MEM;
- cursor= 0;
- xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
+ cursor= 0;
+ xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
- res = MC_automaton_evaluate_label(transition_succ->label);
+ res = MC_automaton_evaluate_label(transition_succ->label);
- if(res == 1){ // enabled transition in automaton
- MC_SET_RAW_MEM;
- next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
- xbt_dynar_push(successors, &next_pair);
- MC_UNSET_RAW_MEM;
- }
+ if(res == 1){ // enabled transition in automaton
+ MC_SET_RAW_MEM;
+ next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
+ xbt_dynar_push(successors, &next_pair);
+ MC_UNSET_RAW_MEM;
+ }
- }
+ }
- cursor = 0;
+ cursor = 0;
- xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
+ xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
- res = MC_automaton_evaluate_label(transition_succ->label);
-
- if(res == 2){ // true transition in automaton
- MC_SET_RAW_MEM;
- next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
- xbt_dynar_push(successors, &next_pair);
- MC_UNSET_RAW_MEM;
- }
-
- }
-
- cursor = 0;
-
- xbt_dynar_foreach(successors, cursor, pair_succ){
-
- if(search_cycle == 1){
-
- if((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2)){
-
- if(reached(pair_succ->automaton_state)){
- //if(reached_hash(pair_succ->automaton_state)){
-
- XBT_INFO("Next pair (depth = %d, %u interleave) already reached !", xbt_fifo_size(mc_stack_liveness) + 1, MC_state_interleave_size(pair_succ->graph_state));
-
- XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
- XBT_INFO("| ACCEPTANCE CYCLE |");
- XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
- XBT_INFO("Counter-example that violates formula :");
- MC_show_stack_liveness(mc_stack_liveness);
- MC_dump_stack_liveness(mc_stack_liveness);
- MC_print_statistics_pairs(mc_stats_pair);
- exit(0);
-
- }else{
-
- XBT_INFO("Next pair (depth =%d) -> Acceptance pair : graph=%p, automaton=%p(%s)", xbt_fifo_size(mc_stack_liveness) + 1, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
-
- set_pair_reached(pair_succ->automaton_state);
- //set_pair_reached_hash(pair_succ->automaton_state);
-
- XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
- //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
-
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness, pair_succ);
- MC_UNSET_RAW_MEM;
-
- MC_ddfs(search_cycle);
-
- }
-
- }else{
-
- if(!visited_hash(pair_succ->automaton_state, search_cycle)){
- //if(!visited(pair_succ->automaton_state, search_cycle)){
-
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness, pair_succ);
- MC_UNSET_RAW_MEM;
-
- MC_ddfs(search_cycle);
-
- }else{
-
- XBT_INFO("Next pair already visited ! ");
-
- }
-
- }
-
- }else{
-
- if(((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
-
- XBT_INFO("Next pair (depth =%d) -> Acceptance pair : graph=%p, automaton=%p(%s)", xbt_fifo_size(mc_stack_liveness) + 1, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
-
- set_pair_reached(pair_succ->automaton_state);
- //set_pair_reached_hash(pair_succ->automaton_state);
-
- search_cycle = 1;
-
- XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
- //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
-
- }
-
- if(!visited_hash(pair_succ->automaton_state, search_cycle)){
- //if(!visited(pair_succ->automaton_state, search_cycle)){
-
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness, pair_succ);
- MC_UNSET_RAW_MEM;
-
- MC_ddfs(search_cycle);
-
- }else{
-
- XBT_INFO("Next pair already visited ! ");
-
- }
-
- }
-
-
- /* Restore system before checking others successors */
- if(cursor != (xbt_dynar_length(successors) - 1))
- MC_replay_liveness(mc_stack_liveness, 1);
-
-
- }
-
- if(MC_state_interleave_size(current_pair->graph_state) > 0){
- XBT_INFO("Backtracking to depth %d", xbt_fifo_size(mc_stack_liveness));
- MC_replay_liveness(mc_stack_liveness, 0);
- }
+ res = MC_automaton_evaluate_label(transition_succ->label);
+
+ if(res == 2){ // true transition in automaton
+ MC_SET_RAW_MEM;
+ next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
+ xbt_dynar_push(successors, &next_pair);
+ MC_UNSET_RAW_MEM;
+ }
+
+ }
+
+ cursor = 0;
+
+ xbt_dynar_foreach(successors, cursor, pair_succ){
+
+ if(search_cycle == 1){
+
+ if((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2)){
+
+ if(reached(pair_succ->automaton_state)){
+ //if(reached_hash(pair_succ->automaton_state)){
+
+ XBT_INFO("Next pair (depth = %d, %u interleave) already reached !", xbt_fifo_size(mc_stack_liveness) + 1, MC_state_interleave_size(pair_succ->graph_state));
+
+ XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
+ XBT_INFO("| ACCEPTANCE CYCLE |");
+ XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
+ XBT_INFO("Counter-example that violates formula :");
+ MC_show_stack_liveness(mc_stack_liveness);
+ MC_dump_stack_liveness(mc_stack_liveness);
+ MC_print_statistics_pairs(mc_stats_pair);
+ exit(0);
+
+ }else{
+
+ XBT_INFO("Next pair (depth =%d) -> Acceptance pair : graph=%p, automaton=%p(%s)", xbt_fifo_size(mc_stack_liveness) + 1, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
+
+ set_pair_reached(pair_succ->automaton_state);
+ //set_pair_reached_hash(pair_succ->automaton_state);
+
+ XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
+ //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
+
+ MC_SET_RAW_MEM;
+ xbt_fifo_unshift(mc_stack_liveness, pair_succ);
+ MC_UNSET_RAW_MEM;
+
+ MC_ddfs(search_cycle);
+
+ }
+
+ }else{
+
+ if(!visited_hash(pair_succ->automaton_state, search_cycle)){
+ //if(!visited(pair_succ->automaton_state, search_cycle)){
+
+ MC_SET_RAW_MEM;
+ xbt_fifo_unshift(mc_stack_liveness, pair_succ);
+ MC_UNSET_RAW_MEM;
+
+ MC_ddfs(search_cycle);
+
+ }else{
+
+ XBT_INFO("Next pair already visited ! ");
+
+ }
+
+ }
+
+ }else{
+
+ if(((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
+
+ XBT_INFO("Next pair (depth =%d) -> Acceptance pair : graph=%p, automaton=%p(%s)", xbt_fifo_size(mc_stack_liveness) + 1, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
+
+ set_pair_reached(pair_succ->automaton_state);
+ //set_pair_reached_hash(pair_succ->automaton_state);
+
+ search_cycle = 1;
+
+ XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
+ //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
+
+ }
+
+ if(!visited_hash(pair_succ->automaton_state, search_cycle)){
+ //if(!visited(pair_succ->automaton_state, search_cycle)){
+
+ MC_SET_RAW_MEM;
+ xbt_fifo_unshift(mc_stack_liveness, pair_succ);
+ MC_UNSET_RAW_MEM;
+
+ MC_ddfs(search_cycle);
+
+ }else{
+
+ XBT_INFO("Next pair already visited ! ");
+
+ }
+
+ }
+
+
+ /* Restore system before checking others successors */
+ if(cursor != (xbt_dynar_length(successors) - 1))
+ MC_replay_liveness(mc_stack_liveness, 1);
+
+
+ }
+
+ if(MC_state_interleave_size(current_pair->graph_state) > 0){
+ XBT_INFO("Backtracking to depth %d", xbt_fifo_size(mc_stack_liveness));
+ MC_replay_liveness(mc_stack_liveness, 0);
+ }
}
cursor= 0;
xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
- res = MC_automaton_evaluate_label(transition_succ->label);
+ res = MC_automaton_evaluate_label(transition_succ->label);
- if(res == 1){ // enabled transition in automaton
- MC_SET_RAW_MEM;
- next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
- xbt_dynar_push(successors, &next_pair);
- MC_UNSET_RAW_MEM;
- }
+ if(res == 1){ // enabled transition in automaton
+ MC_SET_RAW_MEM;
+ next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
+ xbt_dynar_push(successors, &next_pair);
+ MC_UNSET_RAW_MEM;
+ }
}
xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
- res = MC_automaton_evaluate_label(transition_succ->label);
-
- if(res == 2){ // true transition in automaton
- MC_SET_RAW_MEM;
- next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
- xbt_dynar_push(successors, &next_pair);
- MC_UNSET_RAW_MEM;
- }
+ res = MC_automaton_evaluate_label(transition_succ->label);
+
+ if(res == 2){ // true transition in automaton
+ MC_SET_RAW_MEM;
+ next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
+ xbt_dynar_push(successors, &next_pair);
+ MC_UNSET_RAW_MEM;
+ }
}
xbt_dynar_foreach(successors, cursor, pair_succ){
- if(search_cycle == 1){
+ if(search_cycle == 1){
- if((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2)){
+ if((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2)){
- if(reached(pair_succ->automaton_state)){
- //if(reached_hash(pair_succ->automaton_state)){
+ if(reached(pair_succ->automaton_state)){
+ //if(reached_hash(pair_succ->automaton_state)){
- XBT_INFO("Next pair (depth = %d) already reached !", xbt_fifo_size(mc_stack_liveness) + 1);
-
- XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
- XBT_INFO("| ACCEPTANCE CYCLE |");
- XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
- XBT_INFO("Counter-example that violates formula :");
- MC_show_stack_liveness(mc_stack_liveness);
- MC_dump_stack_liveness(mc_stack_liveness);
- MC_print_statistics_pairs(mc_stats_pair);
- exit(0);
+ XBT_INFO("Next pair (depth = %d) already reached !", xbt_fifo_size(mc_stack_liveness) + 1);
+
+ XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
+ XBT_INFO("| ACCEPTANCE CYCLE |");
+ XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
+ XBT_INFO("Counter-example that violates formula :");
+ MC_show_stack_liveness(mc_stack_liveness);
+ MC_dump_stack_liveness(mc_stack_liveness);
+ MC_print_statistics_pairs(mc_stats_pair);
+ exit(0);
- }else{
+ }else{
- XBT_INFO("Next pair (depth = %d) -> Acceptance pair : graph=%p, automaton=%p(%s)", xbt_fifo_size(mc_stack_liveness) + 1, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
-
- set_pair_reached(pair_succ->automaton_state);
- //set_pair_reached_hash(pair_succ->automaton_state);
-
- XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
- //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
+ XBT_INFO("Next pair (depth = %d) -> Acceptance pair : graph=%p, automaton=%p(%s)", xbt_fifo_size(mc_stack_liveness) + 1, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
+
+ set_pair_reached(pair_succ->automaton_state);
+ //set_pair_reached_hash(pair_succ->automaton_state);
+
+ XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
+ //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness, pair_succ);
- MC_UNSET_RAW_MEM;
-
- MC_ddfs(search_cycle);
+ MC_SET_RAW_MEM;
+ xbt_fifo_unshift(mc_stack_liveness, pair_succ);
+ MC_UNSET_RAW_MEM;
+
+ MC_ddfs(search_cycle);
- }
+ }
- }else{
+ }else{
- if(!visited_hash(pair_succ->automaton_state, search_cycle)){
- //if(!visited(pair_succ->automaton_state, search_cycle)){
+ if(!visited_hash(pair_succ->automaton_state, search_cycle)){
+ //if(!visited(pair_succ->automaton_state, search_cycle)){
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness, pair_succ);
- MC_UNSET_RAW_MEM;
-
- MC_ddfs(search_cycle);
-
- }else{
+ MC_SET_RAW_MEM;
+ xbt_fifo_unshift(mc_stack_liveness, pair_succ);
+ MC_UNSET_RAW_MEM;
+
+ MC_ddfs(search_cycle);
+
+ }else{
- XBT_INFO("Next pair already visited ! ");
+ XBT_INFO("Next pair already visited ! ");
- }
- }
-
+ }
+ }
+
- }else{
-
- if(((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
+ }else{
+
+ if(((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
- set_pair_reached(pair_succ->automaton_state);
- //set_pair_reached_hash(pair_succ->automaton_state);
-
- search_cycle = 1;
+ set_pair_reached(pair_succ->automaton_state);
+ //set_pair_reached_hash(pair_succ->automaton_state);
+
+ search_cycle = 1;
- XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
- //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
+ XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
+ //XBT_INFO("Reached pairs : %lu", xbt_dynar_length(reached_pairs_hash));
- }
+ }
- if(!visited_hash(pair_succ->automaton_state, search_cycle)){
- //if(!visited(pair_succ->automaton_state, search_cycle)){
+ if(!visited_hash(pair_succ->automaton_state, search_cycle)){
+ //if(!visited(pair_succ->automaton_state, search_cycle)){
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness, pair_succ);
- MC_UNSET_RAW_MEM;
-
- MC_ddfs(search_cycle);
-
- }else{
+ MC_SET_RAW_MEM;
+ xbt_fifo_unshift(mc_stack_liveness, pair_succ);
+ MC_UNSET_RAW_MEM;
+
+ MC_ddfs(search_cycle);
+
+ }else{
- XBT_INFO("Next pair already visited ! ");
+ XBT_INFO("Next pair already visited ! ");
- }
+ }
- }
+ }
- /* Restore system before checking others successors */
- if(cursor != xbt_dynar_length(successors) - 1)
- MC_replay_liveness(mc_stack_liveness, 1);
+ /* Restore system before checking others successors */
+ if(cursor != xbt_dynar_length(successors) - 1)
+ MC_replay_liveness(mc_stack_liveness, 1);
-
+
}
}
act = req->comm_wait.comm;
if(value == -1){
type = xbt_strdup("WaitTimeout");
- p = pointer_to_string(act);
- args = bprintf("comm=%p", p);
+ p = pointer_to_string(act);
+ args = bprintf("comm=%p", p);
}else{
type = xbt_strdup("Wait");
- p = pointer_to_string(act);
- args = bprintf("comm=%s [(%lu)%s -> (%lu)%s]", p,
+ p = pointer_to_string(act);
+ args = bprintf("comm=%s [(%lu)%s -> (%lu)%s]", p,
act->comm.src_proc ? act->comm.src_proc->pid : 0,
act->comm.src_proc ? act->comm.src_proc->name : "",
act->comm.dst_proc ? act->comm.dst_proc->pid : 0,
act = req->comm_test.comm;
if(act->comm.src_proc == NULL || act->comm.dst_proc == NULL){
type = xbt_strdup("Test FALSE");
- p = pointer_to_string(act);
+ p = pointer_to_string(act);
args = bprintf("comm=%s", p);
}else{
type = xbt_strdup("Test TRUE");
- p = pointer_to_string(act);
+ p = pointer_to_string(act);
args = bprintf("comm=%s [(%lu)%s -> (%lu)%s]", p,
act->comm.src_proc->pid, act->comm.src_proc->name,
act->comm.dst_proc->pid, act->comm.dst_proc->name);
xbt_dynar_t todo;
xbt_dict_cursor_t cursor;
- action_fp=NULL;
+ action_fp=NULL;
if (path) {
action_fp = fopen(path, "r");
xbt_assert(action_fp != NULL, "Cannot open %s: %s", path,
m_host_t *MSG_get_host_table(void)
{
void **array;
- int i = 0;
- xbt_lib_cursor_t cursor;
- char *key;
- void **data;
-
- if (xbt_lib_length(host_lib) == 0)
- return NULL;
- else
- array = xbt_new0(void *, xbt_lib_length(host_lib));
-
- xbt_lib_foreach(host_lib, cursor, key, data) {
- if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST)
- array[i++] = data[MSG_HOST_LEVEL];
- }
-
- return (m_host_t *)array;
+ int i = 0;
+ xbt_lib_cursor_t cursor;
+ char *key;
+ void **data;
+
+ if (xbt_lib_length(host_lib) == 0)
+ return NULL;
+ else
+ array = xbt_new0(void *, xbt_lib_length(host_lib));
+
+ xbt_lib_foreach(host_lib, cursor, key, data) {
+ if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST)
+ array[i++] = data[MSG_HOST_LEVEL];
+ }
+
+ return (m_host_t *)array;
}
#endif
SG_BEGIN_DECL()
-#define MAX_ALIAS_NAME ((size_t)260)
+#define MAX_ALIAS_NAME ((size_t)260)
/*! \brief MSG_mailbox_new - create a new mailbox.
*
* The function MSG_mailbox_new creates a new mailbox identified by the key specified
* by the parameter alias and add it in the global dictionary.
*
- * \param alias The alias of the mailbox to create.
+ * \param alias The alias of the mailbox to create.
*
- * \return The newly created mailbox.
+ * \return The newly created mailbox.
*/
XBT_PUBLIC(msg_mailbox_t)
MSG_mailbox_new(const char *alias);
* The function MSG_mailbox_free release a mailbox from the memory but does
* not remove it from the dictionary.
*
- * \param mailbox The mailbox to release.
+ * \param mailbox The mailbox to release.
*
- * \see MSG_mailbox_destroy.
+ * \see MSG_mailbox_destroy.
*/
void MSG_mailbox_free(void *mailbox);
* the key specified by the parameter alias. If the mailbox does not exists,
* the function create it.
*
- * \param alias The alias of the mailbox to return.
+ * \param alias The alias of the mailbox to return.
*
- * \return The mailbox associated with the alias specified as parameter
- * or a new mailbox if the key does not match.
+ * \return The mailbox associated with the alias specified as parameter
+ * or a new mailbox if the key does not match.
*/
XBT_PUBLIC(msg_mailbox_t)
MSG_mailbox_get_by_alias(const char *alias);
* The function MSG_mailbox_is_empty tests if a mailbox is empty
* (contains no msg task).
*
- * \param mailbox The mailbox to get test.
+ * \param mailbox The mailbox to get test.
*
- * \return The function returns 1 if the mailbox is empty. Otherwise the function
- * returns 0.
+ * \return The function returns 1 if the mailbox is empty. Otherwise the function
+ * returns 0.
*/
XBT_PUBLIC(int) MSG_mailbox_is_empty(msg_mailbox_t mailbox);
* This function does not remove the task from the mailbox (contrary to
* the function MSG_mailbox_pop_head).
*
- * \param mailbox The mailbox concerned by the operation.
+ * \param mailbox The mailbox concerned by the operation.
*
- * \return The task at the head of the mailbox.
+ * \return The task at the head of the mailbox.
*/
XBT_PUBLIC(m_task_t)
MSG_mailbox_get_head(msg_mailbox_t mailbox);
/*! \brief MSG_mailbox_get_count_host_waiting_tasks - Return the number of tasks
waiting to be received in a mailbox and sent by a host.
*
- * \param mailbox The mailbox concerned by the operation.
- * \param host The msg host containing the processes that have sended the
- * tasks.
+ * \param mailbox The mailbox concerned by the operation.
+ * \param host The msg host containing the processes that have sended the
+ * tasks.
*
- * \return The number of tasks in the mailbox specified by the
- * parameter mailbox and sended by all the processes located
- * on the host specified by the parameter host.
+ * \return The number of tasks in the mailbox specified by the
+ * parameter mailbox and sended by all the processes located
+ * on the host specified by the parameter host.
*/
XBT_PUBLIC(int)
MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox,
int argc; /* arguments number if any */
MSG_error_t last_errno; /* the last value returned by a MSG_function */
- msg_vm_t vm; /* virtual machine the process is in */
+ msg_vm_t vm; /* virtual machine the process is in */
void* data; /* user data */
} s_simdata_process_t, *simdata_process_t;
// remove the process from its virtual machine
if (msg_proc->vm) {
- int pos = xbt_dynar_search(msg_proc->vm->processes,&smx_proc);
- xbt_dynar_remove_at(msg_proc->vm->processes,pos, NULL);
+ int pos = xbt_dynar_search(msg_proc->vm->processes,&smx_proc);
+ xbt_dynar_remove_at(msg_proc->vm->processes,pos, NULL);
}
// free the MSG process
*/
m_process_t MSG_process_from_PID(int PID)
{
- return SIMIX_process_from_PID(PID);
+ return SIMIX_process_from_PID(PID);
}
/** @brief returns a list of all currently existing processes */
*
*/
void MSG_vm_bind(msg_vm_t vm, m_process_t process) {
- /* check if the process is already in a VM */
- simdata_process_t simdata = simcall_process_get_data(process);
- if (simdata->vm) {
- msg_vm_t old_vm = simdata->vm;
- int pos = xbt_dynar_search(old_vm->processes,&process);
- xbt_dynar_remove_at(old_vm->processes,pos, NULL);
- }
- /* check if the host is in the right host */
- if (simdata->m_host != vm->location) {
- MSG_process_migrate(process,vm->location);
- }
- simdata->vm = vm;
+ /* check if the process is already in a VM */
+ simdata_process_t simdata = simcall_process_get_data(process);
+ if (simdata->vm) {
+ msg_vm_t old_vm = simdata->vm;
+ int pos = xbt_dynar_search(old_vm->processes,&process);
+ xbt_dynar_remove_at(old_vm->processes,pos, NULL);
+ }
+ /* check if the host is in the right host */
+ if (simdata->m_host != vm->location) {
+ MSG_process_migrate(process,vm->location);
+ }
+ simdata->vm = vm;
- XBT_DEBUG("binding Process %s to %p",MSG_process_get_name(process),vm);
+ XBT_DEBUG("binding Process %s to %p",MSG_process_get_name(process),vm);
xbt_dynar_push_as(vm->processes,m_process_t,process);
}
unsigned int cpt;
m_process_t process;
xbt_dynar_foreach(vm->processes,cpt,process) {
- XBT_DEBUG("resume process %s of host %s",MSG_process_get_name(process),MSG_host_get_name(MSG_process_get_host(process)));
+ XBT_DEBUG("resume process %s of host %s",MSG_process_get_name(process),MSG_host_get_name(MSG_process_get_host(process)));
MSG_process_resume(process);
}
}
m_process_t process;
XBT_DEBUG("%lu processes in the VM", xbt_dynar_length(vm->processes));
while (xbt_dynar_length(vm->processes) > 0) {
- process = xbt_dynar_get_as(vm->processes,0,m_process_t);
- MSG_process_kill(process);
+ process = xbt_dynar_get_as(vm->processes,0,m_process_t);
+ MSG_process_kill(process);
}
}
* @ingroup msg_VMs
*/
void MSG_vm_destroy(msg_vm_t vm) {
- unsigned int cpt;
- m_process_t process;
- xbt_dynar_foreach(vm->processes,cpt,process) {
- //FIXME: Slow ?
- simdata_process_t simdata = simcall_process_get_data(process);
- simdata->vm = NULL;
- }
- xbt_dynar_free(&vm->processes);
- xbt_free(vm);
+ unsigned int cpt;
+ m_process_t process;
+ xbt_dynar_foreach(vm->processes,cpt,process) {
+ //FIXME: Slow ?
+ simdata_process_t simdata = simcall_process_get_data(process);
+ simdata->vm = NULL;
+ }
+ xbt_dynar_free(&vm->processes);
+ xbt_free(vm);
}
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
-#else /* ! __cplusplus */
+#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up dax_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up dax_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up dax_text again */ \
- } \
- while ( 0 )
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up dax_text again */ \
+ } \
+ while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
- int yy_buffer_status;
+ int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via dax_restart()), so that the user can continue scanning by
- * just pointing dax_in at a new input file.
- */
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via dax_restart()), so that the user can continue scanning by
+ * just pointing dax_in at a new input file.
+ */
#define YY_BUFFER_EOF_PENDING 2
- };
+ };
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
/* yy_hold_char holds the character lost when dax_text is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
int dax_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
/* Flag which is used to allow dax_wrap()'s to do buffer switches
* instead of setting up a fresh dax_in. A bit of a hack ...
#define yy_new_buffer dax__create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
dax_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
dax__create_buffer(dax_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
dax_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
dax__create_buffer(dax_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
* corresponding action - sets up dax_text.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- dax_leng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp; \
+ dax_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 140
#define YY_END_OF_BUFFER 141
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
static yyconst flex_int16_t yy_accept[775] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* XML state. */
#ifdef FLEX_DEBUG
-# define ENTER(state) debug_enter(state,#state)
-# define LEAVE debug_leave()
-# define SET(state) debug_set(state,#state)
+# define ENTER(state) debug_enter(state,#state)
+# define LEAVE debug_leave()
+# define SET(state) debug_set(state,#state)
static void debug_enter(int, const char*);
static void debug_leave(void);
static void debug_set(int, const char*);
#else
-# define ENTER(state) (yy_push_state(state))
-# define LEAVE (yy_pop_state())
-# define SET(state) BEGIN(state)
+# define ENTER(state) (yy_push_state(state))
+# define LEAVE (yy_pop_state())
+# define SET(state) BEGIN(state)
#endif
/* Generic actions. */
-#define SKIP /*skip*/
+#define SKIP /*skip*/
#define SUCCEED CLEANUP; return 0
-#define FAIL return fail
+#define FAIL return fail
static int fail(const char*, ...);
enum {flexml_max_err_msg_size = 512};
static int ck_blimit()
{
if (bnext >= blimit) {
- blimit += FLEXML_BUFFERSTACKSIZE + 2;
- {
- char *temp = (char *) realloc(dax__bufferstack, blimit);
- assert(temp);
- dax__bufferstack = temp;
- }
+ blimit += FLEXML_BUFFERSTACKSIZE + 2;
+ {
+ char *temp = (char *) realloc(dax__bufferstack, blimit);
+ assert(temp);
+ dax__bufferstack = temp;
+ }
}
return 0;
}
static int ck_ilimit()
{
if (inext >= ilimit) {
- ilimit += FLEXML_INDEXSTACKSIZE + 2;
- {
- int *temp = (int *) realloc(indexstack, ilimit);
- assert(temp);
- indexstack = temp;
- }
+ ilimit += FLEXML_INDEXSTACKSIZE + 2;
+ {
+ int *temp = (int *) realloc(indexstack, ilimit);
+ assert(temp);
+ indexstack = temp;
+ }
}
return 0;
}
/* Miscellaneous. */
/* Parser states (flex `exclusive start conditions'):
*
- * PROLOG the XML prolog of the document before <?xml...>
- * DOCTYPE the XML prolog of the document after <?xml...>
- * EPILOG after the root element
- * INCOMMENT inside an XML comment <!--....-->
- * INPI inside an XML PI <?...?>
- * VALUE1 inside a '...'-delimited literal
- * VALUE2 inside a "..."-delimited literal
- * CDATA inside a <![CDATA[...] ]> section.
- * ROOT_<tag> expect root element <tag>
- * AL_<tag> inside the attribute list for <tag>
- * IN_<tag> inside a <tag> with element contents (ready for end tag)
- * IMPOSSIBLE dummy to permit disabling rules; must be last
+ * PROLOG the XML prolog of the document before <?xml...>
+ * DOCTYPE the XML prolog of the document after <?xml...>
+ * EPILOG after the root element
+ * INCOMMENT inside an XML comment <!--....-->
+ * INPI inside an XML PI <?...?>
+ * VALUE1 inside a '...'-delimited literal
+ * VALUE2 inside a "..."-delimited literal
+ * CDATA inside a <![CDATA[...] ]> section.
+ * ROOT_<tag> expect root element <tag>
+ * AL_<tag> inside the attribute list for <tag>
+ * IN_<tag> inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE dummy to permit disabling rules; must be last
*/
/* State names. */
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- size_t n; \
- for ( n = 0; n < max_size && \
- (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( dax_in ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(dax_in); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( dax_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( dax_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, dax_in))==0 && ferror(dax_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(dax_in); \
+ } \
+ }\
\
#endif
#endif
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG);
/* COMMENTS and PIs: handled uniformly for efficiency. */
- if ( !(yy_init) )
- {
- (yy_init) = 1;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
#ifdef YY_USER_INIT
- YY_USER_INIT;
+ YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! dax_in )
- dax_in = stdin;
+ if ( ! dax_in )
+ dax_in = stdin;
- if ( ! dax_out )
- dax_out = stdout;
+ if ( ! dax_out )
+ dax_out = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- dax_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- dax__create_buffer(dax_in,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ dax_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ dax__create_buffer(dax_in,YY_BUF_SIZE );
+ }
- dax__load_buffer_state( );
- }
+ dax__load_buffer_state( );
+ }
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
- /* Support of dax_text. */
- *yy_cp = (yy_hold_char);
+ /* Support of dax_text. */
+ *yy_cp = (yy_hold_char);
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = (yy_start);
yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 775 )
- 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] != 2164 );
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 775 )
+ 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] != 2164 );
yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
- if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
- {
- int yyl;
- for ( yyl = 0; yyl < dax_leng; ++yyl )
- if ( dax_text[yyl] == '\n' )
-
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+ {
+ int yyl;
+ for ( yyl = 0; yyl < dax_leng; ++yyl )
+ if ( dax_text[yyl] == '\n' )
+
dax_lineno++;
;
- }
+ }
-do_action: /* This label is used only to access EOF actions. */
+do_action: /* This label is used only to access EOF actions. */
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
case 1:
YY_RULE_SETUP
ENTER(INCOMMENT);
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
ENTER(INPI);
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
+ YY_BREAK
case 4:
case 5:
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INCOMMENT):
FAIL("EOF in comment.");
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
+ YY_BREAK
case 8:
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INPI):
FAIL("EOF in PI (processing instruction).");
- YY_BREAK
+ YY_BREAK
/* SPACES: skipped uniformly */
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
/* PROLOG: determine root element and process it. */
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
SET(ROOT_dax__adag);
- YY_BREAK
+ YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
FAIL("Bad declaration %s.",dax_text);
- YY_BREAK
+ YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
SET(ROOT_dax__adag);
- YY_BREAK
+ YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
FAIL("Bad declaration %s.",dax_text);
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in prolog.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(PROLOG):
case YY_STATE_EOF(DOCTYPE):
FAIL("EOF in prolog.");
- YY_BREAK
+ YY_BREAK
/* RULES DERIVED FROM DTD. */
/* <!-- Small DTD for DAX files. --> */
/* rule 16 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <adag> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
dax__adag_childCount_isset = 0;
ENTER(AL_dax__adag); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in <dax__adag>");} dax__adag_xmlns_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns);
- YY_BREAK
+ YY_BREAK
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
if (dax__adag_xmlns_isset != 0) {FAIL("Multiple definition of attribute xmlns in <dax__adag>");} dax__adag_xmlns_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns);
- YY_BREAK
+ YY_BREAK
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in <dax__adag>");} dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xmlns_c_xsi);
- YY_BREAK
+ YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
if (dax__adag_xmlns_c_xsi_isset != 0) {FAIL("Multiple definition of attribute xmlns:xsi in <dax__adag>");} dax__adag_xmlns_c_xsi_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xmlns_c_xsi);
- YY_BREAK
+ YY_BREAK
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in <dax__adag>");} dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation);
- YY_BREAK
+ YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
if (dax__adag_xsi_c_schemaLocation_isset != 0) {FAIL("Multiple definition of attribute xsi:schemaLocation in <dax__adag>");} dax__adag_xsi_c_schemaLocation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_xsi_c_schemaLocation);
- YY_BREAK
+ YY_BREAK
case 24:
/* rule 24 can match eol */
YY_RULE_SETUP
if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__adag>");} dax__adag_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_version);
- YY_BREAK
+ YY_BREAK
case 25:
/* rule 25 can match eol */
YY_RULE_SETUP
if (dax__adag_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__adag>");} dax__adag_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_version);
- YY_BREAK
+ YY_BREAK
case 26:
/* rule 26 can match eol */
YY_RULE_SETUP
if (dax__adag_count_isset != 0) {FAIL("Multiple definition of attribute count in <dax__adag>");} dax__adag_count_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_count);
- YY_BREAK
+ YY_BREAK
case 27:
/* rule 27 can match eol */
YY_RULE_SETUP
if (dax__adag_count_isset != 0) {FAIL("Multiple definition of attribute count in <dax__adag>");} dax__adag_count_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_count);
- YY_BREAK
+ YY_BREAK
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
if (dax__adag_index_isset != 0) {FAIL("Multiple definition of attribute index in <dax__adag>");} dax__adag_index_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_index);
- YY_BREAK
+ YY_BREAK
case 29:
/* rule 29 can match eol */
YY_RULE_SETUP
if (dax__adag_index_isset != 0) {FAIL("Multiple definition of attribute index in <dax__adag>");} dax__adag_index_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_index);
- YY_BREAK
+ YY_BREAK
case 30:
/* rule 30 can match eol */
YY_RULE_SETUP
if (dax__adag_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__adag>");} dax__adag_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_name);
- YY_BREAK
+ YY_BREAK
case 31:
/* rule 31 can match eol */
YY_RULE_SETUP
if (dax__adag_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__adag>");} dax__adag_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_name);
- YY_BREAK
+ YY_BREAK
case 32:
/* rule 32 can match eol */
YY_RULE_SETUP
if (dax__adag_jobCount_isset != 0) {FAIL("Multiple definition of attribute jobCount in <dax__adag>");} dax__adag_jobCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_jobCount);
- YY_BREAK
+ YY_BREAK
case 33:
/* rule 33 can match eol */
YY_RULE_SETUP
if (dax__adag_jobCount_isset != 0) {FAIL("Multiple definition of attribute jobCount in <dax__adag>");} dax__adag_jobCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_jobCount);
- YY_BREAK
+ YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
if (dax__adag_fileCount_isset != 0) {FAIL("Multiple definition of attribute fileCount in <dax__adag>");} dax__adag_fileCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_fileCount);
- YY_BREAK
+ YY_BREAK
case 35:
/* rule 35 can match eol */
YY_RULE_SETUP
if (dax__adag_fileCount_isset != 0) {FAIL("Multiple definition of attribute fileCount in <dax__adag>");} dax__adag_fileCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_fileCount);
- YY_BREAK
+ YY_BREAK
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
if (dax__adag_childCount_isset != 0) {FAIL("Multiple definition of attribute childCount in <dax__adag>");} dax__adag_childCount_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__adag_childCount);
- YY_BREAK
+ YY_BREAK
case 37:
/* rule 37 can match eol */
YY_RULE_SETUP
if (dax__adag_childCount_isset != 0) {FAIL("Multiple definition of attribute childCount in <dax__adag>");} dax__adag_childCount_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__adag_childCount);
- YY_BREAK
+ YY_BREAK
case 38:
YY_RULE_SETUP
{
LEAVE; STag_dax__adag();dax__pcdata_ix = 0; ENTER(S_dax__adag);
}
- YY_BREAK
+ YY_BREAK
case 39:
YY_RULE_SETUP
{
case ROOT_dax__adag: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 40:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of adag element.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 41:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `adag' element start tag.",dax_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_dax__adag):
FAIL("EOF in attribute list of `adag' element.");
- YY_BREAK
+ YY_BREAK
case 42:
/* rule 42 can match eol */
case ROOT_dax__adag: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 43:
/* rule 43 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</adag>' expected.",dax_text);
- YY_BREAK
+ YY_BREAK
case 44:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</adag>' expected.",dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_dax__adag_1):
case YY_STATE_EOF(S_dax__adag_5):
case YY_STATE_EOF(E_dax__adag):
case YY_STATE_EOF(S_dax__adag_3):
case YY_STATE_EOF(S_dax__adag):
FAIL("Premature EOF: `</adag>' expected.");
- YY_BREAK
+ YY_BREAK
case 45:
/* rule 45 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <job> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 46:
/* rule 46 can match eol */
YY_RULE_SETUP
dax__job_level_isset = 0;
ENTER(AL_dax__job); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 47:
/* rule 47 can match eol */
YY_RULE_SETUP
if (dax__job_id_isset != 0) {FAIL("Multiple definition of attribute id in <dax__job>");} dax__job_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_id);
- YY_BREAK
+ YY_BREAK
case 48:
/* rule 48 can match eol */
YY_RULE_SETUP
if (dax__job_id_isset != 0) {FAIL("Multiple definition of attribute id in <dax__job>");} dax__job_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_id);
- YY_BREAK
+ YY_BREAK
case 49:
/* rule 49 can match eol */
YY_RULE_SETUP
if (dax__job_namespace_isset != 0) {FAIL("Multiple definition of attribute namespace in <dax__job>");} dax__job_namespace_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_namespace);
- YY_BREAK
+ YY_BREAK
case 50:
/* rule 50 can match eol */
YY_RULE_SETUP
if (dax__job_namespace_isset != 0) {FAIL("Multiple definition of attribute namespace in <dax__job>");} dax__job_namespace_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_namespace);
- YY_BREAK
+ YY_BREAK
case 51:
/* rule 51 can match eol */
YY_RULE_SETUP
if (dax__job_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__job>");} dax__job_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_name);
- YY_BREAK
+ YY_BREAK
case 52:
/* rule 52 can match eol */
YY_RULE_SETUP
if (dax__job_name_isset != 0) {FAIL("Multiple definition of attribute name in <dax__job>");} dax__job_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_name);
- YY_BREAK
+ YY_BREAK
case 53:
/* rule 53 can match eol */
YY_RULE_SETUP
if (dax__job_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__job>");} dax__job_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_version);
- YY_BREAK
+ YY_BREAK
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
if (dax__job_version_isset != 0) {FAIL("Multiple definition of attribute version in <dax__job>");} dax__job_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_version);
- YY_BREAK
+ YY_BREAK
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
if (dax__job_runtime_isset != 0) {FAIL("Multiple definition of attribute runtime in <dax__job>");} dax__job_runtime_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_runtime);
- YY_BREAK
+ YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
if (dax__job_runtime_isset != 0) {FAIL("Multiple definition of attribute runtime in <dax__job>");} dax__job_runtime_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_runtime);
- YY_BREAK
+ YY_BREAK
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
if (dax__job_level_isset != 0) {FAIL("Multiple definition of attribute level in <dax__job>");} dax__job_level_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__job_level);
- YY_BREAK
+ YY_BREAK
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
if (dax__job_level_isset != 0) {FAIL("Multiple definition of attribute level in <dax__job>");} dax__job_level_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__job_level);
- YY_BREAK
+ YY_BREAK
case 59:
YY_RULE_SETUP
{
if (!AX_dax__job_runtime) FAIL("Required attribute `runtime' not set for `job' element.");
LEAVE; STag_dax__job();dax__pcdata_ix = 0; ENTER(S_dax__job);
}
- YY_BREAK
+ YY_BREAK
case 60:
YY_RULE_SETUP
{
case S_dax__adag_2: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 61:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of job element.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 62:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `job' element start tag.",dax_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_dax__job):
FAIL("EOF in attribute list of `job' element.");
- YY_BREAK
+ YY_BREAK
case 63:
/* rule 63 can match eol */
case S_dax__adag_2: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</job>' expected.",dax_text);
- YY_BREAK
+ YY_BREAK
case 65:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</job>' expected.",dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_dax__job):
case YY_STATE_EOF(E_dax__job):
case YY_STATE_EOF(S_dax__job_2):
FAIL("Premature EOF: `</job>' expected.");
- YY_BREAK
+ YY_BREAK
/* <!-- ignored -->
* <!-- ignored --> */
/* rule 66 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <uses> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
dax__uses_size_isset = 0;
ENTER(AL_dax__uses); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 68:
/* rule 68 can match eol */
YY_RULE_SETUP
if (dax__uses_file_isset != 0) {FAIL("Multiple definition of attribute file in <dax__uses>");} dax__uses_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_file);
- YY_BREAK
+ YY_BREAK
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
if (dax__uses_file_isset != 0) {FAIL("Multiple definition of attribute file in <dax__uses>");} dax__uses_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_file);
- YY_BREAK
+ YY_BREAK
case 70:
/* rule 70 can match eol */
case 71:
/* rule 71 can match eol */
YY_RULE_SETUP
A_dax__uses_link = A_dax__uses_link_input;
- YY_BREAK
+ YY_BREAK
case 72:
/* rule 72 can match eol */
case 73:
/* rule 73 can match eol */
YY_RULE_SETUP
A_dax__uses_link = A_dax__uses_link_output;
- YY_BREAK
+ YY_BREAK
case 74:
/* rule 74 can match eol */
case 75:
/* rule 75 can match eol */
YY_RULE_SETUP
A_dax__uses_register = A_dax__uses_register_false;
- YY_BREAK
+ YY_BREAK
case 76:
/* rule 76 can match eol */
case 77:
/* rule 77 can match eol */
YY_RULE_SETUP
A_dax__uses_register = A_dax__uses_register_true;
- YY_BREAK
+ YY_BREAK
case 78:
/* rule 78 can match eol */
case 79:
/* rule 79 can match eol */
YY_RULE_SETUP
A_dax__uses_transfer = A_dax__uses_transfer_false;
- YY_BREAK
+ YY_BREAK
case 80:
/* rule 80 can match eol */
case 81:
/* rule 81 can match eol */
YY_RULE_SETUP
A_dax__uses_transfer = A_dax__uses_transfer_true;
- YY_BREAK
+ YY_BREAK
case 82:
/* rule 82 can match eol */
case 83:
/* rule 83 can match eol */
YY_RULE_SETUP
A_dax__uses_optional = A_dax__uses_optional_false;
- YY_BREAK
+ YY_BREAK
case 84:
/* rule 84 can match eol */
case 85:
/* rule 85 can match eol */
YY_RULE_SETUP
A_dax__uses_optional = A_dax__uses_optional_true;
- YY_BREAK
+ YY_BREAK
case 86:
/* rule 86 can match eol */
YY_RULE_SETUP
if (dax__uses_type_isset != 0) {FAIL("Multiple definition of attribute type in <dax__uses>");} dax__uses_type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_type);
- YY_BREAK
+ YY_BREAK
case 87:
/* rule 87 can match eol */
YY_RULE_SETUP
if (dax__uses_type_isset != 0) {FAIL("Multiple definition of attribute type in <dax__uses>");} dax__uses_type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_type);
- YY_BREAK
+ YY_BREAK
case 88:
/* rule 88 can match eol */
YY_RULE_SETUP
if (dax__uses_size_isset != 0) {FAIL("Multiple definition of attribute size in <dax__uses>");} dax__uses_size_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__uses_size);
- YY_BREAK
+ YY_BREAK
case 89:
/* rule 89 can match eol */
YY_RULE_SETUP
if (dax__uses_size_isset != 0) {FAIL("Multiple definition of attribute size in <dax__uses>");} dax__uses_size_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__uses_size);
- YY_BREAK
+ YY_BREAK
case 90:
YY_RULE_SETUP
{
if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element.");
LEAVE; STag_dax__uses();dax__pcdata_ix = 0; ENTER(E_dax__uses);
}
- YY_BREAK
+ YY_BREAK
case 91:
YY_RULE_SETUP
{
case S_dax__job: case S_dax__job_2: case S_dax__job_1: SET(S_dax__job_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 92:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of uses element.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 93:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `uses' element start tag.",dax_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_dax__uses):
FAIL("EOF in attribute list of `uses' element.");
- YY_BREAK
+ YY_BREAK
case 94:
/* rule 94 can match eol */
case S_dax__job: case S_dax__job_2: case S_dax__job_1: SET(S_dax__job_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 95:
/* rule 95 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</uses>' expected.",dax_text);
- YY_BREAK
+ YY_BREAK
case 96:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</uses>' expected.",dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_dax__uses):
FAIL("Premature EOF: `</uses>' expected.");
- YY_BREAK
+ YY_BREAK
case 97:
/* rule 97 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <child> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 98:
/* rule 98 can match eol */
YY_RULE_SETUP
dax__child_ref_isset = 0;
ENTER(AL_dax__child); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 99:
/* rule 99 can match eol */
YY_RULE_SETUP
if (dax__child_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__child>");} dax__child_ref_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__child_ref);
- YY_BREAK
+ YY_BREAK
case 100:
/* rule 100 can match eol */
YY_RULE_SETUP
if (dax__child_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__child>");} dax__child_ref_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__child_ref);
- YY_BREAK
+ YY_BREAK
case 101:
YY_RULE_SETUP
{
if (!AX_dax__child_ref) FAIL("Required attribute `ref' not set for `child' element.");
LEAVE; STag_dax__child();dax__pcdata_ix = 0; ENTER(S_dax__child);
}
- YY_BREAK
+ YY_BREAK
case 102:
YY_RULE_SETUP
{
case S_dax__adag_1: case S_dax__adag_4: case S_dax__adag_5: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_5); break;
}
}
- YY_BREAK
+ YY_BREAK
case 103:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of child element.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 104:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `child' element start tag.",dax_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_dax__child):
FAIL("EOF in attribute list of `child' element.");
- YY_BREAK
+ YY_BREAK
case 105:
/* rule 105 can match eol */
case S_dax__adag_1: case S_dax__adag_4: case S_dax__adag_5: case S_dax__adag_3: case S_dax__adag: SET(S_dax__adag_5); break;
}
}
- YY_BREAK
+ YY_BREAK
case 106:
/* rule 106 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</child>' expected.",dax_text);
- YY_BREAK
+ YY_BREAK
case 107:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</child>' expected.",dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_dax__child_2):
case YY_STATE_EOF(E_dax__child):
case YY_STATE_EOF(S_dax__child):
FAIL("Premature EOF: `</child>' expected.");
- YY_BREAK
+ YY_BREAK
case 108:
/* rule 108 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <parent> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 109:
/* rule 109 can match eol */
YY_RULE_SETUP
dax__parent_ref_isset = 0;
ENTER(AL_dax__parent); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 110:
/* rule 110 can match eol */
YY_RULE_SETUP
if (dax__parent_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__parent>");} dax__parent_ref_isset = 1; ENTER(VALUE1); BUFFERSET(AX_dax__parent_ref);
- YY_BREAK
+ YY_BREAK
case 111:
/* rule 111 can match eol */
YY_RULE_SETUP
if (dax__parent_ref_isset != 0) {FAIL("Multiple definition of attribute ref in <dax__parent>");} dax__parent_ref_isset = 1; ENTER(VALUE2); BUFFERSET(AX_dax__parent_ref);
- YY_BREAK
+ YY_BREAK
case 112:
YY_RULE_SETUP
{
if (!AX_dax__parent_ref) FAIL("Required attribute `ref' not set for `parent' element.");
LEAVE; STag_dax__parent();dax__pcdata_ix = 0; ENTER(E_dax__parent);
}
- YY_BREAK
+ YY_BREAK
case 113:
YY_RULE_SETUP
{
case S_dax__child_2: case S_dax__child: case S_dax__child_1: SET(S_dax__child_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 114:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of parent element.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 115:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `parent' element start tag.",dax_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_dax__parent):
FAIL("EOF in attribute list of `parent' element.");
- YY_BREAK
+ YY_BREAK
case 116:
/* rule 116 can match eol */
case S_dax__child_2: case S_dax__child: case S_dax__child_1: SET(S_dax__child_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 117:
/* rule 117 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</parent>' expected.",dax_text);
- YY_BREAK
+ YY_BREAK
case 118:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</parent>' expected.",dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_dax__parent):
FAIL("Premature EOF: `</parent>' expected.");
- YY_BREAK
+ YY_BREAK
/* EPILOG: after the root element. */
case 119:
YY_RULE_SETUP
{SET(PROLOG); yyless(0); CLEANUP; return -1;}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(EPILOG):
SUCCEED;
- YY_BREAK
+ YY_BREAK
/* CHARACTER DATA. */
case 120:
YY_RULE_SETUP
BUFFERPUTC('&');
- YY_BREAK
+ YY_BREAK
case 121:
YY_RULE_SETUP
BUFFERPUTC('<');
- YY_BREAK
+ YY_BREAK
case 122:
YY_RULE_SETUP
BUFFERPUTC('>');
- YY_BREAK
+ YY_BREAK
case 123:
YY_RULE_SETUP
BUFFERPUTC('\'');
- YY_BREAK
+ YY_BREAK
case 124:
YY_RULE_SETUP
BUFFERPUTC('"');
- YY_BREAK
+ YY_BREAK
/* Character entities. */
case 125:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)atoi(dax_text+2));
- YY_BREAK
+ YY_BREAK
case 126:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)strtol(dax_text+3,NULL,16));
- YY_BREAK
+ YY_BREAK
case 127:
/* rule 127 can match eol */
/* rule 130 can match eol */
YY_RULE_SETUP
BUFFERPUTC('\n');
- YY_BREAK
+ YY_BREAK
case 131:
YY_RULE_SETUP
ENTER(CDATA);
- YY_BREAK
+ YY_BREAK
case 132:
YY_RULE_SETUP
FAIL("Unexpected `]""]>' in character data.");
- YY_BREAK
+ YY_BREAK
case 133:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE1):
FAIL("EOF in literal (\"'\" expected).");
- YY_BREAK
+ YY_BREAK
case 134:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE2):
FAIL("EOF in literal (`\"' expected).");
- YY_BREAK
+ YY_BREAK
case 135:
/* rule 135 can match eol */
YY_RULE_SETUP
BUFFERPUTC(dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 136:
YY_RULE_SETUP
FAIL("Spurious `%c' in character data.",dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 137:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
-/* "]""]" BUFFERPUTC(dax_text[0]); BUFFERPUTC(dax_text[1]); */
+ YY_BREAK
+/* "]""]" BUFFERPUTC(dax_text[0]); BUFFERPUTC(dax_text[1]); */
case 138:
YY_RULE_SETUP
BUFFERPUTC(dax_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(CDATA):
FAIL("EOF in CDATA section.");
- YY_BREAK
+ YY_BREAK
/* Impossible rules to avoid warnings from flex(1). */
/* Ideally, this should be replaced by code in flexml.pl that
/* rule 139 can match eol */
YY_RULE_SETUP
FAIL("Syntax error on character `%c'.", dax_text[0]);
- YY_BREAK
+ YY_BREAK
case 140:
YY_RULE_SETUP
ECHO;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(ROOT_dax__adag):
case YY_STATE_EOF(S_dax__adag_2):
case YY_STATE_EOF(S_dax__job_1):
case YY_STATE_EOF(S_dax__child_1):
case YY_STATE_EOF(IMPOSSIBLE):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed dax_in at a new source and called
- * dax_lex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = dax_in;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( dax_wrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * dax_text, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed dax_in at a new source and called
+ * dax_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = dax_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( dax_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * dax_text, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
} /* end of dax_lex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- dax_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- dax_restart(dax_in );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ dax_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- return ret_val;
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ dax_restart(dax_in );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) dax_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 775 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 775 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
- * next_state = yy_try_NUL_trans( current_state );
+ * next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 775 )
- 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 == 774);
-
- return yy_is_jam ? 0 : yy_current_state;
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 775 )
+ 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 == 774);
+
+ return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
#endif
{
- int c;
+ int c;
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- dax_restart(dax_in );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( dax_wrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ dax_restart(dax_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( dax_wrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput();
#else
- return input();
+ return input();
#endif
- }
+ }
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve dax_text */
- (yy_hold_char) = *++(yy_c_buf_p);
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve dax_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
- if ( c == '\n' )
-
+ if ( c == '\n' )
+
dax_lineno++;
;
- return c;
+ return c;
}
-#endif /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
void dax_restart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
dax_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
dax__create_buffer(dax_in,YY_BUF_SIZE );
- }
+ }
- dax__init_buffer(YY_CURRENT_BUFFER,input_file );
- dax__load_buffer_state( );
+ dax__init_buffer(YY_CURRENT_BUFFER,input_file );
+ dax__load_buffer_state( );
}
/** Switch to a different input buffer.
void dax__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * dax_pop_buffer_state();
- * dax_push_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * dax_pop_buffer_state();
+ * dax_push_buffer_state(new_buffer);
*/
- dax_ensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- dax__load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (dax_wrap()) processing, but the only time this flag
- * is looked at is after dax_wrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ dax_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ dax__load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (dax_wrap()) processing, but the only time this flag
+ * is looked at is after dax_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
}
static void dax__load_buffer_state (void)
{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- dax_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ dax_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
*/
YY_BUFFER_STATE dax__create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
+ b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = size;
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) dax_alloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) dax_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in dax__create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- dax__init_buffer(b,file );
+ dax__init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void dax__delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- dax_free((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ dax_free((void *) b->yy_ch_buf );
- dax_free((void *) b );
+ dax_free((void *) b );
}
#ifndef __cplusplus
static void dax__init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- dax__flush_buffer(b );
+ dax__flush_buffer(b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
/* If b is the current buffer, then dax__init_buffer was _probably_
* called from dax_restart() or through yy_get_next_buffer.
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- errno = oerrno;
+ errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
*/
void dax__flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- b->yy_n_chars = 0;
+ b->yy_n_chars = 0;
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == YY_CURRENT_BUFFER )
- dax__load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ dax__load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void dax_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
+ if (new_buffer == NULL)
+ return;
- dax_ensure_buffer_stack();
+ dax_ensure_buffer_stack();
- /* This block is copied from dax__switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
+ /* This block is copied from dax__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from dax__switch_to_buffer. */
- dax__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ /* copied from dax__switch_to_buffer. */
+ dax__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void dax_pop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
+ if (!YY_CURRENT_BUFFER)
+ return;
- dax__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
+ dax__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
- if (YY_CURRENT_BUFFER) {
- dax__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (YY_CURRENT_BUFFER) {
+ dax__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void dax_ensure_buffer_stack (void)
{
- int num_to_alloc;
+ int num_to_alloc;
- if (!(yy_buffer_stack)) {
+ if (!(yy_buffer_stack)) {
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)dax_alloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)dax_realloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)dax_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)dax_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in dax_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
*/
YY_BUFFER_STATE dax__scan_buffer (char * base, yy_size_t size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in dax__scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- dax__switch_to_buffer(b );
-
- return b;
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) dax_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in dax__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ dax__switch_to_buffer(b );
+
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to dax_lex() will
YY_BUFFER_STATE dax__scan_string (yyconst char * yystr )
{
- return dax__scan_bytes(yystr,strlen(yystr) );
+ return dax__scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to dax_lex() will
*/
YY_BUFFER_STATE dax__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) dax_alloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in dax__scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) dax_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in dax__scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = dax__scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in dax__scan_bytes()" );
+ b = dax__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in dax__scan_bytes()" );
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
- return b;
+ return b;
}
static void yy_push_state (int new_state )
{
- if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
- {
- yy_size_t new_size;
+ if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
+ {
+ yy_size_t new_size;
- (yy_start_stack_depth) += YY_START_STACK_INCR;
- new_size = (yy_start_stack_depth) * sizeof( int );
+ (yy_start_stack_depth) += YY_START_STACK_INCR;
+ new_size = (yy_start_stack_depth) * sizeof( int );
- if ( ! (yy_start_stack) )
- (yy_start_stack) = (int *) dax_alloc(new_size );
+ if ( ! (yy_start_stack) )
+ (yy_start_stack) = (int *) dax_alloc(new_size );
- else
- (yy_start_stack) = (int *) dax_realloc((void *) (yy_start_stack),new_size );
+ else
+ (yy_start_stack) = (int *) dax_realloc((void *) (yy_start_stack),new_size );
- if ( ! (yy_start_stack) )
- YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
- }
+ if ( ! (yy_start_stack) )
+ YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
+ }
- (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
+ (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
- BEGIN(new_state);
+ BEGIN(new_state);
}
static void yy_pop_state (void)
{
- if ( --(yy_start_stack_ptr) < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
+ if ( --(yy_start_stack_ptr) < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
- BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
+ BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
}
#ifndef YY_EXIT_FAILURE
static void yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up dax_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up dax_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- dax_text[dax_leng] = (yy_hold_char); \
- (yy_c_buf_p) = dax_text + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- dax_leng = yyless_macro_arg; \
- } \
- while ( 0 )
+ dax_text[dax_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = dax_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ dax_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
{
/* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- dax__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- dax_pop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ dax__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ dax_pop_buffer_state();
+ }
- /* Destroy the stack itself. */
- dax_free((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ dax_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
/* Destroy the start condition stack. */
dax_free((yy_start_stack) );
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
- return n;
+ return n;
}
#endif
void *dax_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *dax_realloc (void * ptr, yy_size_t size )
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
void dax_free (void * ptr )
{
- free( (char *) ptr ); /* see dax_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see dax_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
int dax__element_context(int i)
{
return (0<i && i<yy_start_stack_depth
- ? yy_start_stack[yy_start_stack_ptr - i]
- : 0);
+ ? yy_start_stack[yy_start_stack_ptr - i]
+ : 0);
}
#ifdef FLEX_DEBUG
static void debug_leave(void) {
if (dax__flex_debug) {
print_yy_stack("--LEAVE : ");
- print_dax__bufferstack();
+ print_dax__bufferstack();
}
yy_pop_state();
}
{
if (dax__statenames) {
free(dax__statenames);
- dax__statenames = NULL;
+ dax__statenames = NULL;
}
free(dax__bufferstack);
dax__bufferstack = NULL;
va_list ap; va_start(ap, fmt);
#ifdef FLEXML_yylineno
used = sprintf(flexml_err_msg,
- "Invalid XML (XML input line %d, state %d): ",
- dax_lineno, YY_START);
+ "Invalid XML (XML input line %d, state %d): ",
+ dax_lineno, YY_START);
#else
used = sprintf(flexml_err_msg,
- "Invalid XML (state %d): ",
- YY_START);
+ "Invalid XML (state %d): ",
+ YY_START);
#endif
chars_left = flexml_max_err_msg_size - used - 1;
vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
char *name;
int kind;
double amount;
- double alpha; /* used by typed parallel tasks */
+ double alpha; /* used by typed parallel tasks */
double remains;
double start_time;
double finish_time;
/* now let's create the SD wrappers for workstations and links */
xbt_lib_foreach(host_lib, cursor, name, surf_workstation){
- if(surf_workstation[SURF_WKS_LEVEL])
- __SD_workstation_create(surf_workstation[SURF_WKS_LEVEL], NULL);
+ if(surf_workstation[SURF_WKS_LEVEL])
+ __SD_workstation_create(surf_workstation[SURF_WKS_LEVEL], NULL);
}
xbt_lib_foreach(link_lib, cursor, name, surf_link) {
- if(surf_link[SURF_LINK_LEVEL])
+ if(surf_link[SURF_LINK_LEVEL])
__SD_link_create(surf_link[SURF_LINK_LEVEL], NULL);
}
if (xbt_swag_size(sd_global->done_task_set) < sd_global->task_number){
XBT_WARN("Simulation is finished but %d tasks are still not done",
(sd_global->task_number - xbt_swag_size(sd_global->done_task_set)));
- xbt_swag_foreach_safe (task, task_safe,sd_global->not_scheduled_task_set){
+ xbt_swag_foreach_safe (task, task_safe,sd_global->not_scheduled_task_set){
XBT_WARN("%s is in SD_NOT_SCHEDULED state", SD_task_get_name(task));
- }
- xbt_swag_foreach_safe (task, task_safe,sd_global->schedulable_task_set){
+ }
+ xbt_swag_foreach_safe (task, task_safe,sd_global->schedulable_task_set){
XBT_WARN("%s is in SD_SCHEDULABLE state", SD_task_get_name(task));
- }
- xbt_swag_foreach_safe (task, task_safe,sd_global->scheduled_task_set){
+ }
+ xbt_swag_foreach_safe (task, task_safe,sd_global->scheduled_task_set){
XBT_WARN("%s is in SD_SCHEDULED state", SD_task_get_name(task));
- }
+ }
}
}
i = 0;
xbt_lib_foreach(link_lib, cursor, key, data) {
- sd_global->link_list[i++] = (SD_link_t) data[SD_LINK_LEVEL];
+ sd_global->link_list[i++] = (SD_link_t) data[SD_LINK_LEVEL];
}
}
return sd_global->link_list;
{
xbt_assert(alpha < 1. && alpha >= 0.,
"Invalid parameter: alpha must be in [0.;1.[");
-
+
SD_task_t res = SD_task_create(name, data, amount);
res->alpha = alpha;
res->kind = SD_TASK_COMP_PAR_AMDAHL;
&& !__SD_task_is_scheduled_or_runnable(src) && !__SD_task_is_running(src))
THROWF(arg_error, 0,
"Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED or SD_RUNNABLE"
- " or SD_RUNNING",
+ " or SD_RUNNING",
SD_task_get_name(src));
if (!__SD_task_is_not_scheduled(dst) && !__SD_task_is_schedulable(dst)
for(i=0;i<ws_count;i++){
task->computation_amount[i] =
- (task->alpha + (1 - task->alpha)/ws_count) * task->amount;
+ (task->alpha + (1 - task->alpha)/ws_count) * task->amount;
}
}
}
if (task->kind == SD_TASK_COMP_PAR_AMDAHL) {
- XBT_VERB("Schedule computation task %s on %d hosts. It costs %.f flops on each host",
- SD_task_get_name(task),
- task->workstation_nb,
- task->computation_amount[0]);
+ XBT_VERB("Schedule computation task %s on %d hosts. It costs %.f flops on each host",
+ SD_task_get_name(task),
+ task->workstation_nb,
+ task->computation_amount[0]);
}
/* Iterate over all childs and parent being COMM_E2E to say where I am located (and start them if runnable) */
i = 0;
xbt_lib_foreach(host_lib, cursor, key, data) {
if(data[SD_HOST_LEVEL])
- sd_global->workstation_list[i++] = (SD_workstation_t) data[SD_HOST_LEVEL];
+ sd_global->workstation_list[i++] = (SD_workstation_t) data[SD_HOST_LEVEL];
}
}
return sd_global->workstation_list;
break;
case SD_WORKSTATION_SEQUENTIAL_ACCESS:
XBT_INFO(" - access mode: Exclusive");
- task = SD_workstation_get_current_task(ws);
- if(task)
- XBT_INFO(" current running task: %s",
- SD_task_get_name(task));
- else
- XBT_INFO(" no task running");
+ task = SD_workstation_get_current_task(ws);
+ if(task)
+ XBT_INFO(" current running task: %s",
+ SD_task_get_name(task));
+ else
+ XBT_INFO(" no task running");
break;
default:
- XBT_INFO(" - (unknown access mode)");
+ XBT_INFO(" - (unknown access mode)");
}
props = SD_workstation_get_properties(ws);
if (smx_context_factory_name == NULL) {
/* use the default factory */
- #ifdef HAVE_RAWCTX
- SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
- #elif CONTEXT_UCONTEXT
- SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
- #else
- SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
- #endif
+ #ifdef HAVE_RAWCTX
+ SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
+ #elif CONTEXT_UCONTEXT
+ SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
+ #else
+ SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
+ #endif
}
else if (!strcmp(smx_context_factory_name, "ucontext")) {
/* use ucontext */
#endif
}
else if (!strcmp(smx_context_factory_name, "thread")) {
- /* use os threads (either pthreads or windows ones) */
+ /* use os threads (either pthreads or windows ones) */
SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
}
else if (!strcmp(smx_context_factory_name, "raw")) {
- /* use raw contexts */
- SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
+ /* use raw contexts */
+ SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
}
else {
XBT_ERROR("Invalid context factory specified. Valid factories on this machine:");
*/
XBT_INLINE void SIMIX_context_set_nthreads(int nb_threads) {
- if (nb_threads<=0) {
+ if (nb_threads<=0) {
nb_threads = xbt_os_get_numcores();
XBT_INFO("Auto-setting contexts/nthreads to %d",nb_threads);
}
-
+
if (nb_threads > 1) {
#ifndef CONTEXT_THREADS
THROWF(arg_error, 0, "The thread factory cannot be run in parallel");
(*factory)->name = "smx_sysv_context_factory";
if (SIMIX_context_is_parallel()) {
-#ifdef CONTEXT_THREADS /* To use parallel ucontexts a thread pool is needed */
+#ifdef CONTEXT_THREADS /* To use parallel ucontexts a thread pool is needed */
int nthreads = SIMIX_context_get_nthreads();
sysv_parmap = xbt_parmap_new(nthreads, SIMIX_context_get_parallel_mode());
sysv_workers_stacks = xbt_new(ucontext_t, nthreads);
surf_parse_open(file);
TRY {
- parse_status = surf_parse();
- surf_parse_close();
- xbt_assert(!parse_status, "Parse error at %s:%d", file,surf_parse_lineno);
+ parse_status = surf_parse();
+ surf_parse_close();
+ xbt_assert(!parse_status, "Parse error at %s:%d", file,surf_parse_lineno);
} CATCH(e) {
- xbt_die("Unrecoverable error at %s:%d: %s",
+ xbt_die("Unrecoverable error at %s:%d: %s",
file, surf_parse_lineno, e.msg);
}
}
XBT_DEBUG("PARSE TIME: %lg", (end - start));
xbt_lib_foreach(host_lib, cursor, name, workstation) {
- if(workstation[SURF_WKS_LEVEL])
- SIMIX_host_create(name, workstation[SURF_WKS_LEVEL], NULL);
+ if(workstation[SURF_WKS_LEVEL])
+ SIMIX_host_create(name, workstation[SURF_WKS_LEVEL], NULL);
}
surf_presolve();
}
}
/**
- * \brief Set the date to execute a function
+ * \brief Set the date to execute a function
*
* Set the date to execute the function on the surf.
- * \param date Date to execute function
- * \param function Function to be executed
- * \param arg Parameters of the function
+ * \param date Date to execute function
+ * \param function Function to be executed
+ * \param arg Parameters of the function
*
*/
XBT_INLINE void SIMIX_timer_set(double date, void *function, void *arg)
void **host = NULL;
xbt_lib_foreach(host_lib, cursor, name, host){
- if(host[SIMIX_HOST_LEVEL])
+ if(host[SIMIX_HOST_LEVEL])
xbt_dict_set(host_dict,name,host[SIMIX_HOST_LEVEL], NULL);
}
return host_dict;
if (!MC_IS_ENABLED) {
action->execution.surf_exec =
surf_workstation_model->extension.workstation.execute(host->host,
- computation_amount);
+ computation_amount);
surf_workstation_model->action_data_set(action->execution.surf_exec, action);
surf_workstation_model->set_priority(action->execution.surf_exec, priority);
}
action->execution.surf_exec =
surf_workstation_model->extension.workstation.
execute_parallel_task(host_nb, workstation_list, computation_amount,
- communication_amount, rate);
+ communication_amount, rate);
surf_workstation_model->action_data_set(action->execution.surf_exec, action);
}
case SIMIX_DONE:
/* do nothing, action done */
- XBT_DEBUG("SIMIX_execution_finished: execution successful");
+ XBT_DEBUG("SIMIX_execution_finished: execution successful");
break;
case SIMIX_FAILED:
static smx_action_t SIMIX_comm_new(e_smx_comm_type_t type);
static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_action_t comm);
static smx_action_t SIMIX_rdv_get_comm(smx_rdv_t rdv, e_smx_comm_type_t type,
- int (*match_fun)(void *, void *,smx_action_t),
- void *user_data, smx_action_t my_action);
+ int (*match_fun)(void *, void *,smx_action_t),
+ void *user_data, smx_action_t my_action);
static void SIMIX_rdv_free(void *data);
void SIMIX_network_init(void)
/* If a link is failed, detect it immediately */
if (surf_workstation_model->action_state_get(action->comm.surf_comm) == SURF_ACTION_FAILED) {
XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
- SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
+ SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
action->state = SIMIX_LINK_FAILURE;
SIMIX_comm_destroy_internal_actions(action);
}
action->state = SIMIX_DST_HOST_FAILURE;
else if (action->comm.surf_comm &&
surf_workstation_model->action_state_get(action->comm.surf_comm) == SURF_ACTION_FAILED) {
- XBT_DEBUG("Puta madre. Surf says that the link broke");
+ XBT_DEBUG("Puta madre. Surf says that the link broke");
action->state = SIMIX_LINK_FAILURE;
} else
action->state = SIMIX_DONE;
XBT_VERB("Create context %s", (*process)->name);
(*process)->context = SIMIX_context_new(code, argc, argv,
- simix_global->cleanup_process_function, *process);
+ simix_global->cleanup_process_function, *process);
(*process)->running_ctx = xbt_new(xbt_running_ctx_t, 1);
XBT_RUNNING_CTX_INITIALIZE((*process)->running_ctx);
break;
case SIMIX_ACTION_SLEEP:
- SIMIX_process_sleep_destroy(process->waiting_action);
- break;
+ SIMIX_process_sleep_destroy(process->waiting_action);
+ break;
case SIMIX_ACTION_SYNCHRO:
- SIMIX_synchro_stop_waiting(process, &process->simcall);
- SIMIX_synchro_destroy(process->waiting_action);
- break;
+ SIMIX_synchro_stop_waiting(process, &process->simcall);
+ SIMIX_synchro_destroy(process->waiting_action);
+ break;
case SIMIX_ACTION_IO:
SIMIX_io_destroy(process->waiting_action);
}
void SIMIX_process_change_host(smx_process_t process,
- smx_host_t dest)
+ smx_host_t dest)
{
xbt_assert((process != NULL), "Invalid parameters");
xbt_swag_remove(process, process->smx_host->process_list);
*/
smx_process_t SIMIX_process_from_PID(int PID)
{
- smx_process_t proc;
- xbt_swag_foreach(proc, simix_global->process_list)
- {
- if(proc->pid == PID)
- return proc;
- }
- return NULL;
+ smx_process_t proc;
+ xbt_swag_foreach(proc, simix_global->process_list)
+ {
+ if(proc->pid == PID)
+ return proc;
+ }
+ return NULL;
}
/** @brief returns a dynar containg all currently existing processes */
xbt_running_ctx_t *SIMIX_process_get_running_context(void);
void SIMIX_process_exception_terminate(xbt_ex_t * e);
void SIMIX_pre_process_change_host(smx_process_t process,
- smx_host_t dest);
+ smx_host_t dest);
void SIMIX_process_change_host(smx_process_t process,
- smx_host_t dest);
+ smx_host_t dest);
void SIMIX_pre_process_change_host(smx_process_t process, smx_host_t host);
void SIMIX_pre_process_suspend(smx_simcall_t simcall);
smx_action_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
break;
case SIMCALL_HOST_GET_NAME:
- simcall->host_get_name.result = SIMIX_host_get_name(simcall->host_get_name.host);
+ simcall->host_get_name.result = SIMIX_host_get_name(simcall->host_get_name.host);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_HOST_GET_AVAILABLE_SPEED:
simcall->host_get_available_speed.result =
- SIMIX_host_get_available_speed(simcall->host_get_available_speed.host);
+ SIMIX_host_get_available_speed(simcall->host_get_available_speed.host);
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_HOST_GET_DATA:
- simcall->host_get_data.result = SIMIX_host_get_data(simcall->host_get_data.host);
+ simcall->host_get_data.result = SIMIX_host_get_data(simcall->host_get_data.host);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_HOST_EXECUTE:
simcall->host_execute.result = SIMIX_host_execute(
- simcall->host_execute.name,
- simcall->host_execute.host,
- simcall->host_execute.computation_amount,
- simcall->host_execute.priority);
+ simcall->host_execute.name,
+ simcall->host_execute.host,
+ simcall->host_execute.computation_amount,
+ simcall->host_execute.priority);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_HOST_PARALLEL_EXECUTE:
simcall->host_parallel_execute.result = SIMIX_host_parallel_execute(
- simcall->host_parallel_execute.name,
- simcall->host_parallel_execute.host_nb,
- simcall->host_parallel_execute.host_list,
- simcall->host_parallel_execute.computation_amount,
- simcall->host_parallel_execute.communication_amount,
- simcall->host_parallel_execute.amount,
- simcall->host_parallel_execute.rate);
+ simcall->host_parallel_execute.name,
+ simcall->host_parallel_execute.host_nb,
+ simcall->host_parallel_execute.host_list,
+ simcall->host_parallel_execute.computation_amount,
+ simcall->host_parallel_execute.communication_amount,
+ simcall->host_parallel_execute.amount,
+ simcall->host_parallel_execute.rate);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_HOST_EXECUTION_GET_STATE:
simcall->host_execution_get_state.result =
- SIMIX_host_execution_get_state(simcall->host_execution_get_state.execution);
+ SIMIX_host_execution_get_state(simcall->host_execution_get_state.execution);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_HOST_EXECUTION_SET_PRIORITY:
SIMIX_host_execution_set_priority(
- simcall->host_execution_set_priority.execution,
- simcall->host_execution_set_priority.priority);
+ simcall->host_execution_set_priority.execution,
+ simcall->host_execution_set_priority.priority);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_CREATE:
SIMIX_process_create(
simcall->process_create.process,
- simcall->process_create.name,
- simcall->process_create.code,
- simcall->process_create.data,
- simcall->process_create.hostname,
- simcall->process_create.kill_time,
- simcall->process_create.argc,
- simcall->process_create.argv,
- simcall->process_create.properties);
+ simcall->process_create.name,
+ simcall->process_create.code,
+ simcall->process_create.data,
+ simcall->process_create.hostname,
+ simcall->process_create.kill_time,
+ simcall->process_create.argc,
+ simcall->process_create.argv,
+ simcall->process_create.properties);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_CHANGE_HOST:
SIMIX_pre_process_change_host(
- simcall->process_change_host.process,
- simcall->process_change_host.dest);
+ simcall->process_change_host.process,
+ simcall->process_change_host.dest);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_SET_DATA:
SIMIX_process_set_data(
- simcall->process_set_data.process,
- simcall->process_set_data.data);
+ simcall->process_set_data.process,
+ simcall->process_set_data.data);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_MUTEX_TRYLOCK:
simcall->mutex_trylock.result =
- SIMIX_mutex_trylock(simcall->mutex_trylock.mutex, simcall->issuer);
+ SIMIX_mutex_trylock(simcall->mutex_trylock.mutex, simcall->issuer);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_SEM_WOULD_BLOCK:
simcall->sem_would_block.result =
- SIMIX_sem_would_block(simcall->sem_would_block.sem);
+ SIMIX_sem_would_block(simcall->sem_would_block.sem);
SIMIX_simcall_answer(simcall);
break;
{
XBT_IN("(%p, %p)",mutex,issuer);
if (mutex->locked){
- XBT_OUT();
- return 0;
+ XBT_OUT();
+ return 0;
}
mutex->locked = 1;
/* If the mutex is not owned by the issuer do nothing */
if (issuer != mutex->owner){
- XBT_OUT();
- return;
+ XBT_OUT();
+ return;
}
if (xbt_swag_size(mutex->sleeping) > 0) {
xbt_assert(isfinite(computation_amount[i]), "computation_amount[%d] is not finite!", i);
for (j = 0 ; j < host_nb ; ++j) {
xbt_assert(isfinite(communication_amount[i + host_nb * j]),
- "communication_amount[%d+%d*%d] is not finite!", i, host_nb, j);
+ "communication_amount[%d+%d*%d] is not finite!", i, host_nb, j);
}
}
* to create the SIMIX action. It can raise a host_error exception if the
* host crashed. The default SIMIX name of the action is "sleep".
*
- * \param duration Time duration of the sleep.
- * \return A result telling whether the sleep was successful
+ * \param duration Time duration of the sleep.
+ * \return A result telling whether the sleep was successful
*/
e_smx_state_t simcall_process_sleep(double duration)
{
} else {
print_request("New send", request);
mailbox = smpi_process_remote_mailbox(
- smpi_group_index(smpi_comm_group(request->comm), request->dst));
+ smpi_group_index(smpi_comm_group(request->comm), request->dst));
// FIXME: SIMIX does not yet support non-contiguous datatypes
if (request->size < 64*1024 ) { // eager mode => detached send (FIXME: this limit should be configurable)
- void *oldbuf = request->buf;
- detached = 1;
- request->buf = malloc(request->size);
- memcpy(request->buf,oldbuf,request->size);
- XBT_DEBUG("Send request %p is detached; buf %p copied into %p",request,oldbuf,request->buf);
+ void *oldbuf = request->buf;
+ detached = 1;
+ request->buf = malloc(request->size);
+ memcpy(request->buf,oldbuf,request->size);
+ XBT_DEBUG("Send request %p is detached; buf %p copied into %p",request,oldbuf,request->buf);
} else {
- XBT_DEBUG("Send request %p is not detached (buf: %p)",request,request->buf);
+ XBT_DEBUG("Send request %p is not detached (buf: %p)",request,request->buf);
}
request->action =
- simcall_comm_isend(mailbox, request->size, -1.0,
- request->buf, request->size,
- &match_send,
- &smpi_mpi_request_free_voidp, // how to free the userdata if a detached send fails
- request,
- // detach if msg size < eager/rdv switch limit
- detached);
+ simcall_comm_isend(mailbox, request->size, -1.0,
+ request->buf, request->size,
+ &match_send,
+ &smpi_mpi_request_free_voidp, // how to free the userdata if a detached send fails
+ request,
+ // detach if msg size < eager/rdv switch limit
+ detached);
#ifdef HAVE_TRACING
/* FIXME: detached sends are not traceable (request->action == NULL) */
void smpi_mpi_startall(int count, MPI_Request * requests)
{
- int i;
+ int i;
for(i = 0; i < count; i++) {
smpi_mpi_start(requests[i]);
int flag;
if ((*request)->action == NULL)
- flag = 1;
+ flag = 1;
else
flag = simcall_comm_test((*request)->action);
if(flag) {
- smpi_mpi_wait(request, status);
- }
- return flag;
+ smpi_mpi_wait(request, status);
+ }
+ return flag;
}
int smpi_mpi_testany(int count, MPI_Request requests[], int *index,
xbt_cfg_get_double(_surf_cfg_set,
"smpi/running_power"));
} else {
- XBT_DEBUG("Real computation took %f while threshold is set to %f; ignore it",
- duration, xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold"));
+ XBT_DEBUG("Real computation took %f while threshold is set to %f; ignore it",
+ duration, xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold"));
}
}
srand(SMPI_RAND_SEED);
if(getenv("SMPI_PRETEND_CC") != NULL) {
- /* Hack to ensure that smpicc can pretend to be a simple compiler. Particularly handy to pass it to the configuration tools */
+ /* Hack to ensure that smpicc can pretend to be a simple compiler. Particularly handy to pass it to the configuration tools */
return 0;
}
* under the terms of the license (GNU LGPL) which comes with this package. */
/*
- commit: e2d6799c4182f00443b3013aadb1c2412372460f
- This commit retrieves the old implementation of CPU_TI with multi-levels.
+ commit: e2d6799c4182f00443b3013aadb1c2412372460f
+ This commit retrieves the old implementation of CPU_TI with multi-levels.
*/
#include "surf_private.h"
/**
* \brief Creates a new integration trace from a tmgr_trace_t
*
-* \param power_trace CPU availability trace
-* \param value Percentage of CPU power available (useful to fixed tracing)
-* \param spacing Initial spacing
-* \return Integration trace structure
+* \param power_trace CPU availability trace
+* \param value Percentage of CPU power available (useful to fixed tracing)
+* \param spacing Initial spacing
+* \return Integration trace structure
*/
static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace,
double value)
static void parse_cpu_ti_init(sg_platf_host_cbarg_t host)
{
cpu_ti_create_resource(host->id,
- host->power_peak,
- host->power_scale,
- host->power_trace,
- host->core_amount,
- host->initial_state,
- host->state_trace,
- host->properties);
+ host->power_peak,
+ host->power_scale,
+ host->power_trace,
+ host->core_amount,
+ host->initial_state,
+ host->state_trace,
+ host->properties);
}
/**
* \brief Update the remaining amount of actions
*
-* \param cpu Cpu on which the actions are running
-* \param now Current time
+* \param cpu Cpu on which the actions are running
+* \param now Current time
*/
static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now)
{
/**
* \brief Update the finish date of action if necessary
*
-* \param cpu Cpu on which the actions are running
-* \param now Current time
+* \param cpu Cpu on which the actions are running
+* \param now Current time
*/
static void cpu_ti_update_action_finish_date(cpu_ti_t cpu, double now)
{
/**
* \brief Auxiliary function to update the CPU power scale.
*
-* This function uses the trace structure to return the power scale at the determined time a.
-* \param trace Trace structure to search the updated power scale
-* \param a Time
+* This function uses the trace structure to return the power scale at the determined time a.
+* \param trace Trace structure to search the updated power scale
+* \param a Time
* \return CPU power scale
*/
static double surf_cpu_ti_get_power_scale(surf_cpu_ti_tgmr_t trace,
char *key;
xbt_lib_foreach(host_lib, cursor, key, cpu){
- if(cpu[SURF_CPU_LEVEL])
- {
- cpu_ti_t CPU = cpu[SURF_CPU_LEVEL];
- xbt_swag_free(CPU->action_set);
- surf_cpu_ti_free_tmgr(CPU->avail_trace);
- }
+ if(cpu[SURF_CPU_LEVEL])
+ {
+ cpu_ti_t CPU = cpu[SURF_CPU_LEVEL];
+ xbt_swag_free(CPU->action_set);
+ surf_cpu_ti_free_tmgr(CPU->avail_trace);
+ }
}
surf_model_exit(surf_cpu_model);
* the cyclic effect.
*
* \param trace Trace structure.
-* \param a Begin of interval
-* \param b End of interval
+* \param a Begin of interval
+* \param b End of interval
* \return the integrate value. -1 if an error occurs.
*/
static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace,
/**
* \brief Auxiliary function to calculate the integral between a and b.
- * It simply calculates the integral at point a and b and returns the difference
- * between them.
- * \param trace Trace structure
- * \param a Initial point
- * \param b Final point
- * \return Integral
+ * It simply calculates the integral at point a and b and returns the difference
+ * between them.
+ * \param trace Trace structure
+ * \param a Initial point
+ * \param b Final point
+ * \return Integral
*/
static double surf_cpu_ti_integrate_trace_simple(surf_cpu_ti_trace_t trace,
double a, double b)
/**
* \brief Auxiliary function to calculate the integral at point a.
- * \param trace Trace structure
- * \param a point
- * \return Integral
+ * \param trace Trace structure
+ * \param a point
+ * \return Integral
*/
static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t
trace, double a)
*
* Here, amount can span multiple trace periods
*
-* \param trace CPU trace structure
-* \param a Initial time
-* \param amount Amount to be executed
-* \return End time
+* \param trace CPU trace structure
+* \param a Initial time
+* \param amount Amount to be executed
+* \return End time
*/
static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
double amount)
/* Now solve for new_amount which is <= trace_total */
/*
- fprintf(stderr,"reduced_a = %.2f\n",reduced_a);
- fprintf(stderr,"reduced_amount = %.2f\n",reduced_amount);
+ fprintf(stderr,"reduced_a = %.2f\n",reduced_a);
+ fprintf(stderr,"reduced_amount = %.2f\n",reduced_amount);
*/
reduced_b =
surf_cpu_ti_solve_trace_somewhat_simple(trace, reduced_a,
amount_till_end =
surf_cpu_ti_integrate_trace(trace, a, trace->last_time);
/*
- fprintf(stderr,"amount_till_end=%.2f\n",amount_till_end);
+ fprintf(stderr,"amount_till_end=%.2f\n",amount_till_end);
*/
if (amount_till_end > amount) {
/**
* \brief Auxiliary function to solve integral.
- * It returns the date when the requested amount of flops is available
- * \param trace Trace structure
- * \param a Initial point
- * \param amount Amount of flops
+ * It returns the date when the requested amount of flops is available
+ * \param trace Trace structure
+ * \param a Initial point
+ * \param amount Amount of flops
* \return The date when amount is available.
*/
static double surf_cpu_ti_solve_trace_simple(surf_cpu_ti_trace_t trace,
/**
* \brief Binary search in array.
- * It returns the first point of the interval in which "a" is.
- * \param array Array
- * \param a Value to search
- * \param low Low bound to search in array
- * \param high Upper bound to search in array
+ * It returns the first point of the interval in which "a" is.
+ * \param array Array
+ * \param a Value to search
+ * \param low Low bound to search in array
+ * \param high Upper bound to search in array
* \return Index of point
*/
static int surf_cpu_ti_binary_search(double *array, double a, int low,
if (var->bound >= 0) {
XBT_DEBUG("Working on var (%p)", var);
var->new_mu = new_mu(var);
-/* dual_updated += (fabs(var->new_mu-var->mu)>dichotomy_min_error); */
-/* XBT_DEBUG("dual_updated (%d) : %1.20f",dual_updated,fabs(var->new_mu-var->mu)); */
+/* dual_updated += (fabs(var->new_mu-var->mu)>dichotomy_min_error); */
+/* XBT_DEBUG("dual_updated (%d) : %1.20f",dual_updated,fabs(var->new_mu-var->mu)); */
XBT_DEBUG("Updating mu : var->mu (%p) : %1.20f -> %1.20f", var,
var->mu, var->new_mu);
var->mu = var->new_mu;
min = middle;
overall_error = max_diff - middle_diff;
min_diff = middle_diff;
-/* SHOW_EXPR(overall_error); */
+/* SHOW_EXPR(overall_error); */
} else if (middle_diff > 0) {
XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing max");
max = middle;
overall_error = max_diff - middle_diff;
max_diff = middle_diff;
-/* SHOW_EXPR(overall_error); */
+/* SHOW_EXPR(overall_error); */
} else {
overall_error = 0;
-/* SHOW_EXPR(overall_error); */
+/* SHOW_EXPR(overall_error); */
}
} else if (min_diff == 0) {
max = min;
lmm_constraint_t cnst)
{
/* xbt_assert(xbt_swag_size(&(cnst->element_set)), */
-/* "This list should be empty!"); */
+/* "This list should be empty!"); */
make_constraint_inactive(sys, cnst);
free(cnst);
}
sprintf(print_buf, "%s(",(cnst->shared)?"":"max");
trace_buf =
xbt_realloc(trace_buf,
- strlen(trace_buf) + strlen(print_buf) + 1);
+ strlen(trace_buf) + strlen(print_buf) + 1);
strcat(trace_buf, print_buf);
xbt_swag_foreach(elem, elem_list) {
sprintf(print_buf, "%f.'%d'(%f) %s ", elem->value,
strlen(trace_buf) + strlen(print_buf) + 1);
strcat(trace_buf, print_buf);
if(cnst->shared)
- sum += elem->value * elem->variable->value;
+ sum += elem->value * elem->variable->value;
else
- sum = MAX(sum,elem->value * elem->variable->value);
+ sum = MAX(sum,elem->value * elem->variable->value);
}
sprintf(print_buf, "0) <= %f ('%d')", cnst->bound, cnst->id_int);
trace_buf =
link_count, name, lat, bw);
if (gtnets_add_link(link_count, bw, lat)) {
- xbt_die("Cannot create GTNetS link");
+ xbt_die("Cannot create GTNetS link");
}
gtnets_link->id = link_count;
if (link->policy == SURF_LINK_FULLDUPLEX)
{
- link_new(bprintf("%s_UP",link->id), link->bandwidth, link->latency, current_property_set);
- link_new(bprintf("%s_DOWN",link->id), link->bandwidth, link->latency, current_property_set);
+ link_new(bprintf("%s_UP",link->id), link->bandwidth, link->latency, current_property_set);
+ link_new(bprintf("%s_DOWN",link->id), link->bandwidth, link->latency, current_property_set);
}
else link_new(link->id, link->bandwidth, link->latency, current_property_set);
onelink->dst->id);
XBT_DEBUG("Calling one link route");
if(onelink->src->rc_type == SURF_NETWORK_ELEMENT_ROUTER){
- gtnets_add_router(onelink->src->id);
+ gtnets_add_router(onelink->src->id);
}
if(onelink->dst->rc_type == SURF_NETWORK_ELEMENT_ROUTER){
gtnets_add_router(onelink->dst->id);
replace_bdw_ns3(&bw);
ns3_add_cluster(bw,lat,cluster->id);
xbt_free(lat);
- xbt_free(bw);
+ xbt_free(bw);
}
static double ns3_get_link_latency (const void *link)
replace_bdw_ns3(&link_bdw);
((surf_ns3_link_t)link)->created = 0;
- // XBT_DEBUG("src (%s), dst (%s), src_id = %d, dst_id = %d",src,dst, src_id, dst_id);
+ // XBT_DEBUG("src (%s), dst (%s), src_id = %d, dst_id = %d",src,dst, src_id, dst_id);
XBT_DEBUG("\tLink (%s) bdw:%s lat:%s",((surf_ns3_link_t)link)->data->id,
link_bdw,
link_lat
static void free_ns3_host(void * elmts)
{
- ns3_nodes_t host = elmts;
- free(host);
+ ns3_nodes_t host = elmts;
+ free(host);
}
#ifdef HAVE_LATENCY_BOUND_TRACKING
#include "xbt/dict.h"
typedef struct ns3_link{
- char * id;
- char * lat;
- char * bdw;
+ char * id;
+ char * lat;
+ char * bdw;
}s_ns3_link_t, *ns3_link_t;
typedef struct surf_ns3_link{
- s_surf_resource_t generic_resource;
- ns3_link_t data;
- int created;
+ s_surf_resource_t generic_resource;
+ ns3_link_t data;
+ int created;
}s_surf_ns3_link_t, *surf_ns3_link_t;
typedef struct surf_action_network_ns3 {
#include "xbt/sysdep.h"
typedef enum {
- NS3_NETWORK_ELEMENT_NULL = 0, /* NULL */
- NS3_NETWORK_ELEMENT_HOST, /* host type */
- NS3_NETWORK_ELEMENT_ROUTER, /* router type */
- NS3_NETWORK_ELEMENT_AS, /* AS type */
+ NS3_NETWORK_ELEMENT_NULL = 0, /* NULL */
+ NS3_NETWORK_ELEMENT_HOST, /* host type */
+ NS3_NETWORK_ELEMENT_ROUTER, /* router type */
+ NS3_NETWORK_ELEMENT_AS, /* AS type */
} e_ns3_network_element_type_t;
typedef struct ns3_nodes{
- int node_num;
- e_ns3_network_element_type_t type;
- void * data;
+ int node_num;
+ e_ns3_network_element_type_t type;
+ void * data;
}s_ns3_nodes_t, *ns3_nodes_t;
#ifdef __cplusplus
XBT_PUBLIC(void *) ns3_add_router(const char * id);
XBT_PUBLIC(void *) ns3_add_AS(const char * id);
XBT_PUBLIC(void *) ns3_add_link(int src, e_ns3_network_element_type_t type_src,
- int dst, e_ns3_network_element_type_t type_dst,
- char * bw,char * lat);
+ int dst, e_ns3_network_element_type_t type_dst,
+ char * bw,char * lat);
XBT_PUBLIC(void *) ns3_end_platform(void);
XBT_PUBLIC(void *) ns3_add_cluster(char * bw,char * lat,const char *id);
#ifdef __cplusplus
#include "my-point-to-point-helper.h"
#ifdef _NS3_3_10
- /*NS3 3.10*/
- #include "ns3/helper-module.h"
- #include "ns3/simulator-module.h"
- #include "ns3/node-module.h"
- #include "ns3/helper-module.h"
- #include "ns3/global-routing-module.h"
- #include "ns3/tcp-socket-factory.h"
+ /*NS3 3.10*/
+ #include "ns3/helper-module.h"
+ #include "ns3/simulator-module.h"
+ #include "ns3/node-module.h"
+ #include "ns3/helper-module.h"
+ #include "ns3/global-routing-module.h"
+ #include "ns3/tcp-socket-factory.h"
#else
- /*NS3 3.12*/
- #include "ns3/node.h"
- #include "ns3/global-route-manager.h"
- #include "ns3/csma-helper.h"
- #include "ns3/internet-stack-helper.h"
- #include "ns3/ipv4-address-helper.h"
- #include "ns3/point-to-point-helper.h"
- #include "ns3/packet-sink-helper.h"
- #include "ns3/inet-socket-address.h"
- #include "ns3/tcp-socket-factory.h"
+ /*NS3 3.12*/
+ #include "ns3/node.h"
+ #include "ns3/global-route-manager.h"
+ #include "ns3/csma-helper.h"
+ #include "ns3/internet-stack-helper.h"
+ #include "ns3/ipv4-address-helper.h"
+ #include "ns3/point-to-point-helper.h"
+ #include "ns3/packet-sink-helper.h"
+ #include "ns3/inet-socket-address.h"
+ #include "ns3/tcp-socket-factory.h"
#endif
using namespace ns3;
private:
public:
- NS3Sim();
- ~NS3Sim();
- void create_flow_NS3(Ptr<Node> src,
- Ptr<Node> dst,
- uint16_t port_number,
- double start,
- const char *addr,
- uint32_t TotalBytes,
- void * action);
- void simulator_start(double min);
- void* get_action_from_socket(void *socket);
- double get_remains_from_socket(void *socket);
- double get_sent_from_socket(void *socket);
- char get_finished(void *socket);
+ NS3Sim();
+ ~NS3Sim();
+ void create_flow_NS3(Ptr<Node> src,
+ Ptr<Node> dst,
+ uint16_t port_number,
+ double start,
+ const char *addr,
+ uint32_t TotalBytes,
+ void * action);
+ void simulator_start(double min);
+ void* get_action_from_socket(void *socket);
+ double get_remains_from_socket(void *socket);
+ double get_sent_from_socket(void *socket);
+ char get_finished(void *socket);
};
#endif /* __cplusplus */
} ieee_nan;
};
-#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
+#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
double drand48(void);
case RAND:
return (double) rand_r((unsigned int *) seed) / RAND_MAX;
case RNGSTREAM :
- XBT_INFO("Seen RNGSTREAM");
- return 0.0;
+ XBT_INFO("Seen RNGSTREAM");
+ return 0.0;
default:
return drand48();
}
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
-#else /* ! __cplusplus */
+#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up surf_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up surf_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up surf_parse_text again */ \
- } \
- while ( 0 )
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up surf_parse_text again */ \
+ } \
+ while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
- int yy_buffer_status;
+ int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via surf_parse_restart()), so that the user can continue scanning by
- * just pointing surf_parse_in at a new input file.
- */
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via surf_parse_restart()), so that the user can continue scanning by
+ * just pointing surf_parse_in at a new input file.
+ */
#define YY_BUFFER_EOF_PENDING 2
- };
+ };
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
/* yy_hold_char holds the character lost when surf_parse_text is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
int surf_parse_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
/* Flag which is used to allow surf_parse_wrap()'s to do buffer switches
* instead of setting up a fresh surf_parse_in. A bit of a hack ...
#define yy_new_buffer surf_parse__create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
surf_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
surf_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
* corresponding action - sets up surf_parse_text.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- surf_parse_leng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp; \
+ surf_parse_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 476
#define YY_END_OF_BUFFER 477
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
static yyconst flex_int16_t yy_accept[2809] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* XML state. */
#ifdef FLEX_DEBUG
-# define ENTER(state) debug_enter(state,#state)
-# define LEAVE debug_leave()
-# define SET(state) debug_set(state,#state)
+# define ENTER(state) debug_enter(state,#state)
+# define LEAVE debug_leave()
+# define SET(state) debug_set(state,#state)
static void debug_enter(int, const char*);
static void debug_leave(void);
static void debug_set(int, const char*);
#else
-# define ENTER(state) (yy_push_state(state))
-# define LEAVE (yy_pop_state())
-# define SET(state) BEGIN(state)
+# define ENTER(state) (yy_push_state(state))
+# define LEAVE (yy_pop_state())
+# define SET(state) BEGIN(state)
#endif
/* Generic actions. */
-#define SKIP /*skip*/
+#define SKIP /*skip*/
#define SUCCEED CLEANUP; return 0
-#define FAIL return fail
+#define FAIL return fail
static int fail(const char*, ...);
enum {flexml_max_err_msg_size = 512};
static int ck_blimit()
{
if (bnext >= blimit) {
- blimit += FLEXML_BUFFERSTACKSIZE + 2;
- {
- char *temp = (char *) realloc(surfxml_bufferstack, blimit);
- assert(temp);
- surfxml_bufferstack = temp;
- }
+ blimit += FLEXML_BUFFERSTACKSIZE + 2;
+ {
+ char *temp = (char *) realloc(surfxml_bufferstack, blimit);
+ assert(temp);
+ surfxml_bufferstack = temp;
+ }
}
return 0;
}
static int ck_ilimit()
{
if (inext >= ilimit) {
- ilimit += FLEXML_INDEXSTACKSIZE + 2;
- {
- int *temp = (int *) realloc(indexstack, ilimit);
- assert(temp);
- indexstack = temp;
- }
+ ilimit += FLEXML_INDEXSTACKSIZE + 2;
+ {
+ int *temp = (int *) realloc(indexstack, ilimit);
+ assert(temp);
+ indexstack = temp;
+ }
}
return 0;
}
/* Miscellaneous. */
/* Parser states (flex `exclusive start conditions'):
*
- * PROLOG the XML prolog of the document before <?xml...>
- * DOCTYPE the XML prolog of the document after <?xml...>
- * EPILOG after the root element
- * INCOMMENT inside an XML comment <!--....-->
- * INPI inside an XML PI <?...?>
- * VALUE1 inside a '...'-delimited literal
- * VALUE2 inside a "..."-delimited literal
- * CDATA inside a <![CDATA[...] ]> section.
- * ROOT_<tag> expect root element <tag>
- * AL_<tag> inside the attribute list for <tag>
- * IN_<tag> inside a <tag> with element contents (ready for end tag)
- * IMPOSSIBLE dummy to permit disabling rules; must be last
+ * PROLOG the XML prolog of the document before <?xml...>
+ * DOCTYPE the XML prolog of the document after <?xml...>
+ * EPILOG after the root element
+ * INCOMMENT inside an XML comment <!--....-->
+ * INPI inside an XML PI <?...?>
+ * VALUE1 inside a '...'-delimited literal
+ * VALUE2 inside a "..."-delimited literal
+ * CDATA inside a <![CDATA[...] ]> section.
+ * ROOT_<tag> expect root element <tag>
+ * AL_<tag> inside the attribute list for <tag>
+ * IN_<tag> inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE dummy to permit disabling rules; must be last
*/
/* State names. */
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- size_t n; \
- for ( n = 0; n < max_size && \
- (c = getc( surf_parse_in )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( surf_parse_in ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, surf_parse_in))==0 && ferror(surf_parse_in)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(surf_parse_in); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( surf_parse_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( surf_parse_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, surf_parse_in))==0 && ferror(surf_parse_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(surf_parse_in); \
+ } \
+ }\
\
#endif
#endif
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG);
/* COMMENTS and PIs: handled uniformly for efficiency. */
- if ( !(yy_init) )
- {
- (yy_init) = 1;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
#ifdef YY_USER_INIT
- YY_USER_INIT;
+ YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! surf_parse_in )
- surf_parse_in = stdin;
+ if ( ! surf_parse_in )
+ surf_parse_in = stdin;
- if ( ! surf_parse_out )
- surf_parse_out = stdout;
+ if ( ! surf_parse_out )
+ surf_parse_out = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- surf_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ surf_parse_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE );
+ }
- surf_parse__load_buffer_state( );
- }
+ surf_parse__load_buffer_state( );
+ }
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
- /* Support of surf_parse_text. */
- *yy_cp = (yy_hold_char);
+ /* Support of surf_parse_text. */
+ *yy_cp = (yy_hold_char);
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = (yy_start);
yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 2809 )
- 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] != 10175 );
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 2809 )
+ 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] != 10175 );
yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
- if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
- {
- int yyl;
- for ( yyl = 0; yyl < surf_parse_leng; ++yyl )
- if ( surf_parse_text[yyl] == '\n' )
-
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+ {
+ int yyl;
+ for ( yyl = 0; yyl < surf_parse_leng; ++yyl )
+ if ( surf_parse_text[yyl] == '\n' )
+
surf_parse_lineno++;
;
- }
+ }
-do_action: /* This label is used only to access EOF actions. */
+do_action: /* This label is used only to access EOF actions. */
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
case 1:
YY_RULE_SETUP
ENTER(INCOMMENT);
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
ENTER(INPI);
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
+ YY_BREAK
case 4:
case 5:
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INCOMMENT):
FAIL("EOF in comment.");
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
+ YY_BREAK
case 8:
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INPI):
FAIL("EOF in PI (processing instruction).");
- YY_BREAK
+ YY_BREAK
/* SPACES: skipped uniformly */
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
/* PROLOG: determine root element and process it. */
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
SET(DOCTYPE);
- YY_BREAK
+ YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
FAIL("Bad declaration %s.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
SET(ROOT_surfxml_platform);
- YY_BREAK
+ YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
FAIL("Bad declaration %s.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in prolog.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(PROLOG):
case YY_STATE_EOF(DOCTYPE):
FAIL("EOF in prolog.");
- YY_BREAK
+ YY_BREAK
/* RULES DERIVED FROM DTD. */
/* <!-- Small DTD for SURF based tools. --> */
/* rule 16 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <platform> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
surfxml_platform_version_isset = 0;
ENTER(AL_surfxml_platform); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 18:
/* rule 18 can match eol */
YY_RULE_SETUP
if (surfxml_platform_version_isset != 0) {FAIL("Multiple definition of attribute version in <surfxml_platform>");} surfxml_platform_version_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_platform_version);
- YY_BREAK
+ YY_BREAK
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
if (surfxml_platform_version_isset != 0) {FAIL("Multiple definition of attribute version in <surfxml_platform>");} surfxml_platform_version_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_platform_version);
- YY_BREAK
+ YY_BREAK
case 20:
YY_RULE_SETUP
{
LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
}
- YY_BREAK
+ YY_BREAK
case 21:
YY_RULE_SETUP
{
case ROOT_surfxml_platform: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 22:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of platform element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 23:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `platform' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_platform):
FAIL("EOF in attribute list of `platform' element.");
- YY_BREAK
+ YY_BREAK
case 24:
/* rule 24 can match eol */
case ROOT_surfxml_platform: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 25:
/* rule 25 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</platform>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 26:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</platform>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_platform_8):
case YY_STATE_EOF(S_surfxml_platform_1):
case YY_STATE_EOF(S_surfxml_platform_3):
case YY_STATE_EOF(S_surfxml_platform_6):
case YY_STATE_EOF(E_surfxml_platform):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</platform>' expected.");
- YY_BREAK
+ YY_BREAK
case 27:
/* rule 27 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <include> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
surfxml_include_file_isset = 0;
ENTER(AL_surfxml_include); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 29:
/* rule 29 can match eol */
YY_RULE_SETUP
if (surfxml_include_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_include>");} surfxml_include_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_include_file);
- YY_BREAK
+ YY_BREAK
case 30:
/* rule 30 can match eol */
YY_RULE_SETUP
if (surfxml_include_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_include>");} surfxml_include_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_include_file);
- YY_BREAK
+ YY_BREAK
case 31:
YY_RULE_SETUP
{
if (!AX_surfxml_include_file) FAIL("Required attribute `file' not set for `include' element.");
LEAVE; STag_surfxml_include();surfxml_pcdata_ix = 0; ENTER(S_surfxml_include);
}
- YY_BREAK
+ YY_BREAK
case 32:
YY_RULE_SETUP
{
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 33:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of include element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 34:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `include' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_include):
FAIL("EOF in attribute list of `include' element.");
- YY_BREAK
+ YY_BREAK
case 35:
/* rule 35 can match eol */
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</include>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 37:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</include>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_include):
case YY_STATE_EOF(S_surfxml_include):
case YY_STATE_EOF(S_surfxml_include_2):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</include>' expected.");
- YY_BREAK
+ YY_BREAK
case 38:
/* rule 38 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <trace> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 39:
/* rule 39 can match eol */
YY_RULE_SETUP
surfxml_trace_periodicity_isset = 0;
ENTER(AL_surfxml_trace); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
if (surfxml_trace_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_trace>");} surfxml_trace_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_id);
- YY_BREAK
+ YY_BREAK
case 41:
/* rule 41 can match eol */
YY_RULE_SETUP
if (surfxml_trace_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_trace>");} surfxml_trace_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_id);
- YY_BREAK
+ YY_BREAK
case 42:
/* rule 42 can match eol */
YY_RULE_SETUP
if (surfxml_trace_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_trace>");} surfxml_trace_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_file);
- YY_BREAK
+ YY_BREAK
case 43:
/* rule 43 can match eol */
YY_RULE_SETUP
if (surfxml_trace_file_isset != 0) {FAIL("Multiple definition of attribute file in <surfxml_trace>");} surfxml_trace_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_file);
- YY_BREAK
+ YY_BREAK
case 44:
/* rule 44 can match eol */
YY_RULE_SETUP
if (surfxml_trace_periodicity_isset != 0) {FAIL("Multiple definition of attribute periodicity in <surfxml_trace>");} surfxml_trace_periodicity_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_periodicity);
- YY_BREAK
+ YY_BREAK
case 45:
/* rule 45 can match eol */
YY_RULE_SETUP
if (surfxml_trace_periodicity_isset != 0) {FAIL("Multiple definition of attribute periodicity in <surfxml_trace>");} surfxml_trace_periodicity_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_periodicity);
- YY_BREAK
+ YY_BREAK
case 46:
YY_RULE_SETUP
{
if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace);
}
- YY_BREAK
+ YY_BREAK
case 47:
YY_RULE_SETUP
{
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 48:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of trace element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 49:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `trace' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_trace):
FAIL("EOF in attribute list of `trace' element.");
- YY_BREAK
+ YY_BREAK
case 50:
/* rule 50 can match eol */
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 51:
/* rule 51 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</trace>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(IN_trace):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</trace>' expected.");
- YY_BREAK
+ YY_BREAK
case 52:
/* rule 52 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <random> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 53:
/* rule 53 can match eol */
YY_RULE_SETUP
surfxml_random_generator_isset = 0;
ENTER(AL_surfxml_random); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
if (surfxml_random_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_random>");} surfxml_random_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_id);
- YY_BREAK
+ YY_BREAK
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
if (surfxml_random_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_random>");} surfxml_random_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_id);
- YY_BREAK
+ YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
if (surfxml_random_min_isset != 0) {FAIL("Multiple definition of attribute min in <surfxml_random>");} surfxml_random_min_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_min);
- YY_BREAK
+ YY_BREAK
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
if (surfxml_random_min_isset != 0) {FAIL("Multiple definition of attribute min in <surfxml_random>");} surfxml_random_min_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_min);
- YY_BREAK
+ YY_BREAK
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
if (surfxml_random_max_isset != 0) {FAIL("Multiple definition of attribute max in <surfxml_random>");} surfxml_random_max_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_max);
- YY_BREAK
+ YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
if (surfxml_random_max_isset != 0) {FAIL("Multiple definition of attribute max in <surfxml_random>");} surfxml_random_max_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_max);
- YY_BREAK
+ YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
if (surfxml_random_mean_isset != 0) {FAIL("Multiple definition of attribute mean in <surfxml_random>");} surfxml_random_mean_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_mean);
- YY_BREAK
+ YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
if (surfxml_random_mean_isset != 0) {FAIL("Multiple definition of attribute mean in <surfxml_random>");} surfxml_random_mean_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_mean);
- YY_BREAK
+ YY_BREAK
case 62:
/* rule 62 can match eol */
YY_RULE_SETUP
if (surfxml_random_std_deviation_isset != 0) {FAIL("Multiple definition of attribute std_deviation in <surfxml_random>");} surfxml_random_std_deviation_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_std_deviation);
- YY_BREAK
+ YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
if (surfxml_random_std_deviation_isset != 0) {FAIL("Multiple definition of attribute std_deviation in <surfxml_random>");} surfxml_random_std_deviation_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_std_deviation);
- YY_BREAK
+ YY_BREAK
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
if (surfxml_random_seed_isset != 0) {FAIL("Multiple definition of attribute seed in <surfxml_random>");} surfxml_random_seed_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_seed);
- YY_BREAK
+ YY_BREAK
case 65:
/* rule 65 can match eol */
YY_RULE_SETUP
if (surfxml_random_seed_isset != 0) {FAIL("Multiple definition of attribute seed in <surfxml_random>");} surfxml_random_seed_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_seed);
- YY_BREAK
+ YY_BREAK
case 66:
/* rule 66 can match eol */
YY_RULE_SETUP
if (surfxml_random_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_random>");} surfxml_random_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_random_radical);
- YY_BREAK
+ YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
if (surfxml_random_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_random>");} surfxml_random_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_random_radical);
- YY_BREAK
+ YY_BREAK
case 68:
/* rule 68 can match eol */
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
A_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
- YY_BREAK
+ YY_BREAK
case 70:
/* rule 70 can match eol */
case 71:
/* rule 71 can match eol */
YY_RULE_SETUP
A_surfxml_random_generator = A_surfxml_random_generator_RAND;
- YY_BREAK
+ YY_BREAK
case 72:
/* rule 72 can match eol */
case 73:
/* rule 73 can match eol */
YY_RULE_SETUP
A_surfxml_random_generator = A_surfxml_random_generator_RNGSTREAM;
- YY_BREAK
+ YY_BREAK
case 74:
/* rule 74 can match eol */
case 75:
/* rule 75 can match eol */
YY_RULE_SETUP
A_surfxml_random_generator = A_surfxml_random_generator_NONE;
- YY_BREAK
+ YY_BREAK
case 76:
YY_RULE_SETUP
{
if (!AX_surfxml_random_std_deviation) FAIL("Required attribute `std_deviation' not set for `random' element.");
LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(S_surfxml_random);
}
- YY_BREAK
+ YY_BREAK
case 77:
YY_RULE_SETUP
{
case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 78:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of random element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 79:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `random' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_random):
FAIL("EOF in attribute list of `random' element.");
- YY_BREAK
+ YY_BREAK
case 80:
/* rule 80 can match eol */
case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 81:
/* rule 81 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</random>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 82:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</random>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_random):
case YY_STATE_EOF(S_surfxml_random_2):
case YY_STATE_EOF(E_surfxml_random):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</random>' expected.");
- YY_BREAK
+ YY_BREAK
case 83:
/* rule 83 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <trace_connect> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 84:
/* rule 84 can match eol */
YY_RULE_SETUP
surfxml_trace_connect_element_isset = 0;
ENTER(AL_surfxml_trace_connect); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 85:
/* rule 85 can match eol */
/* rule 86 can match eol */
YY_RULE_SETUP
A_surfxml_trace_connect_kind = A_surfxml_trace_connect_kind_HOST_AVAIL;
- YY_BREAK
+ YY_BREAK
case 87:
/* rule 87 can match eol */
case 88:
/* rule 88 can match eol */
YY_RULE_SETUP
A_surfxml_trace_connect_kind = A_surfxml_trace_connect_kind_POWER;
- YY_BREAK
+ YY_BREAK
case 89:
/* rule 89 can match eol */
case 90:
/* rule 90 can match eol */
YY_RULE_SETUP
A_surfxml_trace_connect_kind = A_surfxml_trace_connect_kind_LINK_AVAIL;
- YY_BREAK
+ YY_BREAK
case 91:
/* rule 91 can match eol */
case 92:
/* rule 92 can match eol */
YY_RULE_SETUP
A_surfxml_trace_connect_kind = A_surfxml_trace_connect_kind_BANDWIDTH;
- YY_BREAK
+ YY_BREAK
case 93:
/* rule 93 can match eol */
case 94:
/* rule 94 can match eol */
YY_RULE_SETUP
A_surfxml_trace_connect_kind = A_surfxml_trace_connect_kind_LATENCY;
- YY_BREAK
+ YY_BREAK
case 95:
/* rule 95 can match eol */
YY_RULE_SETUP
if (surfxml_trace_connect_trace_isset != 0) {FAIL("Multiple definition of attribute trace in <surfxml_trace_connect>");} surfxml_trace_connect_trace_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_connect_trace);
- YY_BREAK
+ YY_BREAK
case 96:
/* rule 96 can match eol */
YY_RULE_SETUP
if (surfxml_trace_connect_trace_isset != 0) {FAIL("Multiple definition of attribute trace in <surfxml_trace_connect>");} surfxml_trace_connect_trace_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_connect_trace);
- YY_BREAK
+ YY_BREAK
case 97:
/* rule 97 can match eol */
YY_RULE_SETUP
if (surfxml_trace_connect_element_isset != 0) {FAIL("Multiple definition of attribute element in <surfxml_trace_connect>");} surfxml_trace_connect_element_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_trace_connect_element);
- YY_BREAK
+ YY_BREAK
case 98:
/* rule 98 can match eol */
YY_RULE_SETUP
if (surfxml_trace_connect_element_isset != 0) {FAIL("Multiple definition of attribute element in <surfxml_trace_connect>");} surfxml_trace_connect_element_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_trace_connect_element);
- YY_BREAK
+ YY_BREAK
case 99:
YY_RULE_SETUP
{
if (!AX_surfxml_trace_connect_element) FAIL("Required attribute `element' not set for `trace_connect' element.");
LEAVE; STag_surfxml_trace_connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace_connect);
}
- YY_BREAK
+ YY_BREAK
case 100:
YY_RULE_SETUP
{
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 101:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of trace_connect element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 102:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `trace_connect' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_trace_connect):
FAIL("EOF in attribute list of `trace_connect' element.");
- YY_BREAK
+ YY_BREAK
case 103:
/* rule 103 can match eol */
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 104:
/* rule 104 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</trace_connect>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 105:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</trace_connect>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_trace_connect):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</trace_connect>' expected.");
- YY_BREAK
+ YY_BREAK
case 106:
/* rule 106 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <AS> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 107:
/* rule 107 can match eol */
YY_RULE_SETUP
surfxml_AS_routing_isset = 0;
ENTER(AL_surfxml_AS); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 108:
/* rule 108 can match eol */
YY_RULE_SETUP
if (surfxml_AS_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_AS>");} surfxml_AS_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_AS_id);
- YY_BREAK
+ YY_BREAK
case 109:
/* rule 109 can match eol */
YY_RULE_SETUP
if (surfxml_AS_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_AS>");} surfxml_AS_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_AS_id);
- YY_BREAK
+ YY_BREAK
case 110:
/* rule 110 can match eol */
YY_RULE_SETUP
if (surfxml_AS_routing_isset != 0) {FAIL("Multiple definition of attribute routing in <surfxml_AS>");} surfxml_AS_routing_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_AS_routing);
- YY_BREAK
+ YY_BREAK
case 111:
/* rule 111 can match eol */
YY_RULE_SETUP
if (surfxml_AS_routing_isset != 0) {FAIL("Multiple definition of attribute routing in <surfxml_AS>");} surfxml_AS_routing_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_AS_routing);
- YY_BREAK
+ YY_BREAK
case 112:
YY_RULE_SETUP
{
if (!AX_surfxml_AS_routing) FAIL("Required attribute `routing' not set for `AS' element.");
LEAVE; STag_surfxml_AS();surfxml_pcdata_ix = 0; ENTER(S_surfxml_AS);
}
- YY_BREAK
+ YY_BREAK
case 113:
YY_RULE_SETUP
{
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 114:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of AS element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 115:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `AS' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_AS):
FAIL("EOF in attribute list of `AS' element.");
- YY_BREAK
+ YY_BREAK
case 116:
/* rule 116 can match eol */
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 117:
/* rule 117 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</AS>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 118:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</AS>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_AS_9):
case YY_STATE_EOF(S_surfxml_AS_1):
case YY_STATE_EOF(S_surfxml_AS_11):
case YY_STATE_EOF(S_surfxml_AS):
case YY_STATE_EOF(S_surfxml_AS_4):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</AS>' expected.");
- YY_BREAK
+ YY_BREAK
case 119:
/* rule 119 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <storage_type> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 120:
/* rule 120 can match eol */
YY_RULE_SETUP
surfxml_storage_type_content_isset = 0;
ENTER(AL_surfxml_storage_type); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 121:
/* rule 121 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage_type>");} surfxml_storage_type_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_type_id);
- YY_BREAK
+ YY_BREAK
case 122:
/* rule 122 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage_type>");} surfxml_storage_type_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_type_id);
- YY_BREAK
+ YY_BREAK
case 123:
/* rule 123 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_model_isset != 0) {FAIL("Multiple definition of attribute model in <surfxml_storage_type>");} surfxml_storage_type_model_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_type_model);
- YY_BREAK
+ YY_BREAK
case 124:
/* rule 124 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_model_isset != 0) {FAIL("Multiple definition of attribute model in <surfxml_storage_type>");} surfxml_storage_type_model_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_type_model);
- YY_BREAK
+ YY_BREAK
case 125:
/* rule 125 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_size_isset != 0) {FAIL("Multiple definition of attribute size in <surfxml_storage_type>");} surfxml_storage_type_size_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_type_size);
- YY_BREAK
+ YY_BREAK
case 126:
/* rule 126 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_size_isset != 0) {FAIL("Multiple definition of attribute size in <surfxml_storage_type>");} surfxml_storage_type_size_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_type_size);
- YY_BREAK
+ YY_BREAK
case 127:
/* rule 127 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage_type>");} surfxml_storage_type_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_type_content);
- YY_BREAK
+ YY_BREAK
case 128:
/* rule 128 can match eol */
YY_RULE_SETUP
if (surfxml_storage_type_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage_type>");} surfxml_storage_type_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_type_content);
- YY_BREAK
+ YY_BREAK
case 129:
YY_RULE_SETUP
{
if (!AX_surfxml_storage_type_size) FAIL("Required attribute `size' not set for `storage_type' element.");
LEAVE; STag_surfxml_storage_type();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage_type);
}
- YY_BREAK
+ YY_BREAK
case 130:
YY_RULE_SETUP
{
case S_surfxml_AS_2: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 131:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of storage_type element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 132:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `storage_type' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_storage_type):
FAIL("EOF in attribute list of `storage_type' element.");
- YY_BREAK
+ YY_BREAK
case 133:
/* rule 133 can match eol */
case S_surfxml_AS_2: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 134:
/* rule 134 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</storage_type>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 135:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</storage_type>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_storage_type):
case YY_STATE_EOF(S_surfxml_storage_type_2):
case YY_STATE_EOF(S_surfxml_storage_type):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage_type>' expected.");
- YY_BREAK
+ YY_BREAK
case 136:
/* rule 136 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <storage> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 137:
/* rule 137 can match eol */
YY_RULE_SETUP
surfxml_storage_content_isset = 0;
ENTER(AL_surfxml_storage); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 138:
/* rule 138 can match eol */
YY_RULE_SETUP
if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");} surfxml_storage_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_id);
- YY_BREAK
+ YY_BREAK
case 139:
/* rule 139 can match eol */
YY_RULE_SETUP
if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");} surfxml_storage_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_id);
- YY_BREAK
+ YY_BREAK
case 140:
/* rule 140 can match eol */
YY_RULE_SETUP
if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");} surfxml_storage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_typeId);
- YY_BREAK
+ YY_BREAK
case 141:
/* rule 141 can match eol */
YY_RULE_SETUP
if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");} surfxml_storage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_typeId);
- YY_BREAK
+ YY_BREAK
case 142:
/* rule 142 can match eol */
YY_RULE_SETUP
if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");} surfxml_storage_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content);
- YY_BREAK
+ YY_BREAK
case 143:
/* rule 143 can match eol */
YY_RULE_SETUP
if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");} surfxml_storage_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content);
- YY_BREAK
+ YY_BREAK
case 144:
YY_RULE_SETUP
{
if (!AX_surfxml_storage_typeId) FAIL("Required attribute `typeId' not set for `storage' element.");
LEAVE; STag_surfxml_storage();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage);
}
- YY_BREAK
+ YY_BREAK
case 145:
YY_RULE_SETUP
{
case S_surfxml_AS_2: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 146:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of storage element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 147:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `storage' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_storage):
FAIL("EOF in attribute list of `storage' element.");
- YY_BREAK
+ YY_BREAK
case 148:
/* rule 148 can match eol */
case S_surfxml_AS_2: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 149:
/* rule 149 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</storage>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 150:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</storage>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_storage):
case YY_STATE_EOF(S_surfxml_storage):
case YY_STATE_EOF(S_surfxml_storage_2):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage>' expected.");
- YY_BREAK
+ YY_BREAK
case 151:
/* rule 151 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <mount> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 152:
/* rule 152 can match eol */
YY_RULE_SETUP
surfxml_mount_name_isset = 0;
ENTER(AL_surfxml_mount); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 153:
/* rule 153 can match eol */
YY_RULE_SETUP
if (surfxml_mount_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_mount>");} surfxml_mount_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_id);
- YY_BREAK
+ YY_BREAK
case 154:
/* rule 154 can match eol */
YY_RULE_SETUP
if (surfxml_mount_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_mount>");} surfxml_mount_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_id);
- YY_BREAK
+ YY_BREAK
case 155:
/* rule 155 can match eol */
YY_RULE_SETUP
if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");} surfxml_mount_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_name);
- YY_BREAK
+ YY_BREAK
case 156:
/* rule 156 can match eol */
YY_RULE_SETUP
if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");} surfxml_mount_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_name);
- YY_BREAK
+ YY_BREAK
case 157:
YY_RULE_SETUP
{
if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element.");
LEAVE; STag_surfxml_mount();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mount);
}
- YY_BREAK
+ YY_BREAK
case 158:
YY_RULE_SETUP
{
case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 159:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of mount element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 160:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `mount' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_mount):
FAIL("EOF in attribute list of `mount' element.");
- YY_BREAK
+ YY_BREAK
case 161:
/* rule 161 can match eol */
case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 162:
/* rule 162 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</mount>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 163:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</mount>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_mount):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</mount>' expected.");
- YY_BREAK
+ YY_BREAK
case 164:
/* rule 164 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <mstorage> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 165:
/* rule 165 can match eol */
YY_RULE_SETUP
surfxml_mstorage_name_isset = 0;
ENTER(AL_surfxml_mstorage); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 166:
/* rule 166 can match eol */
YY_RULE_SETUP
if (surfxml_mstorage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_mstorage>");} surfxml_mstorage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mstorage_typeId);
- YY_BREAK
+ YY_BREAK
case 167:
/* rule 167 can match eol */
YY_RULE_SETUP
if (surfxml_mstorage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_mstorage>");} surfxml_mstorage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mstorage_typeId);
- YY_BREAK
+ YY_BREAK
case 168:
/* rule 168 can match eol */
YY_RULE_SETUP
if (surfxml_mstorage_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mstorage>");} surfxml_mstorage_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mstorage_name);
- YY_BREAK
+ YY_BREAK
case 169:
/* rule 169 can match eol */
YY_RULE_SETUP
if (surfxml_mstorage_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mstorage>");} surfxml_mstorage_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mstorage_name);
- YY_BREAK
+ YY_BREAK
case 170:
YY_RULE_SETUP
{
if (!AX_surfxml_mstorage_name) FAIL("Required attribute `name' not set for `mstorage' element.");
LEAVE; STag_surfxml_mstorage();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mstorage);
}
- YY_BREAK
+ YY_BREAK
case 171:
YY_RULE_SETUP
{
case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 172:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of mstorage element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 173:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `mstorage' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_mstorage):
FAIL("EOF in attribute list of `mstorage' element.");
- YY_BREAK
+ YY_BREAK
case 174:
/* rule 174 can match eol */
case S_surfxml_host_1: case S_surfxml_host_2: case S_surfxml_host: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 175:
/* rule 175 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</mstorage>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 176:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</mstorage>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_mstorage):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</mstorage>' expected.");
- YY_BREAK
+ YY_BREAK
case 177:
/* rule 177 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <host> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 178:
/* rule 178 can match eol */
YY_RULE_SETUP
surfxml_host_coordinates_isset = 0;
ENTER(AL_surfxml_host); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 179:
/* rule 179 can match eol */
YY_RULE_SETUP
if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");} surfxml_host_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
- YY_BREAK
+ YY_BREAK
case 180:
/* rule 180 can match eol */
YY_RULE_SETUP
if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");} surfxml_host_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
- YY_BREAK
+ YY_BREAK
case 181:
/* rule 181 can match eol */
YY_RULE_SETUP
if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_host>");} surfxml_host_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_power);
- YY_BREAK
+ YY_BREAK
case 182:
/* rule 182 can match eol */
YY_RULE_SETUP
if (surfxml_host_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_host>");} surfxml_host_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_power);
- YY_BREAK
+ YY_BREAK
case 183:
/* rule 183 can match eol */
YY_RULE_SETUP
if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");} surfxml_host_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_core);
- YY_BREAK
+ YY_BREAK
case 184:
/* rule 184 can match eol */
YY_RULE_SETUP
if (surfxml_host_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_host>");} surfxml_host_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_core);
- YY_BREAK
+ YY_BREAK
case 185:
/* rule 185 can match eol */
YY_RULE_SETUP
if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in <surfxml_host>");} surfxml_host_availability_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability);
- YY_BREAK
+ YY_BREAK
case 186:
/* rule 186 can match eol */
YY_RULE_SETUP
if (surfxml_host_availability_isset != 0) {FAIL("Multiple definition of attribute availability in <surfxml_host>");} surfxml_host_availability_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability);
- YY_BREAK
+ YY_BREAK
case 187:
/* rule 187 can match eol */
YY_RULE_SETUP
if (surfxml_host_availability_file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");} surfxml_host_availability_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability_file);
- YY_BREAK
+ YY_BREAK
case 188:
/* rule 188 can match eol */
YY_RULE_SETUP
if (surfxml_host_availability_file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");} surfxml_host_availability_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_availability_file);
- YY_BREAK
+ YY_BREAK
case 189:
/* rule 189 can match eol */
case 190:
/* rule 190 can match eol */
YY_RULE_SETUP
A_surfxml_host_state = A_surfxml_host_state_ON;
- YY_BREAK
+ YY_BREAK
case 191:
/* rule 191 can match eol */
case 192:
/* rule 192 can match eol */
YY_RULE_SETUP
A_surfxml_host_state = A_surfxml_host_state_OFF;
- YY_BREAK
+ YY_BREAK
case 193:
/* rule 193 can match eol */
YY_RULE_SETUP
if (surfxml_host_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");} surfxml_host_state_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state_file);
- YY_BREAK
+ YY_BREAK
case 194:
/* rule 194 can match eol */
YY_RULE_SETUP
if (surfxml_host_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");} surfxml_host_state_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state_file);
- YY_BREAK
+ YY_BREAK
case 195:
/* rule 195 can match eol */
YY_RULE_SETUP
if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");} surfxml_host_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_coordinates);
- YY_BREAK
+ YY_BREAK
case 196:
/* rule 196 can match eol */
YY_RULE_SETUP
if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");} surfxml_host_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_coordinates);
- YY_BREAK
+ YY_BREAK
case 197:
YY_RULE_SETUP
{
if (!AX_surfxml_host_power) FAIL("Required attribute `power' not set for `host' element.");
LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
}
- YY_BREAK
+ YY_BREAK
case 198:
YY_RULE_SETUP
{
case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS: SET(S_surfxml_AS_11); break;
}
}
- YY_BREAK
+ YY_BREAK
case 199:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of host element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 200:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `host' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_host):
FAIL("EOF in attribute list of `host' element.");
- YY_BREAK
+ YY_BREAK
case 201:
/* rule 201 can match eol */
case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS: SET(S_surfxml_AS_11); break;
}
}
- YY_BREAK
+ YY_BREAK
case 202:
/* rule 202 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</host>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 203:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</host>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_host):
case YY_STATE_EOF(E_surfxml_host):
case YY_STATE_EOF(S_surfxml_host_2):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host>' expected.");
- YY_BREAK
+ YY_BREAK
case 204:
/* rule 204 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <cluster> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 205:
/* rule 205 can match eol */
YY_RULE_SETUP
surfxml_cluster_router_id_isset = 0;
ENTER(AL_surfxml_cluster); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 206:
/* rule 206 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");} surfxml_cluster_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_id);
- YY_BREAK
+ YY_BREAK
case 207:
/* rule 207 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cluster>");} surfxml_cluster_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_id);
- YY_BREAK
+ YY_BREAK
case 208:
/* rule 208 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_prefix);
- YY_BREAK
+ YY_BREAK
case 209:
/* rule 209 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cluster>");} surfxml_cluster_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_prefix);
- YY_BREAK
+ YY_BREAK
case 210:
/* rule 210 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_suffix);
- YY_BREAK
+ YY_BREAK
case 211:
/* rule 211 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cluster>");} surfxml_cluster_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_suffix);
- YY_BREAK
+ YY_BREAK
case 212:
/* rule 212 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");} surfxml_cluster_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_radical);
- YY_BREAK
+ YY_BREAK
case 213:
/* rule 213 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cluster>");} surfxml_cluster_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_radical);
- YY_BREAK
+ YY_BREAK
case 214:
/* rule 214 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cluster>");} surfxml_cluster_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_power);
- YY_BREAK
+ YY_BREAK
case 215:
/* rule 215 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cluster>");} surfxml_cluster_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_power);
- YY_BREAK
+ YY_BREAK
case 216:
/* rule 216 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");} surfxml_cluster_core_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_core);
- YY_BREAK
+ YY_BREAK
case 217:
/* rule 217 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_core_isset != 0) {FAIL("Multiple definition of attribute core in <surfxml_cluster>");} surfxml_cluster_core_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_core);
- YY_BREAK
+ YY_BREAK
case 218:
/* rule 218 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");} surfxml_cluster_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bw);
- YY_BREAK
+ YY_BREAK
case 219:
/* rule 219 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cluster>");} surfxml_cluster_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bw);
- YY_BREAK
+ YY_BREAK
case 220:
/* rule 220 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");} surfxml_cluster_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_lat);
- YY_BREAK
+ YY_BREAK
case 221:
/* rule 221 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cluster>");} surfxml_cluster_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_lat);
- YY_BREAK
+ YY_BREAK
case 222:
/* rule 222 can match eol */
case 223:
/* rule 223 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_sharing_policy = A_surfxml_cluster_sharing_policy_SHARED;
- YY_BREAK
+ YY_BREAK
case 224:
/* rule 224 can match eol */
case 225:
/* rule 225 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_sharing_policy = A_surfxml_cluster_sharing_policy_FULLDUPLEX;
- YY_BREAK
+ YY_BREAK
case 226:
/* rule 226 can match eol */
case 227:
/* rule 227 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_sharing_policy = A_surfxml_cluster_sharing_policy_FATPIPE;
- YY_BREAK
+ YY_BREAK
case 228:
/* rule 228 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_bb_bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");} surfxml_cluster_bb_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_bw);
- YY_BREAK
+ YY_BREAK
case 229:
/* rule 229 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_bb_bw_isset != 0) {FAIL("Multiple definition of attribute bb_bw in <surfxml_cluster>");} surfxml_cluster_bb_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_bw);
- YY_BREAK
+ YY_BREAK
case 230:
/* rule 230 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_bb_lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");} surfxml_cluster_bb_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_bb_lat);
- YY_BREAK
+ YY_BREAK
case 231:
/* rule 231 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_bb_lat_isset != 0) {FAIL("Multiple definition of attribute bb_lat in <surfxml_cluster>");} surfxml_cluster_bb_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_bb_lat);
- YY_BREAK
+ YY_BREAK
case 232:
/* rule 232 can match eol */
case 233:
/* rule 233 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_bb_sharing_policy = A_surfxml_cluster_bb_sharing_policy_SHARED;
- YY_BREAK
+ YY_BREAK
case 234:
/* rule 234 can match eol */
case 235:
/* rule 235 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_bb_sharing_policy = A_surfxml_cluster_bb_sharing_policy_FATPIPE;
- YY_BREAK
+ YY_BREAK
case 236:
/* rule 236 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_availability_file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_cluster>");} surfxml_cluster_availability_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_availability_file);
- YY_BREAK
+ YY_BREAK
case 237:
/* rule 237 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_availability_file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_cluster>");} surfxml_cluster_availability_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_availability_file);
- YY_BREAK
+ YY_BREAK
case 238:
/* rule 238 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_cluster>");} surfxml_cluster_state_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_state_file);
- YY_BREAK
+ YY_BREAK
case 239:
/* rule 239 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_cluster>");} surfxml_cluster_state_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_state_file);
- YY_BREAK
+ YY_BREAK
case 240:
/* rule 240 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_router_id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");} surfxml_cluster_router_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_router_id);
- YY_BREAK
+ YY_BREAK
case 241:
/* rule 241 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_router_id_isset != 0) {FAIL("Multiple definition of attribute router_id in <surfxml_cluster>");} surfxml_cluster_router_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_router_id);
- YY_BREAK
+ YY_BREAK
case 242:
YY_RULE_SETUP
{
if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element.");
LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cluster);
}
- YY_BREAK
+ YY_BREAK
case 243:
YY_RULE_SETUP
{
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 244:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of cluster element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 245:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `cluster' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_cluster):
FAIL("EOF in attribute list of `cluster' element.");
- YY_BREAK
+ YY_BREAK
case 246:
/* rule 246 can match eol */
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 247:
/* rule 247 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</cluster>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 248:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</cluster>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_cluster):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cluster>' expected.");
- YY_BREAK
+ YY_BREAK
case 249:
/* rule 249 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <peer> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 250:
/* rule 250 can match eol */
YY_RULE_SETUP
surfxml_peer_state_file_isset = 0;
ENTER(AL_surfxml_peer); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 251:
/* rule 251 can match eol */
YY_RULE_SETUP
if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");} surfxml_peer_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_id);
- YY_BREAK
+ YY_BREAK
case 252:
/* rule 252 can match eol */
YY_RULE_SETUP
if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");} surfxml_peer_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_id);
- YY_BREAK
+ YY_BREAK
case 253:
/* rule 253 can match eol */
YY_RULE_SETUP
if (surfxml_peer_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_peer>");} surfxml_peer_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_power);
- YY_BREAK
+ YY_BREAK
case 254:
/* rule 254 can match eol */
YY_RULE_SETUP
if (surfxml_peer_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_peer>");} surfxml_peer_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_power);
- YY_BREAK
+ YY_BREAK
case 255:
/* rule 255 can match eol */
YY_RULE_SETUP
if (surfxml_peer_bw_in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");} surfxml_peer_bw_in_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw_in);
- YY_BREAK
+ YY_BREAK
case 256:
/* rule 256 can match eol */
YY_RULE_SETUP
if (surfxml_peer_bw_in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");} surfxml_peer_bw_in_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw_in);
- YY_BREAK
+ YY_BREAK
case 257:
/* rule 257 can match eol */
YY_RULE_SETUP
if (surfxml_peer_bw_out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");} surfxml_peer_bw_out_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw_out);
- YY_BREAK
+ YY_BREAK
case 258:
/* rule 258 can match eol */
YY_RULE_SETUP
if (surfxml_peer_bw_out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");} surfxml_peer_bw_out_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw_out);
- YY_BREAK
+ YY_BREAK
case 259:
/* rule 259 can match eol */
YY_RULE_SETUP
if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");} surfxml_peer_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_lat);
- YY_BREAK
+ YY_BREAK
case 260:
/* rule 260 can match eol */
YY_RULE_SETUP
if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");} surfxml_peer_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_lat);
- YY_BREAK
+ YY_BREAK
case 261:
/* rule 261 can match eol */
YY_RULE_SETUP
if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_coordinates);
- YY_BREAK
+ YY_BREAK
case 262:
/* rule 262 can match eol */
YY_RULE_SETUP
if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_coordinates);
- YY_BREAK
+ YY_BREAK
case 263:
/* rule 263 can match eol */
YY_RULE_SETUP
if (surfxml_peer_availability_file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");} surfxml_peer_availability_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_availability_file);
- YY_BREAK
+ YY_BREAK
case 264:
/* rule 264 can match eol */
YY_RULE_SETUP
if (surfxml_peer_availability_file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");} surfxml_peer_availability_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_availability_file);
- YY_BREAK
+ YY_BREAK
case 265:
/* rule 265 can match eol */
YY_RULE_SETUP
if (surfxml_peer_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");} surfxml_peer_state_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_state_file);
- YY_BREAK
+ YY_BREAK
case 266:
/* rule 266 can match eol */
YY_RULE_SETUP
if (surfxml_peer_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");} surfxml_peer_state_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_state_file);
- YY_BREAK
+ YY_BREAK
case 267:
YY_RULE_SETUP
{
if (!AX_surfxml_peer_lat) FAIL("Required attribute `lat' not set for `peer' element.");
LEAVE; STag_surfxml_peer();surfxml_pcdata_ix = 0; ENTER(E_surfxml_peer);
}
- YY_BREAK
+ YY_BREAK
case 268:
YY_RULE_SETUP
{
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 269:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of peer element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 270:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `peer' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_peer):
FAIL("EOF in attribute list of `peer' element.");
- YY_BREAK
+ YY_BREAK
case 271:
/* rule 271 can match eol */
case S_surfxml_include: case S_surfxml_include_2: case S_surfxml_include_1: SET(S_surfxml_include_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 272:
/* rule 272 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</peer>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 273:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</peer>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_peer):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</peer>' expected.");
- YY_BREAK
+ YY_BREAK
case 274:
/* rule 274 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <router> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 275:
/* rule 275 can match eol */
YY_RULE_SETUP
surfxml_router_coordinates_isset = 0;
ENTER(AL_surfxml_router); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 276:
/* rule 276 can match eol */
YY_RULE_SETUP
if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");} surfxml_router_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
- YY_BREAK
+ YY_BREAK
case 277:
/* rule 277 can match eol */
YY_RULE_SETUP
if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");} surfxml_router_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
- YY_BREAK
+ YY_BREAK
case 278:
/* rule 278 can match eol */
YY_RULE_SETUP
if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");} surfxml_router_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_coordinates);
- YY_BREAK
+ YY_BREAK
case 279:
/* rule 279 can match eol */
YY_RULE_SETUP
if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");} surfxml_router_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_coordinates);
- YY_BREAK
+ YY_BREAK
case 280:
YY_RULE_SETUP
{
if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
}
- YY_BREAK
+ YY_BREAK
case 281:
YY_RULE_SETUP
{
case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS: SET(S_surfxml_AS_11); break;
}
}
- YY_BREAK
+ YY_BREAK
case 282:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of router element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 283:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `router' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_router):
FAIL("EOF in attribute list of `router' element.");
- YY_BREAK
+ YY_BREAK
case 284:
/* rule 284 can match eol */
case S_surfxml_AS_11: case S_surfxml_AS_10: case S_surfxml_AS: SET(S_surfxml_AS_11); break;
}
}
- YY_BREAK
+ YY_BREAK
case 285:
/* rule 285 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</router>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 286:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</router>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_router):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</router>' expected.");
- YY_BREAK
+ YY_BREAK
case 287:
/* rule 287 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <link> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 288:
/* rule 288 can match eol */
YY_RULE_SETUP
surfxml_link_sharing_policy_isset = 0;
ENTER(AL_surfxml_link); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 289:
/* rule 289 can match eol */
YY_RULE_SETUP
if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");} surfxml_link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
- YY_BREAK
+ YY_BREAK
case 290:
/* rule 290 can match eol */
YY_RULE_SETUP
if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");} surfxml_link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
- YY_BREAK
+ YY_BREAK
case 291:
/* rule 291 can match eol */
YY_RULE_SETUP
if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
- YY_BREAK
+ YY_BREAK
case 292:
/* rule 292 can match eol */
YY_RULE_SETUP
if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
- YY_BREAK
+ YY_BREAK
case 293:
/* rule 293 can match eol */
YY_RULE_SETUP
if (surfxml_link_bandwidth_file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");} surfxml_link_bandwidth_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth_file);
- YY_BREAK
+ YY_BREAK
case 294:
/* rule 294 can match eol */
YY_RULE_SETUP
if (surfxml_link_bandwidth_file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");} surfxml_link_bandwidth_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth_file);
- YY_BREAK
+ YY_BREAK
case 295:
/* rule 295 can match eol */
YY_RULE_SETUP
if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");} surfxml_link_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
- YY_BREAK
+ YY_BREAK
case 296:
/* rule 296 can match eol */
YY_RULE_SETUP
if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");} surfxml_link_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency);
- YY_BREAK
+ YY_BREAK
case 297:
/* rule 297 can match eol */
YY_RULE_SETUP
if (surfxml_link_latency_file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");} surfxml_link_latency_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency_file);
- YY_BREAK
+ YY_BREAK
case 298:
/* rule 298 can match eol */
YY_RULE_SETUP
if (surfxml_link_latency_file_isset != 0) {FAIL("Multiple definition of attribute latency_file in <surfxml_link>");} surfxml_link_latency_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_latency_file);
- YY_BREAK
+ YY_BREAK
case 299:
/* rule 299 can match eol */
case 300:
/* rule 300 can match eol */
YY_RULE_SETUP
A_surfxml_link_state = A_surfxml_link_state_ON;
- YY_BREAK
+ YY_BREAK
case 301:
/* rule 301 can match eol */
case 302:
/* rule 302 can match eol */
YY_RULE_SETUP
A_surfxml_link_state = A_surfxml_link_state_OFF;
- YY_BREAK
+ YY_BREAK
case 303:
/* rule 303 can match eol */
YY_RULE_SETUP
if (surfxml_link_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");} surfxml_link_state_file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state_file);
- YY_BREAK
+ YY_BREAK
case 304:
/* rule 304 can match eol */
YY_RULE_SETUP
if (surfxml_link_state_file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");} surfxml_link_state_file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_state_file);
- YY_BREAK
+ YY_BREAK
case 305:
/* rule 305 can match eol */
case 306:
/* rule 306 can match eol */
YY_RULE_SETUP
A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
- YY_BREAK
+ YY_BREAK
case 307:
/* rule 307 can match eol */
case 308:
/* rule 308 can match eol */
YY_RULE_SETUP
A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;
- YY_BREAK
+ YY_BREAK
case 309:
/* rule 309 can match eol */
case 310:
/* rule 310 can match eol */
YY_RULE_SETUP
A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FULLDUPLEX;
- YY_BREAK
+ YY_BREAK
case 311:
YY_RULE_SETUP
{
if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
}
- YY_BREAK
+ YY_BREAK
case 312:
YY_RULE_SETUP
{
case S_surfxml_AS_2: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 313:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of link element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 314:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `link' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_link):
FAIL("EOF in attribute list of `link' element.");
- YY_BREAK
+ YY_BREAK
case 315:
/* rule 315 can match eol */
case S_surfxml_AS_2: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 316:
/* rule 316 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</link>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 317:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</link>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_link):
case YY_STATE_EOF(S_surfxml_link_2):
case YY_STATE_EOF(S_surfxml_link):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link>' expected.");
- YY_BREAK
+ YY_BREAK
case 318:
/* rule 318 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <route> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 319:
/* rule 319 can match eol */
YY_RULE_SETUP
surfxml_route_symmetrical_isset = 0;
ENTER(AL_surfxml_route); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 320:
/* rule 320 can match eol */
YY_RULE_SETUP
if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");} surfxml_route_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
- YY_BREAK
+ YY_BREAK
case 321:
/* rule 321 can match eol */
YY_RULE_SETUP
if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");} surfxml_route_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
- YY_BREAK
+ YY_BREAK
case 322:
/* rule 322 can match eol */
YY_RULE_SETUP
if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");} surfxml_route_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
- YY_BREAK
+ YY_BREAK
case 323:
/* rule 323 can match eol */
YY_RULE_SETUP
if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");} surfxml_route_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
- YY_BREAK
+ YY_BREAK
case 324:
/* rule 324 can match eol */
case 325:
/* rule 325 can match eol */
YY_RULE_SETUP
A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
- YY_BREAK
+ YY_BREAK
case 326:
/* rule 326 can match eol */
case 327:
/* rule 327 can match eol */
YY_RULE_SETUP
A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
- YY_BREAK
+ YY_BREAK
case 328:
YY_RULE_SETUP
{
if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
}
- YY_BREAK
+ YY_BREAK
case 329:
YY_RULE_SETUP
{
case S_surfxml_AS_12: case S_surfxml_AS_9: case S_surfxml_AS_11: case S_surfxml_AS_13: case S_surfxml_AS: SET(S_surfxml_AS_13); break;
}
}
- YY_BREAK
+ YY_BREAK
case 330:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of route element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 331:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `route' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_route):
FAIL("EOF in attribute list of `route' element.");
- YY_BREAK
+ YY_BREAK
case 332:
/* rule 332 can match eol */
case S_surfxml_AS_12: case S_surfxml_AS_9: case S_surfxml_AS_11: case S_surfxml_AS_13: case S_surfxml_AS: SET(S_surfxml_AS_13); break;
}
}
- YY_BREAK
+ YY_BREAK
case 333:
/* rule 333 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</route>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 334:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</route>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_route):
case YY_STATE_EOF(S_surfxml_route_2):
case YY_STATE_EOF(E_surfxml_route):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</route>' expected.");
- YY_BREAK
+ YY_BREAK
case 335:
/* rule 335 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <ASroute> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 336:
/* rule 336 can match eol */
YY_RULE_SETUP
surfxml_ASroute_symmetrical_isset = 0;
ENTER(AL_surfxml_ASroute); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 337:
/* rule 337 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_ASroute>");} surfxml_ASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_src);
- YY_BREAK
+ YY_BREAK
case 338:
/* rule 338 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_ASroute>");} surfxml_ASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_src);
- YY_BREAK
+ YY_BREAK
case 339:
/* rule 339 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_ASroute>");} surfxml_ASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_dst);
- YY_BREAK
+ YY_BREAK
case 340:
/* rule 340 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_ASroute>");} surfxml_ASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_dst);
- YY_BREAK
+ YY_BREAK
case 341:
/* rule 341 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_gw_src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_ASroute>");} surfxml_ASroute_gw_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw_src);
- YY_BREAK
+ YY_BREAK
case 342:
/* rule 342 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_gw_src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_ASroute>");} surfxml_ASroute_gw_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw_src);
- YY_BREAK
+ YY_BREAK
case 343:
/* rule 343 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_gw_dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_ASroute>");} surfxml_ASroute_gw_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_ASroute_gw_dst);
- YY_BREAK
+ YY_BREAK
case 344:
/* rule 344 can match eol */
YY_RULE_SETUP
if (surfxml_ASroute_gw_dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_ASroute>");} surfxml_ASroute_gw_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_ASroute_gw_dst);
- YY_BREAK
+ YY_BREAK
case 345:
/* rule 345 can match eol */
case 346:
/* rule 346 can match eol */
YY_RULE_SETUP
A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_YES;
- YY_BREAK
+ YY_BREAK
case 347:
/* rule 347 can match eol */
case 348:
/* rule 348 can match eol */
YY_RULE_SETUP
A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_NO;
- YY_BREAK
+ YY_BREAK
case 349:
YY_RULE_SETUP
{
if (!AX_surfxml_ASroute_gw_dst) FAIL("Required attribute `gw_dst' not set for `ASroute' element.");
LEAVE; STag_surfxml_ASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_ASroute);
}
- YY_BREAK
+ YY_BREAK
case 350:
YY_RULE_SETUP
{
case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 351:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of ASroute element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 352:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `ASroute' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_ASroute):
FAIL("EOF in attribute list of `ASroute' element.");
- YY_BREAK
+ YY_BREAK
case 353:
/* rule 353 can match eol */
case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 354:
/* rule 354 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</ASroute>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 355:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</ASroute>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_ASroute):
case YY_STATE_EOF(S_surfxml_ASroute):
case YY_STATE_EOF(S_surfxml_ASroute_2):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</ASroute>' expected.");
- YY_BREAK
+ YY_BREAK
case 356:
/* rule 356 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <link_ctn> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 357:
/* rule 357 can match eol */
YY_RULE_SETUP
surfxml_link_ctn_direction_isset = 0;
ENTER(AL_surfxml_link_ctn); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 358:
/* rule 358 can match eol */
YY_RULE_SETUP
if (surfxml_link_ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link_ctn>");} surfxml_link_ctn_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_ctn_id);
- YY_BREAK
+ YY_BREAK
case 359:
/* rule 359 can match eol */
YY_RULE_SETUP
if (surfxml_link_ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link_ctn>");} surfxml_link_ctn_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_ctn_id);
- YY_BREAK
+ YY_BREAK
case 360:
/* rule 360 can match eol */
case 361:
/* rule 361 can match eol */
YY_RULE_SETUP
A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_UP;
- YY_BREAK
+ YY_BREAK
case 362:
/* rule 362 can match eol */
case 363:
/* rule 363 can match eol */
YY_RULE_SETUP
A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_DOWN;
- YY_BREAK
+ YY_BREAK
case 364:
/* rule 364 can match eol */
case 365:
/* rule 365 can match eol */
YY_RULE_SETUP
A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
- YY_BREAK
+ YY_BREAK
case 366:
YY_RULE_SETUP
{
if (!AX_surfxml_link_ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element.");
LEAVE; STag_surfxml_link_ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link_ctn);
}
- YY_BREAK
+ YY_BREAK
case 367:
YY_RULE_SETUP
{
case S_surfxml_ASroute: case S_surfxml_ASroute_1: case S_surfxml_ASroute_2: SET(S_surfxml_ASroute_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 368:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of link_ctn element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 369:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `link_ctn' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_link_ctn):
FAIL("EOF in attribute list of `link_ctn' element.");
- YY_BREAK
+ YY_BREAK
case 370:
/* rule 370 can match eol */
case S_surfxml_ASroute: case S_surfxml_ASroute_1: case S_surfxml_ASroute_2: SET(S_surfxml_ASroute_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 371:
/* rule 371 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</link_ctn>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 372:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</link_ctn>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_link_ctn):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link_ctn>' expected.");
- YY_BREAK
+ YY_BREAK
case 373:
/* rule 373 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <bypassRoute> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 374:
/* rule 374 can match eol */
YY_RULE_SETUP
surfxml_bypassRoute_dst_isset = 0;
ENTER(AL_surfxml_bypassRoute); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 375:
/* rule 375 can match eol */
YY_RULE_SETUP
if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassRoute>");} surfxml_bypassRoute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_src);
- YY_BREAK
+ YY_BREAK
case 376:
/* rule 376 can match eol */
YY_RULE_SETUP
if (surfxml_bypassRoute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassRoute>");} surfxml_bypassRoute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_src);
- YY_BREAK
+ YY_BREAK
case 377:
/* rule 377 can match eol */
YY_RULE_SETUP
if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassRoute>");} surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassRoute_dst);
- YY_BREAK
+ YY_BREAK
case 378:
/* rule 378 can match eol */
YY_RULE_SETUP
if (surfxml_bypassRoute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassRoute>");} surfxml_bypassRoute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassRoute_dst);
- YY_BREAK
+ YY_BREAK
case 379:
YY_RULE_SETUP
{
if (!AX_surfxml_bypassRoute_dst) FAIL("Required attribute `dst' not set for `bypassRoute' element.");
LEAVE; STag_surfxml_bypassRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassRoute);
}
- YY_BREAK
+ YY_BREAK
case 380:
YY_RULE_SETUP
{
case S_surfxml_AS_12: case S_surfxml_AS_9: case S_surfxml_AS_11: case S_surfxml_AS_13: case S_surfxml_AS: SET(S_surfxml_AS_13); break;
}
}
- YY_BREAK
+ YY_BREAK
case 381:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of bypassRoute element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 382:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `bypassRoute' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_bypassRoute):
FAIL("EOF in attribute list of `bypassRoute' element.");
- YY_BREAK
+ YY_BREAK
case 383:
/* rule 383 can match eol */
case S_surfxml_AS_12: case S_surfxml_AS_9: case S_surfxml_AS_11: case S_surfxml_AS_13: case S_surfxml_AS: SET(S_surfxml_AS_13); break;
}
}
- YY_BREAK
+ YY_BREAK
case 384:
/* rule 384 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</bypassRoute>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 385:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</bypassRoute>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_bypassRoute):
case YY_STATE_EOF(S_surfxml_bypassRoute_2):
case YY_STATE_EOF(E_surfxml_bypassRoute):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassRoute>' expected.");
- YY_BREAK
+ YY_BREAK
case 386:
/* rule 386 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <bypassASroute> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 387:
/* rule 387 can match eol */
YY_RULE_SETUP
surfxml_bypassASroute_gw_dst_isset = 0;
ENTER(AL_surfxml_bypassASroute); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 388:
/* rule 388 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassASroute>");} surfxml_bypassASroute_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_src);
- YY_BREAK
+ YY_BREAK
case 389:
/* rule 389 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_bypassASroute>");} surfxml_bypassASroute_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_src);
- YY_BREAK
+ YY_BREAK
case 390:
/* rule 390 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_dst);
- YY_BREAK
+ YY_BREAK
case 391:
/* rule 391 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_dst);
- YY_BREAK
+ YY_BREAK
case 392:
/* rule 392 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_gw_src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw_src);
- YY_BREAK
+ YY_BREAK
case 393:
/* rule 393 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_gw_src_isset != 0) {FAIL("Multiple definition of attribute gw_src in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw_src);
- YY_BREAK
+ YY_BREAK
case 394:
/* rule 394 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_gw_dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_bypassASroute_gw_dst);
- YY_BREAK
+ YY_BREAK
case 395:
/* rule 395 can match eol */
YY_RULE_SETUP
if (surfxml_bypassASroute_gw_dst_isset != 0) {FAIL("Multiple definition of attribute gw_dst in <surfxml_bypassASroute>");} surfxml_bypassASroute_gw_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_bypassASroute_gw_dst);
- YY_BREAK
+ YY_BREAK
case 396:
YY_RULE_SETUP
{
if (!AX_surfxml_bypassASroute_gw_dst) FAIL("Required attribute `gw_dst' not set for `bypassASroute' element.");
LEAVE; STag_surfxml_bypassASroute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_bypassASroute);
}
- YY_BREAK
+ YY_BREAK
case 397:
YY_RULE_SETUP
{
case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 398:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of bypassASroute element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 399:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `bypassASroute' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_bypassASroute):
FAIL("EOF in attribute list of `bypassASroute' element.");
- YY_BREAK
+ YY_BREAK
case 400:
/* rule 400 can match eol */
case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS: case S_surfxml_AS_6: case S_surfxml_AS_3: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 401:
/* rule 401 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</bypassASroute>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 402:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</bypassASroute>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_bypassASroute_2):
case YY_STATE_EOF(E_surfxml_bypassASroute):
case YY_STATE_EOF(S_surfxml_bypassASroute):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassASroute>' expected.");
- YY_BREAK
+ YY_BREAK
case 403:
/* rule 403 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <process> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 404:
/* rule 404 can match eol */
YY_RULE_SETUP
surfxml_process_kill_time_isset = 0;
ENTER(AL_surfxml_process); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 405:
/* rule 405 can match eol */
YY_RULE_SETUP
if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");} surfxml_process_host_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
- YY_BREAK
+ YY_BREAK
case 406:
/* rule 406 can match eol */
YY_RULE_SETUP
if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");} surfxml_process_host_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
- YY_BREAK
+ YY_BREAK
case 407:
/* rule 407 can match eol */
YY_RULE_SETUP
if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");} surfxml_process_function_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
- YY_BREAK
+ YY_BREAK
case 408:
/* rule 408 can match eol */
YY_RULE_SETUP
if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");} surfxml_process_function_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
- YY_BREAK
+ YY_BREAK
case 409:
/* rule 409 can match eol */
YY_RULE_SETUP
if (surfxml_process_start_time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");} surfxml_process_start_time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start_time);
- YY_BREAK
+ YY_BREAK
case 410:
/* rule 410 can match eol */
YY_RULE_SETUP
if (surfxml_process_start_time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");} surfxml_process_start_time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start_time);
- YY_BREAK
+ YY_BREAK
case 411:
/* rule 411 can match eol */
YY_RULE_SETUP
if (surfxml_process_kill_time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");} surfxml_process_kill_time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill_time);
- YY_BREAK
+ YY_BREAK
case 412:
/* rule 412 can match eol */
YY_RULE_SETUP
if (surfxml_process_kill_time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");} surfxml_process_kill_time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill_time);
- YY_BREAK
+ YY_BREAK
case 413:
YY_RULE_SETUP
{
if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
}
- YY_BREAK
+ YY_BREAK
case 414:
YY_RULE_SETUP
{
case S_surfxml_platform_6: case S_surfxml_platform_4: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_8: case S_surfxml_platform_7: case S_surfxml_platform_3: SET(S_surfxml_platform_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 415:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of process element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 416:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `process' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_process):
FAIL("EOF in attribute list of `process' element.");
- YY_BREAK
+ YY_BREAK
case 417:
/* rule 417 can match eol */
case S_surfxml_platform_6: case S_surfxml_platform_4: case S_surfxml_platform_1: case S_surfxml_platform: case S_surfxml_platform_8: case S_surfxml_platform_7: case S_surfxml_platform_3: SET(S_surfxml_platform_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 418:
/* rule 418 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</process>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 419:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</process>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_process):
case YY_STATE_EOF(S_surfxml_process):
case YY_STATE_EOF(S_surfxml_process_2):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</process>' expected.");
- YY_BREAK
+ YY_BREAK
case 420:
/* rule 420 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <argument> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 421:
/* rule 421 can match eol */
YY_RULE_SETUP
surfxml_argument_value_isset = 0;
ENTER(AL_surfxml_argument); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 422:
/* rule 422 can match eol */
YY_RULE_SETUP
if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_argument>");} surfxml_argument_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_argument_value);
- YY_BREAK
+ YY_BREAK
case 423:
/* rule 423 can match eol */
YY_RULE_SETUP
if (surfxml_argument_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_argument>");} surfxml_argument_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_argument_value);
- YY_BREAK
+ YY_BREAK
case 424:
YY_RULE_SETUP
{
if (!AX_surfxml_argument_value) FAIL("Required attribute `value' not set for `argument' element.");
LEAVE; STag_surfxml_argument();surfxml_pcdata_ix = 0; ENTER(E_surfxml_argument);
}
- YY_BREAK
+ YY_BREAK
case 425:
YY_RULE_SETUP
{
case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 426:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of argument element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 427:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `argument' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_argument):
FAIL("EOF in attribute list of `argument' element.");
- YY_BREAK
+ YY_BREAK
case 428:
/* rule 428 can match eol */
case S_surfxml_process_1: case S_surfxml_process: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 429:
/* rule 429 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</argument>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 430:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</argument>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_argument):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</argument>' expected.");
- YY_BREAK
+ YY_BREAK
case 431:
/* rule 431 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <config> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 432:
/* rule 432 can match eol */
YY_RULE_SETUP
surfxml_config_id_isset = 0;
ENTER(AL_surfxml_config); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 433:
/* rule 433 can match eol */
YY_RULE_SETUP
if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_config>");} surfxml_config_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_config_id);
- YY_BREAK
+ YY_BREAK
case 434:
/* rule 434 can match eol */
YY_RULE_SETUP
if (surfxml_config_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_config>");} surfxml_config_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_config_id);
- YY_BREAK
+ YY_BREAK
case 435:
YY_RULE_SETUP
{
LEAVE; STag_surfxml_config();surfxml_pcdata_ix = 0; ENTER(S_surfxml_config);
}
- YY_BREAK
+ YY_BREAK
case 436:
YY_RULE_SETUP
{
case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 437:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of config element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 438:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `config' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_config):
FAIL("EOF in attribute list of `config' element.");
- YY_BREAK
+ YY_BREAK
case 439:
/* rule 439 can match eol */
case S_surfxml_platform_2: case S_surfxml_platform: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 440:
/* rule 440 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</config>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 441:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</config>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_config):
case YY_STATE_EOF(S_surfxml_config_2):
case YY_STATE_EOF(E_surfxml_config):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</config>' expected.");
- YY_BREAK
+ YY_BREAK
/* <!-- <!ATTLIST prop key CDATA #REQUIRED> -->
* <!-- <!ATTLIST prop key CDATA #REQUIRED> --> */
/* rule 442 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <prop> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 443:
/* rule 443 can match eol */
YY_RULE_SETUP
surfxml_prop_value_isset = 0;
ENTER(AL_surfxml_prop); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 444:
/* rule 444 can match eol */
YY_RULE_SETUP
if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");} surfxml_prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
- YY_BREAK
+ YY_BREAK
case 445:
/* rule 445 can match eol */
YY_RULE_SETUP
if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");} surfxml_prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
- YY_BREAK
+ YY_BREAK
case 446:
/* rule 446 can match eol */
YY_RULE_SETUP
if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");} surfxml_prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
- YY_BREAK
+ YY_BREAK
case 447:
/* rule 447 can match eol */
YY_RULE_SETUP
if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");} surfxml_prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
- YY_BREAK
+ YY_BREAK
case 448:
YY_RULE_SETUP
{
if (!AX_surfxml_prop_value) FAIL("Required attribute `value' not set for `prop' element.");
LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
}
- YY_BREAK
+ YY_BREAK
case 449:
YY_RULE_SETUP
{
case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 450:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of prop element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 451:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `prop' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_prop):
FAIL("EOF in attribute list of `prop' element.");
- YY_BREAK
+ YY_BREAK
case 452:
/* rule 452 can match eol */
case S_surfxml_link_1: case S_surfxml_link_2: case S_surfxml_link: SET(S_surfxml_link_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 453:
/* rule 453 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</prop>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 454:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</prop>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_prop):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</prop>' expected.");
- YY_BREAK
+ YY_BREAK
/* EPILOG: after the root element. */
case 455:
YY_RULE_SETUP
{SET(PROLOG); yyless(0); CLEANUP; return -1;}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(EPILOG):
SUCCEED;
- YY_BREAK
+ YY_BREAK
/* CHARACTER DATA. */
case 456:
YY_RULE_SETUP
BUFFERPUTC('&');
- YY_BREAK
+ YY_BREAK
case 457:
YY_RULE_SETUP
BUFFERPUTC('<');
- YY_BREAK
+ YY_BREAK
case 458:
YY_RULE_SETUP
BUFFERPUTC('>');
- YY_BREAK
+ YY_BREAK
case 459:
YY_RULE_SETUP
BUFFERPUTC('\'');
- YY_BREAK
+ YY_BREAK
case 460:
YY_RULE_SETUP
BUFFERPUTC('"');
- YY_BREAK
+ YY_BREAK
/* Character entities. */
case 461:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)atoi(surf_parse_text+2));
- YY_BREAK
+ YY_BREAK
case 462:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)strtol(surf_parse_text+3,NULL,16));
- YY_BREAK
+ YY_BREAK
case 463:
/* rule 463 can match eol */
/* rule 466 can match eol */
YY_RULE_SETUP
BUFFERPUTC('\n');
- YY_BREAK
+ YY_BREAK
case 467:
YY_RULE_SETUP
ENTER(CDATA);
- YY_BREAK
+ YY_BREAK
case 468:
YY_RULE_SETUP
FAIL("Unexpected `]""]>' in character data.");
- YY_BREAK
+ YY_BREAK
case 469:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE1):
FAIL("EOF in literal (\"'\" expected).");
- YY_BREAK
+ YY_BREAK
case 470:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE2):
FAIL("EOF in literal (`\"' expected).");
- YY_BREAK
+ YY_BREAK
case 471:
/* rule 471 can match eol */
YY_RULE_SETUP
BUFFERPUTC(surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 472:
YY_RULE_SETUP
FAIL("Spurious `%c' in character data.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 473:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
-/* "]""]" BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */
+ YY_BREAK
+/* "]""]" BUFFERPUTC(surf_parse_text[0]); BUFFERPUTC(surf_parse_text[1]); */
case 474:
YY_RULE_SETUP
BUFFERPUTC(surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(CDATA):
FAIL("EOF in CDATA section.");
- YY_BREAK
+ YY_BREAK
/* Impossible rules to avoid warnings from flex(1). */
/* Ideally, this should be replaced by code in flexml.pl that
/* rule 475 can match eol */
YY_RULE_SETUP
FAIL("Syntax error on character `%c'.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 476:
YY_RULE_SETUP
ECHO;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(ROOT_surfxml_platform):
case YY_STATE_EOF(S_surfxml_platform_2):
case YY_STATE_EOF(S_surfxml_process_1):
case YY_STATE_EOF(S_surfxml_config_1):
case YY_STATE_EOF(IMPOSSIBLE):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed surf_parse_in at a new source and called
- * surf_parse_lex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = surf_parse_in;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( surf_parse_wrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * surf_parse_text, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed surf_parse_in at a new source and called
+ * surf_parse_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = surf_parse_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( surf_parse_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * surf_parse_text, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
} /* end of surf_parse_lex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- surf_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- surf_parse_restart(surf_parse_in );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) surf_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ surf_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- return ret_val;
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ surf_parse_restart(surf_parse_in );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) surf_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 2809 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 2809 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
- * next_state = yy_try_NUL_trans( current_state );
+ * next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 2809 )
- 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 == 2808);
-
- return yy_is_jam ? 0 : yy_current_state;
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 2809 )
+ 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 == 2808);
+
+ return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
#endif
{
- int c;
+ int c;
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- surf_parse_restart(surf_parse_in );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( surf_parse_wrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ surf_parse_restart(surf_parse_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( surf_parse_wrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput();
#else
- return input();
+ return input();
#endif
- }
+ }
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve surf_parse_text */
- (yy_hold_char) = *++(yy_c_buf_p);
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve surf_parse_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
- if ( c == '\n' )
-
+ if ( c == '\n' )
+
surf_parse_lineno++;
;
- return c;
+ return c;
}
-#endif /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
void surf_parse_restart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
surf_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
surf_parse__create_buffer(surf_parse_in,YY_BUF_SIZE );
- }
+ }
- surf_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
- surf_parse__load_buffer_state( );
+ surf_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
+ surf_parse__load_buffer_state( );
}
/** Switch to a different input buffer.
void surf_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * surf_parse_pop_buffer_state();
- * surf_parse_push_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * surf_parse_pop_buffer_state();
+ * surf_parse_push_buffer_state(new_buffer);
*/
- surf_parse_ensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- surf_parse__load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (surf_parse_wrap()) processing, but the only time this flag
- * is looked at is after surf_parse_wrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ surf_parse_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ surf_parse__load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (surf_parse_wrap()) processing, but the only time this flag
+ * is looked at is after surf_parse_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
}
static void surf_parse__load_buffer_state (void)
{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- surf_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ surf_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
*/
YY_BUFFER_STATE surf_parse__create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
+ b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = size;
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) surf_parse_alloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) surf_parse_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in surf_parse__create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- surf_parse__init_buffer(b,file );
+ surf_parse__init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void surf_parse__delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- surf_parse_free((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ surf_parse_free((void *) b->yy_ch_buf );
- surf_parse_free((void *) b );
+ surf_parse_free((void *) b );
}
#ifndef __cplusplus
static void surf_parse__init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- surf_parse__flush_buffer(b );
+ surf_parse__flush_buffer(b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
/* If b is the current buffer, then surf_parse__init_buffer was _probably_
* called from surf_parse_restart() or through yy_get_next_buffer.
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- errno = oerrno;
+ errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
*/
void surf_parse__flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- b->yy_n_chars = 0;
+ b->yy_n_chars = 0;
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == YY_CURRENT_BUFFER )
- surf_parse__load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ surf_parse__load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void surf_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
+ if (new_buffer == NULL)
+ return;
- surf_parse_ensure_buffer_stack();
+ surf_parse_ensure_buffer_stack();
- /* This block is copied from surf_parse__switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
+ /* This block is copied from surf_parse__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from surf_parse__switch_to_buffer. */
- surf_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ /* copied from surf_parse__switch_to_buffer. */
+ surf_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void surf_parse_pop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
+ if (!YY_CURRENT_BUFFER)
+ return;
- surf_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
+ surf_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
- if (YY_CURRENT_BUFFER) {
- surf_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (YY_CURRENT_BUFFER) {
+ surf_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void surf_parse_ensure_buffer_stack (void)
{
- int num_to_alloc;
+ int num_to_alloc;
- if (!(yy_buffer_stack)) {
+ if (!(yy_buffer_stack)) {
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_alloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_realloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)surf_parse_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in surf_parse_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
*/
YY_BUFFER_STATE surf_parse__scan_buffer (char * base, yy_size_t size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- surf_parse__switch_to_buffer(b );
-
- return b;
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) surf_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ surf_parse__switch_to_buffer(b );
+
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to surf_parse_lex() will
YY_BUFFER_STATE surf_parse__scan_string (yyconst char * yystr )
{
- return surf_parse__scan_bytes(yystr,strlen(yystr) );
+ return surf_parse__scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to surf_parse_lex() will
*/
YY_BUFFER_STATE surf_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) surf_parse_alloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) surf_parse_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in surf_parse__scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = surf_parse__scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in surf_parse__scan_bytes()" );
+ b = surf_parse__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in surf_parse__scan_bytes()" );
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
- return b;
+ return b;
}
static void yy_push_state (int new_state )
{
- if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
- {
- yy_size_t new_size;
+ if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
+ {
+ yy_size_t new_size;
- (yy_start_stack_depth) += YY_START_STACK_INCR;
- new_size = (yy_start_stack_depth) * sizeof( int );
+ (yy_start_stack_depth) += YY_START_STACK_INCR;
+ new_size = (yy_start_stack_depth) * sizeof( int );
- if ( ! (yy_start_stack) )
- (yy_start_stack) = (int *) surf_parse_alloc(new_size );
+ if ( ! (yy_start_stack) )
+ (yy_start_stack) = (int *) surf_parse_alloc(new_size );
- else
- (yy_start_stack) = (int *) surf_parse_realloc((void *) (yy_start_stack),new_size );
+ else
+ (yy_start_stack) = (int *) surf_parse_realloc((void *) (yy_start_stack),new_size );
- if ( ! (yy_start_stack) )
- YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
- }
+ if ( ! (yy_start_stack) )
+ YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
+ }
- (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
+ (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
- BEGIN(new_state);
+ BEGIN(new_state);
}
static void yy_pop_state (void)
{
- if ( --(yy_start_stack_ptr) < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
+ if ( --(yy_start_stack_ptr) < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
- BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
+ BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
}
#ifndef YY_EXIT_FAILURE
static void yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up surf_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up surf_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- surf_parse_text[surf_parse_leng] = (yy_hold_char); \
- (yy_c_buf_p) = surf_parse_text + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- surf_parse_leng = yyless_macro_arg; \
- } \
- while ( 0 )
+ surf_parse_text[surf_parse_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = surf_parse_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ surf_parse_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
{
/* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- surf_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- surf_parse_pop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ surf_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ surf_parse_pop_buffer_state();
+ }
- /* Destroy the stack itself. */
- surf_parse_free((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ surf_parse_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
/* Destroy the start condition stack. */
surf_parse_free((yy_start_stack) );
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
- return n;
+ return n;
}
#endif
void *surf_parse_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *surf_parse_realloc (void * ptr, yy_size_t size )
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
void surf_parse_free (void * ptr )
{
- free( (char *) ptr ); /* see surf_parse_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see surf_parse_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
int surfxml_element_context(int i)
{
return (0<i && i<yy_start_stack_depth
- ? yy_start_stack[yy_start_stack_ptr - i]
- : 0);
+ ? yy_start_stack[yy_start_stack_ptr - i]
+ : 0);
}
#ifdef FLEX_DEBUG
static void debug_leave(void) {
if (surf_parse__flex_debug) {
print_yy_stack("--LEAVE : ");
- print_surfxml_bufferstack();
+ print_surfxml_bufferstack();
}
yy_pop_state();
}
{
if (surfxml_statenames) {
free(surfxml_statenames);
- surfxml_statenames = NULL;
+ surfxml_statenames = NULL;
}
free(surfxml_bufferstack);
surfxml_bufferstack = NULL;
va_list ap; va_start(ap, fmt);
#ifdef FLEXML_yylineno
used = sprintf(flexml_err_msg,
- "Invalid XML (XML input line %d, state %d): ",
- surf_parse_lineno, YY_START);
+ "Invalid XML (XML input line %d, state %d): ",
+ surf_parse_lineno, YY_START);
#else
used = sprintf(flexml_err_msg,
- "Invalid XML (state %d): ",
- YY_START);
+ "Invalid XML (state %d): ",
+ YY_START);
#endif
chars_left = flexml_max_err_msg_size - used - 1;
vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
#ifdef HAVE_NS3
{"NS3",
"Network pseudo-model using the NS3 tcp model instead of an analytic model",
- surf_network_model_init_NS3},
+ surf_network_model_init_NS3},
#endif
{"Reno",
"Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
}
if (next_event_date == -1.0) {
- XBT_DEBUG("no next TRACE event. Stop searching for it");
- break;
+ XBT_DEBUG("no next TRACE event. Stop searching for it");
+ break;
}
if ((min != -1.0) && (next_event_date > NOW + min)) break;
* This may cause an infinite loop if one cpu has a trace with periodicity = 0 and the other a trace with periodicity > 0.
* The options are: all traces with same periodicity(0 or >0) or we need to change the way how the events are managed */
if (min == -1.0) {
- XBT_DEBUG("No next event at all. Bail out now.");
+ XBT_DEBUG("No next event at all. Bail out now.");
return -1.0;
}
#include "xbt/log.h"
#include "xbt/str.h"
#include "surf/surf_private.h"
-#include "surf/surf_routing.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */
+#include "surf/surf_routing.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */
#include "simgrid/simix.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
//Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
//test is if( size >= thresholdN ) return valueN;
//Values can be modified with command line --cfg=smpi/bw_factor:"threshold0:value0;threshold1:value1;...;thresholdN:valueN"
- // or with tag config put line <prop id="smpi/bw_factor" value="threshold0:value0;threshold1:value1;...;thresholdN:valueN"></prop>
+ // or with tag config put line <prop id="smpi/bw_factor" value="threshold0:value0;threshold1:value1;...;thresholdN:valueN"></prop>
xbt_cfg_register(&_surf_cfg_set, "smpi/bw_factor",
"Bandwidth factors for smpi.",
xbt_cfgelm_string, NULL, 1, 1, NULL,
*/
if((!xbt_cfg_is_default_value(_surf_cfg_set, "network/model") ||
- !xbt_cfg_is_default_value(_surf_cfg_set, "cpu/model")) &&
- xbt_cfg_is_default_value(_surf_cfg_set, "workstation/model"))
+ !xbt_cfg_is_default_value(_surf_cfg_set, "cpu/model")) &&
+ xbt_cfg_is_default_value(_surf_cfg_set, "workstation/model"))
{
- const char *val = "compound";
- XBT_INFO
- ("Switching workstation model to compound since you changed the network and/or cpu model(s)");
- xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val);
- workstation_model_name = (char *) "compound";
+ const char *val = "compound";
+ XBT_INFO
+ ("Switching workstation model to compound since you changed the network and/or cpu model(s)");
+ xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val);
+ workstation_model_name = (char *) "compound";
}
XBT_DEBUG("Workstation model: %s", workstation_model_name);
typedef struct s_as {
xbt_dynar_t index_network_elm;
- xbt_dict_t bypassRoutes; /* store bypass routes */
+ xbt_dict_t bypassRoutes; /* store bypass routes */
routing_model_description_t model_desc;
e_surf_routing_hierarchy_t hierarchy;
char *name;
route_t route, double *lat) {
s_surf_parsing_link_up_down_t info;
- XBT_DEBUG("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
- src->name,src->id,
- dst->name,dst->id);
+ XBT_DEBUG("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
+ src->name,src->id,
+ dst->name,dst->id);
- if(src->rc_type != SURF_NETWORK_ELEMENT_ROUTER){ // No specific link for router
+ if(src->rc_type != SURF_NETWORK_ELEMENT_ROUTER){ // No specific link for router
info = xbt_dynar_get_as(as->link_up_down_list,src->id,s_surf_parsing_link_up_down_t);
if(info.link_up) { // link up
xbt_dynar_push_as(route->link_list,void*,info.link_up);
if (lat)
*lat += surf_network_model->extension.network.get_link_latency(info.link_up);
}
- }
+ }
- if ( ((as_cluster_t)as)->backbone ) {
- xbt_dynar_push_as(route->link_list,void*, ((as_cluster_t)as)->backbone) ;
+ if ( ((as_cluster_t)as)->backbone ) {
+ xbt_dynar_push_as(route->link_list,void*, ((as_cluster_t)as)->backbone) ;
if (lat)
*lat += surf_network_model->extension.network.get_link_latency(((as_cluster_t)as)->backbone);
- }
+ }
- if(dst->rc_type != SURF_NETWORK_ELEMENT_ROUTER){ // No specific link for router
+ if(dst->rc_type != SURF_NETWORK_ELEMENT_ROUTER){ // No specific link for router
info = xbt_dynar_get_as(as->link_up_down_list,dst->id,s_surf_parsing_link_up_down_t);
if(info.link_down) { // link down
xbt_dynar_push_as(route->link_list,void*,info.link_down);
if (lat)
*lat += surf_network_model->extension.network.get_link_latency(info.link_down);
}
- }
+ }
}
static void model_cluster_finalize(AS_t as) {
/* *************************** FULL ROUTING ********************************* */
AS_t model_full_create(void); /* create structures for full routing model */
void model_full_end(AS_t as); /* finalize the creation of full routing model */
-void model_full_set_route( /* Set the route and ASroute between src and dst */
- AS_t rc, const char *src, const char *dst, route_t route);
+void model_full_set_route( /* Set the route and ASroute between src and dst */
+ AS_t rc, const char *src, const char *dst, route_t route);
#endif /* _SURF_SURF_ROUTING_PRIVATE_H */
* Helping functions
*/
void surf_parse_error(const char *fmt, ...) {
- va_list va;
- va_start(va,fmt);
- char *msg = bvprintf(fmt,va);
- va_end(va);
- xbt_die("Parse error at %s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg);
+ va_list va;
+ va_start(va,fmt);
+ char *msg = bvprintf(fmt,va);
+ va_end(va);
+ xbt_die("Parse error at %s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg);
}
void surf_parse_warn(const char *fmt, ...) {
- va_list va;
- va_start(va,fmt);
- char *msg = bvprintf(fmt,va);
- va_end(va);
+ va_list va;
+ va_start(va,fmt);
+ char *msg = bvprintf(fmt,va);
+ va_end(va);
XBT_WARN("%s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg);
free(msg);
}
XBT_DEBUG("ETag_surfxml_include_state '%s'",A_surfxml_include_file);
if(xbt_dynar_is_empty(surf_input_buffer_stack)) // nope, that's a true premature EOF. Let the parser die verbosely.
- return 0;
+ return 0;
// Yeah, we were in an <include> Restore state and proceed.
fclose(surf_file_to_parse);
void surf_parse_init_callbacks(void)
{
- sg_platf_init(); // FIXME: move to a proper place?
-
- STag_surfxml_route_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_route_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_link_ctn_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_link_ctn_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_process_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_process_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_argument_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_argument_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_prop_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_prop_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_trace_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_trace_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_trace_connect_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_trace_connect_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_random_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_random_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_ASroute_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_ASroute_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_bypassRoute_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_bypassRoute_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ sg_platf_init(); // FIXME: move to a proper place?
+
+ STag_surfxml_route_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_route_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_link_ctn_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_link_ctn_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_process_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_process_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_argument_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_argument_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_prop_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_prop_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_trace_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_trace_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_trace_connect_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_trace_connect_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_random_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_random_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_ASroute_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_ASroute_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_bypassRoute_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_bypassRoute_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
STag_surfxml_bypassASroute_cb_list =
xbt_dynar_new(sizeof(void_f_void_t), NULL);
ETag_surfxml_bypassASroute_cb_list =
xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_peer_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_peer_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- STag_surfxml_include_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_include_cb_list =
- xbt_dynar_new(sizeof(void_f_void_t), NULL);
-
- STag_surfxml_storage_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
- ETag_surfxml_storage_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_peer_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_peer_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ STag_surfxml_include_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_include_cb_list =
+ xbt_dynar_new(sizeof(void_f_void_t), NULL);
+
+ STag_surfxml_storage_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
+ ETag_surfxml_storage_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
STag_surfxml_storage_type_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
ETag_surfxml_storage_type_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
STag_surfxml_mount_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
void surf_parse_reset_callbacks(void)
{
- surf_parse_free_callbacks();
- surf_parse_init_callbacks();
+ surf_parse_free_callbacks();
+ surf_parse_init_callbacks();
}
void surf_parse_free_callbacks(void)
s_sg_platf_router_cbarg_t router;
memset(&router, 0, sizeof(router));
- router.id = A_surfxml_router_id;
- router.coord = A_surfxml_router_coordinates;
+ router.id = A_surfxml_router_id;
+ router.coord = A_surfxml_router_coordinates;
- sg_platf_new_router(&router);
+ sg_platf_new_router(&router);
}
void STag_surfxml_cluster(void){
s_sg_platf_cluster_cbarg_t cluster;
memset(&cluster,0,sizeof(cluster));
- cluster.id = A_surfxml_cluster_id;
- cluster.prefix = A_surfxml_cluster_prefix;
- cluster.suffix = A_surfxml_cluster_suffix;
- cluster.radical = A_surfxml_cluster_radical;
- cluster.power= surf_parse_get_double(A_surfxml_cluster_power);
- cluster.core_amount = surf_parse_get_int(A_surfxml_cluster_core);
- cluster.bw = surf_parse_get_double(A_surfxml_cluster_bw);
- cluster.lat = surf_parse_get_double(A_surfxml_cluster_lat);
- if(strcmp(A_surfxml_cluster_bb_bw,""))
- cluster.bb_bw = surf_parse_get_double(A_surfxml_cluster_bb_bw);
- if(strcmp(A_surfxml_cluster_bb_lat,""))
- cluster.bb_lat = surf_parse_get_double(A_surfxml_cluster_bb_lat);
- cluster.router_id = A_surfxml_cluster_router_id;
+ cluster.id = A_surfxml_cluster_id;
+ cluster.prefix = A_surfxml_cluster_prefix;
+ cluster.suffix = A_surfxml_cluster_suffix;
+ cluster.radical = A_surfxml_cluster_radical;
+ cluster.power= surf_parse_get_double(A_surfxml_cluster_power);
+ cluster.core_amount = surf_parse_get_int(A_surfxml_cluster_core);
+ cluster.bw = surf_parse_get_double(A_surfxml_cluster_bw);
+ cluster.lat = surf_parse_get_double(A_surfxml_cluster_lat);
+ if(strcmp(A_surfxml_cluster_bb_bw,""))
+ cluster.bb_bw = surf_parse_get_double(A_surfxml_cluster_bb_bw);
+ if(strcmp(A_surfxml_cluster_bb_lat,""))
+ cluster.bb_lat = surf_parse_get_double(A_surfxml_cluster_bb_lat);
+ cluster.router_id = A_surfxml_cluster_router_id;
switch (AX_surfxml_cluster_sharing_policy) {
case A_surfxml_cluster_sharing_policy_SHARED:
break;
}
- cluster.availability_trace = A_surfxml_cluster_availability_file;
- cluster.state_trace = A_surfxml_cluster_state_file;
- sg_platf_new_cluster(&cluster);
+ cluster.availability_trace = A_surfxml_cluster_availability_file;
+ cluster.state_trace = A_surfxml_cluster_state_file;
+ sg_platf_new_cluster(&cluster);
}
void ETag_surfxml_cluster(void){
/* nothing I can think of */
void STag_surfxml_peer(void){
s_sg_platf_peer_cbarg_t peer;
memset(&peer,0,sizeof(peer));
- peer.id = A_surfxml_peer_id;
- peer.power = surf_parse_get_double(A_surfxml_peer_power);
- peer.bw_in = surf_parse_get_double(A_surfxml_peer_bw_in);
- peer.bw_out = surf_parse_get_double(A_surfxml_peer_bw_out);
- peer.lat = surf_parse_get_double(A_surfxml_peer_lat);
- peer.coord = A_surfxml_peer_coordinates;
- peer.availability_trace = tmgr_trace_new_from_file(A_surfxml_peer_availability_file);
- peer.state_trace = tmgr_trace_new_from_file(A_surfxml_peer_state_file);
-
- surfxml_call_cb_functions(STag_surfxml_peer_cb_list);
- sg_platf_new_peer(&peer);
+ peer.id = A_surfxml_peer_id;
+ peer.power = surf_parse_get_double(A_surfxml_peer_power);
+ peer.bw_in = surf_parse_get_double(A_surfxml_peer_bw_in);
+ peer.bw_out = surf_parse_get_double(A_surfxml_peer_bw_out);
+ peer.lat = surf_parse_get_double(A_surfxml_peer_lat);
+ peer.coord = A_surfxml_peer_coordinates;
+ peer.availability_trace = tmgr_trace_new_from_file(A_surfxml_peer_availability_file);
+ peer.state_trace = tmgr_trace_new_from_file(A_surfxml_peer_state_file);
+
+ surfxml_call_cb_functions(STag_surfxml_peer_cb_list);
+ sg_platf_new_peer(&peer);
}
void ETag_surfxml_peer(void){
/* nothing to do here */
}
void STag_surfxml_route(void){
- surfxml_call_cb_functions(STag_surfxml_route_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_route_cb_list);
}
void STag_surfxml_link_ctn(void){
- surfxml_call_cb_functions(STag_surfxml_link_ctn_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_link_ctn_cb_list);
}
void STag_surfxml_process(void){
- surfxml_call_cb_functions(STag_surfxml_process_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_process_cb_list);
}
void STag_surfxml_argument(void){
- surfxml_call_cb_functions(STag_surfxml_argument_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_argument_cb_list);
}
void STag_surfxml_prop(void){
- surfxml_call_cb_functions(STag_surfxml_prop_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_prop_cb_list);
}
void STag_surfxml_trace(void){
- surfxml_call_cb_functions(STag_surfxml_trace_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_trace_cb_list);
}
void STag_surfxml_trace_connect(void){
- surfxml_call_cb_functions(STag_surfxml_trace_connect_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_trace_connect_cb_list);
}
void STag_surfxml_AS(void){
sg_platf_new_AS_begin(A_surfxml_AS_id,A_surfxml_AS_routing);
sg_platf_new_AS_end();
}
void STag_surfxml_ASroute(void){
- surfxml_call_cb_functions(STag_surfxml_ASroute_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_ASroute_cb_list);
}
void STag_surfxml_bypassRoute(void){
- surfxml_call_cb_functions(STag_surfxml_bypassRoute_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_bypassRoute_cb_list);
}
void STag_surfxml_bypassASroute(void){
surfxml_call_cb_functions(STag_surfxml_bypassASroute_cb_list);
xbt_dict_free(¤t_property_set);
}
void STag_surfxml_random(void){
- surfxml_call_cb_functions(STag_surfxml_random_cb_list);
+ surfxml_call_cb_functions(STag_surfxml_random_cb_list);
}
#define parse_method(type,name) \
i++))) {
constraint_id = lmm_constraint_id(cnst);
-/* if(((link_L07_t)constraint_id)->type== */
-/* SURF_WORKSTATION_RESOURCE_LINK) { */
-/* XBT_DEBUG("Checking for link %s (%p)", */
-/* ((link_L07_t)constraint_id)->name, */
-/* ((link_L07_t)constraint_id)); */
-/* } */
-/* if(((cpu_L07_t)constraint_id)->type== */
-/* SURF_WORKSTATION_RESOURCE_CPU) { */
-/* XBT_DEBUG("Checking for cpu %s (%p) : %s", */
-/* ((cpu_L07_t)constraint_id)->name, */
-/* ((cpu_L07_t)constraint_id), */
-/* ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
-/* } */
+/* if(((link_L07_t)constraint_id)->type== */
+/* SURF_WORKSTATION_RESOURCE_LINK) { */
+/* XBT_DEBUG("Checking for link %s (%p)", */
+/* ((link_L07_t)constraint_id)->name, */
+/* ((link_L07_t)constraint_id)); */
+/* } */
+/* if(((cpu_L07_t)constraint_id)->type== */
+/* SURF_WORKSTATION_RESOURCE_CPU) { */
+/* XBT_DEBUG("Checking for cpu %s (%p) : %s", */
+/* ((cpu_L07_t)constraint_id)->name, */
+/* ((cpu_L07_t)constraint_id), */
+/* ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
+/* } */
if (((((link_L07_t) constraint_id)->type ==
SURF_WORKSTATION_RESOURCE_LINK) &&
static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host)
{
ptask_cpu_create_resource(
- host->id,
- host->power_peak,
- host->power_scale,
- host->power_trace,
- host->initial_state,
- host->state_trace,
- host->properties);
+ host->id,
+ host->power_peak,
+ host->power_scale,
+ host->power_trace,
+ host->initial_state,
+ host->state_trace,
+ host->properties);
}
static void* ptask_link_create_resource(const char *name,
xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_L07_t link =
- xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert(link, "Link %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_L07_t link =
- xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert(link, "Link %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
link_L07_t link =
- xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
+ xbt_lib_get_or_null(link_lib, elm, SURF_LINK_LEVEL);
xbt_assert(link, "Link %s undefined", elm);
xbt_assert(trace, "Trace %s undefined", trace_name);
/* Defined if the compiler has the <errno.h> header file. */
#if !defined(HAVE_ERRNO_H)
-#define HAVE_ERRNO_H 1
+#define HAVE_ERRNO_H 1
#endif
/* No <execinfo.h> header file. */
/* Defined if compiler has the <memory.h> header file. */
#if !defined(HAVE_MEMORY_H)
-#define HAVE_MEMORY_H 1
+#define HAVE_MEMORY_H 1
#endif
/* No <pthread.h> header file. */
/* The compiler has the <stdlib.h> header file. */
#if !defined(HAVE_STDLIB_H)
-#define HAVE_STDLIB_H 1
+#define HAVE_STDLIB_H 1
#endif
/* No <strings.h> header file. */
/* The compiler has the <string.h> header file. */
#if !defined(HAVE_STRING_H)
-#define HAVE_STRING_H 1
+#define HAVE_STRING_H 1
#endif
/* No <sys/socket.h> header file. */
/* The compiler has <sys/stat.h> header file. */
#if !defined(HAVE_SYS_STAT_H)
-#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_STAT_H 1
#endif
/* No <sys/time.h> header file. */
#if defined(HAVE_SYS_TIME_H)
-#undef HAVE_SYS_TIME_H 1
+#undef HAVE_SYS_TIME_H 1
#endif
/* The compiler has the <sys/types.h> header file. */
#if !defined(HAVE_SYS_TYPES_H)
-#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_TYPES_H 1
#endif
/* No <unistd.h> header file. */
* Process the case of afx.h
*/
#if !defined(HAVE_WINDOWS_H)
-#define HAVE_WINDOWS_H 1
+#define HAVE_WINDOWS_H 1
#endif
/* The compiler has the <winsock2.h> header file. */
* Trouble if winsock2.h exists ?
*/
#if !defined(HAVE_WINSOCK_H)
-#define HAVE_WINSOCK_H 1
+#define HAVE_WINSOCK_H 1
#endif
/* The compiler has the <signal.h> header file */
#if !defined(HAVE_SIGNAL_H)
-#define HAVE_SIGNAL_H 1
+#define HAVE_SIGNAL_H 1
#endif
/*
/* The compiler has `snprintf' function. */
#if !defined(HAVE_SNPRINTF)
-#define HAVE_SNPRINTF 1
+#define HAVE_SNPRINTF 1
#endif
/* No `swapcontext' function. */
/* The compiler has the `vsnprintf' function. */
#if !defined(HAVE_VSNPRINTF)
-#define HAVE_VSNPRINTF 1
+#define HAVE_VSNPRINTF 1
#endif
/* enable the asprintf replacement */
#if !defined(NEED_ASPRINTF)
-#define NEED_ASPRINTF 1
+#define NEED_ASPRINTF 1
#endif
/*#ifdef NEED_ASPRINTF
/* enable the vasprintf replacement */
#if !defined(NEED_VASPRINTF)
-#define NEED_VASPRINTF 1
+#define NEED_VASPRINTF 1
#endif
/* "disable the snprintf replacement ( this function is broken on system v only" */
/* Borland compilers */
#if defined (__BORLANDC__)
-#define _XBT_COMPILER_NAME "Borland C/C++"
+#define _XBT_COMPILER_NAME "Borland C/C++"
#define _XBT_COMPILER_VENDOR "Inprise Corporation"
-#define _XBT_BORLAND_COMPILER 2
+#define _XBT_BORLAND_COMPILER 2
/* version macro : __BORLANDC__ */
/* version format : ? */
-#define _XBT_COMPILER_VERSION __BORLANDC__
-#define _XBT_COMPILER_VERSION_FORMAT "?"
+#define _XBT_COMPILER_VERSION __BORLANDC__
+#define _XBT_COMPILER_VERSION_FORMAT "?"
#undef _XBT_COMPILER_RESOLVED
#define _XBT_COMPILER_RESOLVED 1
#define __GNUC_VERSION__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
#endif
-#define _XBT_COMPILER_NAME "GCC"
+#define _XBT_COMPILER_NAME "GCC"
#define _XBT_COMPILER_VENDOR "GNU"
-#define _XBT_GCC_COMPILER 2
+#define _XBT_GCC_COMPILER 2
/* version macro : __GNUC_VERSION__ */
/* version format : VVRRPP (VV = Version, RR = Revision, PP = Patch) */
-#define _XBT_COMPILER_VERSION __GNUC_VERSION__
-#define _XBT_COMPILER_VERSION_FORMAT "VVRRPP (VV = Version, RR = Revision, PP = Patch)"
+#define _XBT_COMPILER_VERSION __GNUC_VERSION__
+#define _XBT_COMPILER_VERSION_FORMAT "VVRRPP (VV = Version, RR = Revision, PP = Patch)"
#undef _XBT_COMPILER_RESOLVED
#define _XBT_COMPILER_RESOLVED 1
/* Returns the compiler name. */
-#define _xbt_get_compiler_name() _XBT_COMPILER_NAME
+#define _xbt_get_compiler_name() _XBT_COMPILER_NAME
/* Returns the compiler vendor. */
-#define _xbt_get_compiler_vendor() _XBT_COMPILER_VENDOR
+#define _xbt_get_compiler_vendor() _XBT_COMPILER_VENDOR
/* Returns 1 if the compiler is resolved (0 in the other case). */
-#define _xbt_is_compiler_resolved() _XBT_COMPILER_RESOLVED
+#define _xbt_is_compiler_resolved() _XBT_COMPILER_RESOLVED
/* Returns the compiler version. */
-#define _xbt_get_compiler_version() _XBT_STRINGIZE(_XBT_COMPILER_VERSION)
+#define _xbt_get_compiler_version() _XBT_STRINGIZE(_XBT_COMPILER_VERSION)
/* Returns the compiler version format. */
-#define _xbt_get_compiler_version_format() _XBT_COMPILER_VERSION_FORMAT
+#define _xbt_get_compiler_version_format() _XBT_COMPILER_VERSION_FORMAT
/* Defined if the compiler has the <errno.h> header file. */
#if !defined(HAVE_ERRNO_H)
-#define HAVE_ERRNO_H 1
+#define HAVE_ERRNO_H 1
#endif
/* No <execinfo.h> header file. */
/* Defined if compiler has the <memory.h> header file. */
#if !defined(HAVE_MEMORY_H)
-#define HAVE_MEMORY_H 1
+#define HAVE_MEMORY_H 1
#endif
/* No <pthread.h> header file. */
/* The compiler has the <stdlib.h> header file. */
#if !defined(HAVE_STDLIB_H)
-#define HAVE_STDLIB_H 1
+#define HAVE_STDLIB_H 1
#endif
/* No <strings.h> header file. */
/* The compiler has the <string.h> header file. */
#if !defined(HAVE_STRING_H)
-#define HAVE_STRING_H 1
+#define HAVE_STRING_H 1
#endif
/* No <sys/socket.h> header file. */
/* The compiler has <sys/stat.h> header file. */
#if !defined(HAVE_SYS_STAT_H)
-#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_STAT_H 1
#endif
/* No <sys/time.h> header file. */
#if defined(HAVE_SYS_TIME_H)
-#undef HAVE_SYS_TIME_H 1
+#undef HAVE_SYS_TIME_H 1
#endif
/* The compiler has the <sys/types.h> header file. */
#if !defined(HAVE_SYS_TYPES_H)
-#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_TYPES_H 1
#endif
/* No <unistd.h> header file. */
/* The compiler has the <signal.h> header file */
#if !defined(HAVE_SIGNAL_H)
-#define HAVE_SIGNAL_H 1
+#define HAVE_SIGNAL_H 1
#endif
/*
#ifdef PREFER_PORTABLE_SNPRINTF
-# undef PREFER_PORTABLE_SNPRINTF 1
+# undef PREFER_PORTABLE_SNPRINTF 1
#endif
/* The compiler has `snprintf' function. */
#if _MSC_VER >= 1400
# ifndef HAVE_SNPRINTF
-# define HAVE_SNPRINTF 1
+# define HAVE_SNPRINTF 1
# ifndef PREFER_PORTABLE_SNPRINTF
# define snprintf _snprintf
# endif
/* The compiler has the `vsnprintf' function. */
#ifndef HAVE_VSNPRINTF
-#define HAVE_VSNPRINTF 1
+#define HAVE_VSNPRINTF 1
#endif
#endif
typedef int socklen_t;
-#define tcp_read( s, buf, len ) recv( s, buf, len, 0 )
-#define tcp_write( s, buf, len ) send( s, buf, len, 0 )
-#define ioctl( s, c, a ) ioctlsocket( (s), (c), (a) )
-#define ioctl_t u_long
-#define AC_SOCKET_INVALID ((unsigned int) ~0)
+#define tcp_read( s, buf, len ) recv( s, buf, len, 0 )
+#define tcp_write( s, buf, len ) send( s, buf, len, 0 )
+#define ioctl( s, c, a ) ioctlsocket( (s), (c), (a) )
+#define ioctl_t u_long
+#define AC_SOCKET_INVALID ((unsigned int) ~0)
#ifdef SD_BOTH
-#define tcp_close(s) (shutdown( s, SD_BOTH ), closesocket(s))
+#define tcp_close(s) (shutdown( s, SD_BOTH ), closesocket(s))
#else
-#define tcp_close( s ) closesocket( s )
+#define tcp_close( s ) closesocket( s )
#endif
#ifndef _XBT_VISUALC_COMPILER
*/
/* If the platform is not resolved _XBT_PLATFORM_ID is set to zero. */
-#define _XBT_PLATFORM_ID 0
+#define _XBT_PLATFORM_ID 0
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__TOS_WIN__)
#undef _XBT_PLATFORM_ID
-#define _XBT_WIN32_PLATFORM 1
-#define _XBT_PLATFORM_ID _XBT_WIN32_PLATFORM
-#define _XBT_PLATFORM_NAME "Windows 32 bits platform"
+#define _XBT_WIN32_PLATFORM 1
+#define _XBT_PLATFORM_ID _XBT_WIN32_PLATFORM
+#define _XBT_PLATFORM_NAME "Windows 32 bits platform"
/*
* win64.
*/
#undef _XBT_WIN32_PLATFORM
#endif
-#define _XBT_PLATFORM_NAME "Windows 64 bits platform"
-#define _XBT_WIN64_PLATFORM 2
-#define _XBT_PLATFORM_ID _XBT_WIN64_PLATFORM
+#define _XBT_PLATFORM_NAME "Windows 64 bits platform"
+#define _XBT_WIN64_PLATFORM 2
+#define _XBT_PLATFORM_ID _XBT_WIN64_PLATFORM
/*
* win16.
*/
#elif defined(_WIN16)
#undef _XBT_PLATFORM_ID
-#define _XBT_WIN16_PLATFORM 3
-#define _XBT_PLATFORM_NAME "Windows 16 bits platform"
-#define _XBT_PLATFORM_ID _XBT_WIN16_PLATFORM
+#define _XBT_WIN16_PLATFORM 3
+#define _XBT_PLATFORM_NAME "Windows 16 bits platform"
+#define _XBT_PLATFORM_ID _XBT_WIN16_PLATFORM
/*
* wince.
*/
#elif defined(UNDER_CE)
#undef _XBT_PLATFORM_ID
-#define __XBT_WINCE_PLATFORM 4
-#define _XBT_PLATFORM_ID _XBT_WINCE_PLATFORM
-#define _XBT_PLATFORM_NAME "Windows CE bits platform"
+#define __XBT_WINCE_PLATFORM 4
+#define _XBT_PLATFORM_ID _XBT_WINCE_PLATFORM
+#define _XBT_PLATFORM_NAME "Windows CE bits platform"
#elif defined(linux) || defined(__linux) || defined(__linux__)
/* linux. */
#undef _XBT_PLATFORM_ID
-#define __XBT_LINUX_PLATFORM 5
-#define _XBT_PLATFORM_ID _XBT_LINUX_PLATFORM
-#define _XBT_PLATFORM_NAME "Linux platform"
+#define __XBT_LINUX_PLATFORM 5
+#define _XBT_PLATFORM_ID _XBT_LINUX_PLATFORM
+#define _XBT_PLATFORM_NAME "Linux platform"
#elif defined (_XBT_ASSERT_CONFIG)
// This must come last - generate an error if we don't
/* Returns true if the platform is resolved, false in the other case. */
-#define _xbt_is_platform_resolved() (_XBT_PLATFORM_ID != 0)
+#define _xbt_is_platform_resolved() (_XBT_PLATFORM_ID != 0)
/* Returns the platform name. */
-#define _xbt_get_platform_name() _XBT_PLATFORM_NAME
+#define _xbt_get_platform_name() _XBT_PLATFORM_NAME
/* Returns the platform id. */
-#define _xbt_get_platform_id() _XBT_PLATFORM_ID
+#define _xbt_get_platform_id() _XBT_PLATFORM_ID
/* Returns true if the platform is Windows 32 bits. */
-#define _xbt_is_win32() (_XBT_PLATFORM_ID == 1)
+#define _xbt_is_win32() (_XBT_PLATFORM_ID == 1)
/* Returns true if the platform is Windows 64 bits. */
-#define _xbt_is_win64() (_XBT_PLATFORM_ID == 2)
+#define _xbt_is_win64() (_XBT_PLATFORM_ID == 2)
/* Returns true if the platform is Windows 16 bits. */
-#define _xbt_is_win16() (_XBT_PLATFORM_ID == 3)
+#define _xbt_is_win16() (_XBT_PLATFORM_ID == 3)
/* Returns true if the platform is Windows CE. */
-#define _xbt_is_wince() (_XBT_PLATFORM_ID == 4)
+#define _xbt_is_wince() (_XBT_PLATFORM_ID == 4)
/* Returns true if the platform is linux. */
-#define _xbt_is_linux() (_XBT_PLATFORM_ID == 5)
+#define _xbt_is_linux() (_XBT_PLATFORM_ID == 5)
* Language: ANSI C
* Copyright: Pierre L'Ecuyer, University of Montreal
* Date: 14 August 2001
- * License: GPL version 2 or later
+ * License: GPL version 2 or later
*
* Notice: Please contact P. L'Ecuyer at <lecuyer@iro.UMontreal.ca>
* for commercial purposes.
for (i = 0; i < 3; ++i) {
if (seed[i] >= m1) {
- fprintf (stderr, "****************************************\n"
- "ERROR: Seed[%1d] >= m1, Seed is not set.\n"
- "****************************************\n\n", i);
- return (-1);
+ fprintf (stderr, "****************************************\n"
+ "ERROR: Seed[%1d] >= m1, Seed is not set.\n"
+ "****************************************\n\n", i);
+ return (-1);
}
}
for (i = 3; i < 6; ++i) {
if (seed[i] >= m2) {
- fprintf (stderr, "****************************************\n"
- "ERROR: Seed[%1d] >= m1, Seed is not set.\n"
- "****************************************\n\n", i);
- return (-1);
+ fprintf (stderr, "****************************************\n"
+ "ERROR: Seed[%1d] >= m1, Seed is not set.\n"
+ "****************************************\n\n", i);
+ return (-1);
}
}
if (seed[0] == 0 && seed[1] == 0 && seed[2] == 0) {
fprintf (stderr, "****************************\n"
- "ERROR: First 3 seeds = 0.\n"
- "****************************\n\n");
+ "ERROR: First 3 seeds = 0.\n"
+ "****************************\n\n");
return (-1);
}
if (seed[3] == 0 && seed[4] == 0 && seed[5] == 0) {
fprintf (stderr, "****************************\n"
- "ERROR: Last 3 seeds = 0.\n"
- "****************************\n\n");
+ "ERROR: Last 3 seeds = 0.\n"
+ "****************************\n\n");
return (-1);
}
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
-#else /* ! __cplusplus */
+#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up xbt_automaton_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_automaton_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parse_text again */ \
- } \
- while ( 0 )
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parse_text again */ \
+ } \
+ while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
- int yy_buffer_status;
+ int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via xbt_automaton_parse_restart()), so that the user can continue scanning by
- * just pointing xbt_automaton_parse_in at a new input file.
- */
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via xbt_automaton_parse_restart()), so that the user can continue scanning by
+ * just pointing xbt_automaton_parse_in at a new input file.
+ */
#define YY_BUFFER_EOF_PENDING 2
- };
+ };
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
/* yy_hold_char holds the character lost when xbt_automaton_parse_text is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
int xbt_automaton_parse_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
/* Flag which is used to allow xbt_automaton_parse_wrap()'s to do buffer switches
* instead of setting up a fresh xbt_automaton_parse_in. A bit of a hack ...
#define yy_new_buffer xbt_automaton_parse__create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
xbt_automaton_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
xbt_automaton_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
* corresponding action - sets up xbt_automaton_parse_text.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- xbt_automaton_parse_leng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp; \
+ xbt_automaton_parse_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 25
#define YY_END_OF_BUFFER 26
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
static yyconst flex_int16_t yy_accept[54] =
{ 0,
0, 0, 26, 24, 18, 23, 8, 24, 24, 9,
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- size_t n; \
- for ( n = 0; n < max_size && \
- (c = getc( xbt_automaton_parse_in )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( xbt_automaton_parse_in ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, xbt_automaton_parse_in))==0 && ferror(xbt_automaton_parse_in)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(xbt_automaton_parse_in); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( xbt_automaton_parse_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( xbt_automaton_parse_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, xbt_automaton_parse_in))==0 && ferror(xbt_automaton_parse_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(xbt_automaton_parse_in); \
+ } \
+ }\
\
#endif
#endif
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
#line 28 "parserPromela.lex"
#line 723 "automaton_parse.yy.c"
- if ( !(yy_init) )
- {
- (yy_init) = 1;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
#ifdef YY_USER_INIT
- YY_USER_INIT;
+ YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! xbt_automaton_parse_in )
- xbt_automaton_parse_in = stdin;
+ if ( ! xbt_automaton_parse_in )
+ xbt_automaton_parse_in = stdin;
- if ( ! xbt_automaton_parse_out )
- xbt_automaton_parse_out = stdout;
+ if ( ! xbt_automaton_parse_out )
+ xbt_automaton_parse_out = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- xbt_automaton_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ xbt_automaton_parse_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE );
+ }
- xbt_automaton_parse__load_buffer_state( );
- }
+ xbt_automaton_parse__load_buffer_state( );
+ }
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
- /* Support of xbt_automaton_parse_text. */
- *yy_cp = (yy_hold_char);
+ /* Support of xbt_automaton_parse_text. */
+ *yy_cp = (yy_hold_char);
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = (yy_start);
yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 54 )
- 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] != 90 );
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 54 )
+ 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] != 90 );
yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-do_action: /* This label is used only to access EOF actions. */
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
case 1:
YY_RULE_SETUP
#line 30 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (NEVER); }
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
#line 31 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (IF); }
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
#line 32 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text);
return (FI); }
- YY_BREAK
+ YY_BREAK
case 4:
YY_RULE_SETUP
#line 34 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (IMPLIES); }
- YY_BREAK
+ YY_BREAK
case 5:
YY_RULE_SETUP
#line 35 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (GOTO); }
- YY_BREAK
+ YY_BREAK
case 6:
YY_RULE_SETUP
#line 36 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (AND); }
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
#line 37 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (OR); }
- YY_BREAK
+ YY_BREAK
case 8:
YY_RULE_SETUP
#line 38 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (NOT); }
- YY_BREAK
+ YY_BREAK
case 9:
YY_RULE_SETUP
#line 39 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (LEFT_PAR); }
- YY_BREAK
+ YY_BREAK
case 10:
YY_RULE_SETUP
#line 40 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (RIGHT_PAR); }
- YY_BREAK
+ YY_BREAK
case 11:
YY_RULE_SETUP
#line 41 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (CASE); }
- YY_BREAK
+ YY_BREAK
case 12:
YY_RULE_SETUP
#line 42 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (COLON); }
- YY_BREAK
+ YY_BREAK
case 13:
YY_RULE_SETUP
#line 43 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (SEMI_COLON); }
- YY_BREAK
+ YY_BREAK
case 14:
YY_RULE_SETUP
#line 44 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (CASE_TRUE); }
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
#line 45 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (LEFT_BRACE); }
- YY_BREAK
+ YY_BREAK
case 16:
YY_RULE_SETUP
#line 46 "parserPromela.lex"
{ printf("%s", xbt_automaton_parse_text); return (RIGHT_BRACE); }
- YY_BREAK
+ YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 49 "parserPromela.lex"
{ printf(" ");}
- YY_BREAK
+ YY_BREAK
case 18:
YY_RULE_SETUP
#line 51 "parserPromela.lex"
{ printf("%s",xbt_automaton_parse_text); }
- YY_BREAK
+ YY_BREAK
case 19:
YY_RULE_SETUP
#line 54 "parserPromela.lex"
{ printf("%s",xbt_automaton_parse_text);
sscanf(xbt_automaton_parse_text,"%lf",&yylval.real);
return (LITT_REEL); }
- YY_BREAK
+ YY_BREAK
case 20:
YY_RULE_SETUP
#line 58 "parserPromela.lex"
{ printf("%s",xbt_automaton_parse_text);
sscanf(xbt_automaton_parse_text,"%d",&yylval.integer);
return (LITT_ENT); }
- YY_BREAK
+ YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
yylval.string=(char *)malloc(strlen(xbt_automaton_parse_text)+1);
sscanf(xbt_automaton_parse_text,"%s",yylval.string);
return (LITT_CHAINE); }
- YY_BREAK
+ YY_BREAK
case 22:
YY_RULE_SETUP
#line 67 "parserPromela.lex"
{ printf("%s",xbt_automaton_parse_text);
- yylval.string=(char *)malloc(strlen(xbt_automaton_parse_text)+1);
- sscanf(xbt_automaton_parse_text,"%s",yylval.string);
- return (ID); }
- YY_BREAK
+ yylval.string=(char *)malloc(strlen(xbt_automaton_parse_text)+1);
+ sscanf(xbt_automaton_parse_text,"%s",yylval.string);
+ return (ID); }
+ YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
#line 72 "parserPromela.lex"
{ printf("\n"); }
- YY_BREAK
+ YY_BREAK
case 24:
YY_RULE_SETUP
#line 74 "parserPromela.lex"
{ printf("caractère inconnu\n"); }
- YY_BREAK
+ YY_BREAK
case 25:
YY_RULE_SETUP
#line 76 "parserPromela.lex"
ECHO;
- YY_BREAK
+ YY_BREAK
#line 945 "automaton_parse.yy.c"
case YY_STATE_EOF(INITIAL):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed xbt_automaton_parse_in at a new source and called
- * xbt_automaton_parse_lex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parse_in;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( xbt_automaton_parse_wrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * xbt_automaton_parse_text, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed xbt_automaton_parse_in at a new source and called
+ * xbt_automaton_parse_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parse_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( xbt_automaton_parse_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * xbt_automaton_parse_text, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
} /* end of xbt_automaton_parse_lex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- xbt_automaton_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- xbt_automaton_parse_restart(xbt_automaton_parse_in );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ xbt_automaton_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- return ret_val;
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ xbt_automaton_parse_restart(xbt_automaton_parse_in );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 54 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 54 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
- * next_state = yy_try_NUL_trans( current_state );
+ * next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 54 )
- 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 == 53);
-
- return yy_is_jam ? 0 : yy_current_state;
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 54 )
+ 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 == 53);
+
+ return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
{
- register char *yy_cp;
+ register char *yy_cp;
yy_cp = (yy_c_buf_p);
- /* undo effects of setting up xbt_automaton_parse_text */
- *yy_cp = (yy_hold_char);
+ /* undo effects of setting up xbt_automaton_parse_text */
+ *yy_cp = (yy_hold_char);
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
- *--yy_cp = (char) c;
+ *--yy_cp = (char) c;
- (yytext_ptr) = yy_bp;
- (yy_hold_char) = *yy_cp;
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
}
#ifndef YY_NO_INPUT
#endif
{
- int c;
+ int c;
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- xbt_automaton_parse_restart(xbt_automaton_parse_in );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( xbt_automaton_parse_wrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ xbt_automaton_parse_restart(xbt_automaton_parse_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( xbt_automaton_parse_wrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput();
#else
- return input();
+ return input();
#endif
- }
+ }
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parse_text */
- (yy_hold_char) = *++(yy_c_buf_p);
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parse_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
- return c;
+ return c;
}
-#endif /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
void xbt_automaton_parse_restart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
xbt_automaton_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE );
- }
+ }
- xbt_automaton_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
- xbt_automaton_parse__load_buffer_state( );
+ xbt_automaton_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
+ xbt_automaton_parse__load_buffer_state( );
}
/** Switch to a different input buffer.
void xbt_automaton_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * xbt_automaton_parse_pop_buffer_state();
- * xbt_automaton_parse_push_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * xbt_automaton_parse_pop_buffer_state();
+ * xbt_automaton_parse_push_buffer_state(new_buffer);
*/
- xbt_automaton_parse_ensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- xbt_automaton_parse__load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (xbt_automaton_parse_wrap()) processing, but the only time this flag
- * is looked at is after xbt_automaton_parse_wrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ xbt_automaton_parse_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ xbt_automaton_parse__load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (xbt_automaton_parse_wrap()) processing, but the only time this flag
+ * is looked at is after xbt_automaton_parse_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
}
static void xbt_automaton_parse__load_buffer_state (void)
{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- xbt_automaton_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ xbt_automaton_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
*/
YY_BUFFER_STATE xbt_automaton_parse__create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) xbt_automaton_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__create_buffer()" );
+ b = (YY_BUFFER_STATE) xbt_automaton_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = size;
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) xbt_automaton_parse_alloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__create_buffer()" );
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) xbt_automaton_parse_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- xbt_automaton_parse__init_buffer(b,file );
+ xbt_automaton_parse__init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void xbt_automaton_parse__delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- xbt_automaton_parse_free((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ xbt_automaton_parse_free((void *) b->yy_ch_buf );
- xbt_automaton_parse_free((void *) b );
+ xbt_automaton_parse_free((void *) b );
}
#ifndef __cplusplus
static void xbt_automaton_parse__init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- xbt_automaton_parse__flush_buffer(b );
+ xbt_automaton_parse__flush_buffer(b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
/* If b is the current buffer, then xbt_automaton_parse__init_buffer was _probably_
* called from xbt_automaton_parse_restart() or through yy_get_next_buffer.
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- errno = oerrno;
+ errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
*/
void xbt_automaton_parse__flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- b->yy_n_chars = 0;
+ b->yy_n_chars = 0;
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == YY_CURRENT_BUFFER )
- xbt_automaton_parse__load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ xbt_automaton_parse__load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void xbt_automaton_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
-
- xbt_automaton_parse_ensure_buffer_stack();
-
- /* This block is copied from xbt_automaton_parse__switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
- /* copied from xbt_automaton_parse__switch_to_buffer. */
- xbt_automaton_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ if (new_buffer == NULL)
+ return;
+
+ xbt_automaton_parse_ensure_buffer_stack();
+
+ /* This block is copied from xbt_automaton_parse__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from xbt_automaton_parse__switch_to_buffer. */
+ xbt_automaton_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void xbt_automaton_parse_pop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
-
- xbt_automaton_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
-
- if (YY_CURRENT_BUFFER) {
- xbt_automaton_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ xbt_automaton_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ xbt_automaton_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void xbt_automaton_parse_ensure_buffer_stack (void)
{
- int num_to_alloc;
+ int num_to_alloc;
- if (!(yy_buffer_stack)) {
+ if (!(yy_buffer_stack)) {
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parse_alloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse_ensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parse_realloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse_ensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parse_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse_ensure_buffer_stack()" );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parse_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
*/
YY_BUFFER_STATE xbt_automaton_parse__scan_buffer (char * base, yy_size_t size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) xbt_automaton_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- xbt_automaton_parse__switch_to_buffer(b );
-
- return b;
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) xbt_automaton_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ xbt_automaton_parse__switch_to_buffer(b );
+
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to xbt_automaton_parse_lex() will
YY_BUFFER_STATE xbt_automaton_parse__scan_string (yyconst char * yystr )
{
- return xbt_automaton_parse__scan_bytes(yystr,strlen(yystr) );
+ return xbt_automaton_parse__scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parse_lex() will
*/
YY_BUFFER_STATE xbt_automaton_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) xbt_automaton_parse_alloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) xbt_automaton_parse_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = xbt_automaton_parse__scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in xbt_automaton_parse__scan_bytes()" );
+ b = xbt_automaton_parse__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in xbt_automaton_parse__scan_bytes()" );
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
- return b;
+ return b;
}
#ifndef YY_EXIT_FAILURE
static void yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up xbt_automaton_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_automaton_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- xbt_automaton_parse_text[xbt_automaton_parse_leng] = (yy_hold_char); \
- (yy_c_buf_p) = xbt_automaton_parse_text + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- xbt_automaton_parse_leng = yyless_macro_arg; \
- } \
- while ( 0 )
+ xbt_automaton_parse_text[xbt_automaton_parse_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = xbt_automaton_parse_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ xbt_automaton_parse_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
{
/* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- xbt_automaton_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- xbt_automaton_parse_pop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ xbt_automaton_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ xbt_automaton_parse_pop_buffer_state();
+ }
- /* Destroy the stack itself. */
- xbt_automaton_parse_free((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ xbt_automaton_parse_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* xbt_automaton_parse_lex() is called, initialization will occur. */
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
- return n;
+ return n;
}
#endif
void *xbt_automaton_parse_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *xbt_automaton_parse_realloc (void * ptr, yy_size_t size )
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
void xbt_automaton_parse_free (void * ptr )
{
- free( (char *) ptr ); /* see xbt_automaton_parse_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see xbt_automaton_parse_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
# endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
while (YYID (0))
#endif
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
while (YYID (0))
# endif
# endif
#define YYUNDEFTOK 2
#define YYMAXUTOK 277
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
22, 27
};
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
/* Like YYERROR except do call yyerror. This remains here temporarily
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
-#define YYFAIL goto yyerrlab
+#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (1); \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
+ YYERROR; \
+ } \
while (YYID (0))
-#define YYTERROR 1
-#define YYERRCODE 256
+#define YYTERROR 1
+#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
while (YYID (0))
#endif
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
} while (YYID (0))
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
} while (YYID (0))
switch (yytype)
{
default:
- break;
+ break;
}
}
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
} while (YYID (0))
int yyi;
unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
+ yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
char const *yyp = yystr;
for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
do_not_strip_quotes: ;
}
{
default:
- break;
+ break;
}
}
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
- error, discard it. */
+ error, discard it. */
if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
}
/* Else will try to reuse lookahead token after shifting the error
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
- YYABORT;
+ YYABORT;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
-#else /* ! __cplusplus */
+#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up xbt_ddt_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_ddt_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up xbt_ddt_parse_text again */ \
- } \
- while ( 0 )
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up xbt_ddt_parse_text again */ \
+ } \
+ while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
- int yy_buffer_status;
+ int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via xbt_ddt_parse_restart()), so that the user can continue scanning by
- * just pointing xbt_ddt_parse_in at a new input file.
- */
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via xbt_ddt_parse_restart()), so that the user can continue scanning by
+ * just pointing xbt_ddt_parse_in at a new input file.
+ */
#define YY_BUFFER_EOF_PENDING 2
- };
+ };
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
/* yy_hold_char holds the character lost when xbt_ddt_parse_text is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
int xbt_ddt_parse_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
/* Flag which is used to allow xbt_ddt_parse_wrap()'s to do buffer switches
* instead of setting up a fresh xbt_ddt_parse_in. A bit of a hack ...
#define yy_new_buffer xbt_ddt_parse__create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
xbt_ddt_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
xbt_ddt_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
* corresponding action - sets up xbt_ddt_parse_text.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- xbt_ddt_parse_leng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp; \
+ xbt_ddt_parse_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 26
#define YY_END_OF_BUFFER 27
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
static yyconst flex_int16_t yy_accept[61] =
{ 0,
14, 14, 7, 7, 10, 10, 0, 0, 27, 25,
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- size_t n; \
- for ( n = 0; n < max_size && \
- (c = getc( xbt_ddt_parse_in )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( xbt_ddt_parse_in ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, xbt_ddt_parse_in))==0 && ferror(xbt_ddt_parse_in)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(xbt_ddt_parse_in); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( xbt_ddt_parse_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( xbt_ddt_parse_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, xbt_ddt_parse_in))==0 && ferror(xbt_ddt_parse_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(xbt_ddt_parse_in); \
+ } \
+ }\
\
#endif
#endif
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
int comment_caller=0;
int annotate_caller=0;
- if ( !(yy_init) )
- {
- (yy_init) = 1;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
#ifdef YY_USER_INIT
- YY_USER_INIT;
+ YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! xbt_ddt_parse_in )
- xbt_ddt_parse_in = stdin;
+ if ( ! xbt_ddt_parse_in )
+ xbt_ddt_parse_in = stdin;
- if ( ! xbt_ddt_parse_out )
- xbt_ddt_parse_out = stdout;
+ if ( ! xbt_ddt_parse_out )
+ xbt_ddt_parse_out = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- xbt_ddt_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ xbt_ddt_parse_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE );
+ }
- xbt_ddt_parse__load_buffer_state( );
- }
+ xbt_ddt_parse__load_buffer_state( );
+ }
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
- /* Support of xbt_ddt_parse_text. */
- *yy_cp = (yy_hold_char);
+ /* Support of xbt_ddt_parse_text. */
+ *yy_cp = (yy_hold_char);
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = (yy_start);
yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 61 )
- 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] != 88 );
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 61 )
+ 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] != 88 );
yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
-do_action: /* This label is used only to access EOF actions. */
-
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
case 1:
YY_RULE_SETUP
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
{ /****************** ANNOTATION ************************/
xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
BEGIN(annotate);
}
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
{ /* trim annotation */
xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
BEGIN(annotate);
}
- YY_BREAK
+ YY_BREAK
case 4:
YY_RULE_SETUP
{
xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
BEGIN(annotate_caller);
}
- YY_BREAK
+ YY_BREAK
case 5:
YY_RULE_SETUP
{
PARSE_ERROR("``/*g'' construct closed by a regular ``*/''");
}
- YY_BREAK
+ YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
{
PARSE_ERROR("Type annotation cannot spread over several lines");
}
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
{ /* eat the rest */
xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
return XBT_DDT_PARSE_TOKEN_ANNOTATE;
}
- YY_BREAK
+ YY_BREAK
case 8:
YY_RULE_SETUP
{ /****************** COMMENTS ************************/
comment_caller = INITIAL;
BEGIN(comment);
}
- YY_BREAK
+ YY_BREAK
case 9:
YY_RULE_SETUP
{
comment_caller = foo;
BEGIN(comment);
}
- YY_BREAK
+ YY_BREAK
case 10:
YY_RULE_SETUP
{ /* eat anything that's not a '*' */
}
- YY_BREAK
+ YY_BREAK
case 11:
YY_RULE_SETUP
{ /* eat up '*'s not followed by '/'s */
}
- YY_BREAK
+ YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
xbt_ddt_parse_col_pos=0;
xbt_ddt_parse_char_pos++;
}
- YY_BREAK
+ YY_BREAK
case 13:
YY_RULE_SETUP
{
xbt_ddt_parse_col_pos+= strlen(xbt_ddt_parse_text);
BEGIN(comment_caller);
}
- YY_BREAK
+ YY_BREAK
case 14:
YY_RULE_SETUP
{ /****************** STATEMENTS ************************/
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_WORD);
}
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_LA);
}
- YY_BREAK
+ YY_BREAK
case 16:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_RA);
}
- YY_BREAK
+ YY_BREAK
case 17:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_LB);
}
- YY_BREAK
+ YY_BREAK
case 18:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_RB);
}
- YY_BREAK
+ YY_BREAK
case 19:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_LP);
}
- YY_BREAK
+ YY_BREAK
case 20:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_RP);
}
- YY_BREAK
+ YY_BREAK
case 21:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_STAR);
}
- YY_BREAK
+ YY_BREAK
case 22:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_SEMI_COLON);
}
- YY_BREAK
+ YY_BREAK
case 23:
YY_RULE_SETUP
{
SHOW_WHERE;
return(XBT_DDT_PARSE_TOKEN_COLON);
}
- YY_BREAK
+ YY_BREAK
case 24:
/* rule 24 can match eol */
YY_RULE_SETUP
xbt_ddt_parse_col_pos=0;
SHOW_WHERE;
}
- YY_BREAK
+ YY_BREAK
case 25:
YY_RULE_SETUP
{
xbt_ddt_parse_col_pos++;
SHOW_WHERE;
}
- YY_BREAK
+ YY_BREAK
case 26:
YY_RULE_SETUP
ECHO;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(annotate):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(foo):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed xbt_ddt_parse_in at a new source and called
- * xbt_ddt_parse_lex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_ddt_parse_in;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( xbt_ddt_parse_wrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * xbt_ddt_parse_text, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed xbt_ddt_parse_in at a new source and called
+ * xbt_ddt_parse_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_ddt_parse_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( xbt_ddt_parse_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * xbt_ddt_parse_text, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
} /* end of xbt_ddt_parse_lex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- xbt_ddt_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- xbt_ddt_parse_restart(xbt_ddt_parse_in );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_ddt_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ xbt_ddt_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ xbt_ddt_parse_restart(xbt_ddt_parse_in );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
- return ret_val;
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_ddt_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 61 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 61 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
- * next_state = yy_try_NUL_trans( current_state );
+ * next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 61 )
- 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 == 60);
-
- return yy_is_jam ? 0 : yy_current_state;
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 61 )
+ 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 == 60);
+
+ return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
{
- register char *yy_cp;
+ register char *yy_cp;
yy_cp = (yy_c_buf_p);
- /* undo effects of setting up xbt_ddt_parse_text */
- *yy_cp = (yy_hold_char);
+ /* undo effects of setting up xbt_ddt_parse_text */
+ *yy_cp = (yy_hold_char);
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- { /* need to shift things up to make room */
- /* +2 for EOB chars. */
- register int number_to_move = (yy_n_chars) + 2;
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
- register char *source =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- *--dest = *--source;
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
- yy_cp += (int) (dest - source);
- yy_bp += (int) (dest - source);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
- }
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
- *--yy_cp = (char) c;
+ *--yy_cp = (char) c;
- (yytext_ptr) = yy_bp;
- (yy_hold_char) = *yy_cp;
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
}
#ifndef YY_NO_INPUT
#endif
{
- int c;
+ int c;
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- xbt_ddt_parse_restart(xbt_ddt_parse_in );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( xbt_ddt_parse_wrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ xbt_ddt_parse_restart(xbt_ddt_parse_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( xbt_ddt_parse_wrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput();
#else
- return input();
+ return input();
#endif
- }
+ }
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve xbt_ddt_parse_text */
- (yy_hold_char) = *++(yy_c_buf_p);
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve xbt_ddt_parse_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
- return c;
+ return c;
}
-#endif /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
void xbt_ddt_parse_restart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
xbt_ddt_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
xbt_ddt_parse__create_buffer(xbt_ddt_parse_in,YY_BUF_SIZE );
- }
+ }
- xbt_ddt_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
- xbt_ddt_parse__load_buffer_state( );
+ xbt_ddt_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
+ xbt_ddt_parse__load_buffer_state( );
}
/** Switch to a different input buffer.
void xbt_ddt_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * xbt_ddt_parse_pop_buffer_state();
- * xbt_ddt_parse_push_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * xbt_ddt_parse_pop_buffer_state();
+ * xbt_ddt_parse_push_buffer_state(new_buffer);
*/
- xbt_ddt_parse_ensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
+ xbt_ddt_parse_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- xbt_ddt_parse__load_buffer_state( );
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ xbt_ddt_parse__load_buffer_state( );
- /* We don't actually know whether we did this switch during
- * EOF (xbt_ddt_parse_wrap()) processing, but the only time this flag
- * is looked at is after xbt_ddt_parse_wrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ /* We don't actually know whether we did this switch during
+ * EOF (xbt_ddt_parse_wrap()) processing, but the only time this flag
+ * is looked at is after xbt_ddt_parse_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
}
static void xbt_ddt_parse__load_buffer_state (void)
{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- xbt_ddt_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ xbt_ddt_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
*/
YY_BUFFER_STATE xbt_ddt_parse__create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) xbt_ddt_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__create_buffer()" );
+ b = (YY_BUFFER_STATE) xbt_ddt_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = size;
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) xbt_ddt_parse_alloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__create_buffer()" );
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) xbt_ddt_parse_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- xbt_ddt_parse__init_buffer(b,file );
+ xbt_ddt_parse__init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void xbt_ddt_parse__delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- xbt_ddt_parse_free((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ xbt_ddt_parse_free((void *) b->yy_ch_buf );
- xbt_ddt_parse_free((void *) b );
+ xbt_ddt_parse_free((void *) b );
}
#ifndef __cplusplus
static void xbt_ddt_parse__init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- xbt_ddt_parse__flush_buffer(b );
+ xbt_ddt_parse__flush_buffer(b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
/* If b is the current buffer, then xbt_ddt_parse__init_buffer was _probably_
* called from xbt_ddt_parse_restart() or through yy_get_next_buffer.
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- errno = oerrno;
+ errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
*/
void xbt_ddt_parse__flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- b->yy_n_chars = 0;
+ b->yy_n_chars = 0;
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == YY_CURRENT_BUFFER )
- xbt_ddt_parse__load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ xbt_ddt_parse__load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void xbt_ddt_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
-
- xbt_ddt_parse_ensure_buffer_stack();
-
- /* This block is copied from xbt_ddt_parse__switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
+ if (new_buffer == NULL)
+ return;
+
+ xbt_ddt_parse_ensure_buffer_stack();
+
+ /* This block is copied from xbt_ddt_parse__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from xbt_ddt_parse__switch_to_buffer. */
- xbt_ddt_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ /* copied from xbt_ddt_parse__switch_to_buffer. */
+ xbt_ddt_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void xbt_ddt_parse_pop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
+ if (!YY_CURRENT_BUFFER)
+ return;
- xbt_ddt_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
+ xbt_ddt_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
- if (YY_CURRENT_BUFFER) {
- xbt_ddt_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (YY_CURRENT_BUFFER) {
+ xbt_ddt_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void xbt_ddt_parse_ensure_buffer_stack (void)
{
- int num_to_alloc;
+ int num_to_alloc;
- if (!(yy_buffer_stack)) {
+ if (!(yy_buffer_stack)) {
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)xbt_ddt_parse_alloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse_ensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)xbt_ddt_parse_realloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse_ensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)xbt_ddt_parse_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse_ensure_buffer_stack()" );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)xbt_ddt_parse_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
*/
YY_BUFFER_STATE xbt_ddt_parse__scan_buffer (char * base, yy_size_t size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
- b = (YY_BUFFER_STATE) xbt_ddt_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__scan_buffer()" );
+ b = (YY_BUFFER_STATE) xbt_ddt_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- xbt_ddt_parse__switch_to_buffer(b );
+ xbt_ddt_parse__switch_to_buffer(b );
- return b;
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to xbt_ddt_parse_lex() will
YY_BUFFER_STATE xbt_ddt_parse__scan_string (yyconst char * yystr )
{
- return xbt_ddt_parse__scan_bytes(yystr,strlen(yystr) );
+ return xbt_ddt_parse__scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to xbt_ddt_parse_lex() will
*/
YY_BUFFER_STATE xbt_ddt_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) xbt_ddt_parse_alloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) xbt_ddt_parse_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_ddt_parse__scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = xbt_ddt_parse__scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in xbt_ddt_parse__scan_bytes()" );
+ b = xbt_ddt_parse__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in xbt_ddt_parse__scan_bytes()" );
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
- return b;
+ return b;
}
#ifndef YY_EXIT_FAILURE
static void yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up xbt_ddt_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_ddt_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- xbt_ddt_parse_text[xbt_ddt_parse_leng] = (yy_hold_char); \
- (yy_c_buf_p) = xbt_ddt_parse_text + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- xbt_ddt_parse_leng = yyless_macro_arg; \
- } \
- while ( 0 )
+ xbt_ddt_parse_text[xbt_ddt_parse_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = xbt_ddt_parse_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ xbt_ddt_parse_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
{
/* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- xbt_ddt_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- xbt_ddt_parse_pop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ xbt_ddt_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ xbt_ddt_parse_pop_buffer_state();
+ }
- /* Destroy the stack itself. */
- xbt_ddt_parse_free((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ xbt_ddt_parse_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* xbt_ddt_parse_lex() is called, initialization will occur. */
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
- return n;
+ return n;
}
#endif
void *xbt_ddt_parse_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *xbt_ddt_parse_realloc (void * ptr, yy_size_t size )
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
void xbt_ddt_parse_free (void * ptr )
{
- free( (char *) ptr ); /* see xbt_ddt_parse_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see xbt_ddt_parse_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
* Return 0 if d1 and d2 are equal and 1 if not equal
*/
XBT_INLINE int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2,
- int(*compar)(const void *, const void *))
+ int(*compar)(const void *, const void *))
{
- int i ;
- int size;
- if((!d1) && (!d2)) return 0;
- if((!d1) || (!d2))
- {
- XBT_DEBUG("NULL dynar d1=%p d2=%p",d1,d2);
- xbt_dynar_free(&d2);
- return 1;
- }
- if((d1->elmsize)!=(d2->elmsize))
- {
- XBT_DEBUG("Size of elmsize d1=%lu d2=%lu",d1->elmsize,d2->elmsize);
- xbt_dynar_free(&d2);
- return 1; // xbt_die
- }
- if(xbt_dynar_length(d1) != xbt_dynar_length(d2))
- {
- XBT_DEBUG("Size of dynar d1=%lu d2=%lu",xbt_dynar_length(d1),xbt_dynar_length(d2));
- xbt_dynar_free(&d2);
- return 1;
- }
-
- size = xbt_dynar_length(d1);
- for(i=0;i<size;i++)
- {
- void *data1 = xbt_dynar_get_as(d1, i, void *);
- void *data2 = xbt_dynar_get_as(d2, i, void *);
- XBT_DEBUG("link[%d] d1=%p d2=%p",i,data1,data2);
- if(compar(data1,data2)){
- xbt_dynar_free(&d2);
- return 1;
- }
- }
- xbt_dynar_free(&d2);
- return 0;
+ int i ;
+ int size;
+ if((!d1) && (!d2)) return 0;
+ if((!d1) || (!d2))
+ {
+ XBT_DEBUG("NULL dynar d1=%p d2=%p",d1,d2);
+ xbt_dynar_free(&d2);
+ return 1;
+ }
+ if((d1->elmsize)!=(d2->elmsize))
+ {
+ XBT_DEBUG("Size of elmsize d1=%lu d2=%lu",d1->elmsize,d2->elmsize);
+ xbt_dynar_free(&d2);
+ return 1; // xbt_die
+ }
+ if(xbt_dynar_length(d1) != xbt_dynar_length(d2))
+ {
+ XBT_DEBUG("Size of dynar d1=%lu d2=%lu",xbt_dynar_length(d1),xbt_dynar_length(d2));
+ xbt_dynar_free(&d2);
+ return 1;
+ }
+
+ size = xbt_dynar_length(d1);
+ for(i=0;i<size;i++)
+ {
+ void *data1 = xbt_dynar_get_as(d1, i, void *);
+ void *data2 = xbt_dynar_get_as(d2, i, void *);
+ XBT_DEBUG("link[%d] d1=%p d2=%p",i,data1,data2);
+ if(compar(data1,data2)){
+ xbt_dynar_free(&d2);
+ return 1;
+ }
+ }
+ xbt_dynar_free(&d2);
+ return 0;
}
#ifdef SIMGRID_TEST
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
-#else /* ! __cplusplus */
+#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up xbt_graph_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_graph_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- *yy_cp = (yy_hold_char); \
- YY_RESTORE_YY_MORE_OFFSET \
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up xbt_graph_parse_text again */ \
- } \
- while ( 0 )
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up xbt_graph_parse_text again */ \
+ } \
+ while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
- {
- FILE *yy_input_file;
-
- char *yy_ch_buf; /* input buffer */
- char *yy_buf_pos; /* current position in input buffer */
-
- /* Size of input buffer in bytes, not including room for EOB
- * characters.
- */
- yy_size_t yy_buf_size;
-
- /* Number of characters read into yy_ch_buf, not including EOB
- * characters.
- */
- int yy_n_chars;
-
- /* Whether we "own" the buffer - i.e., we know we created it,
- * and can realloc() it to grow it, and should free() it to
- * delete it.
- */
- int yy_is_our_buffer;
-
- /* Whether this is an "interactive" input source; if so, and
- * if we're using stdio for input, then we want to use getc()
- * instead of fread(), to make sure we stop fetching input after
- * each newline.
- */
- int yy_is_interactive;
-
- /* Whether we're considered to be at the beginning of a line.
- * If so, '^' rules will be active on the next match, otherwise
- * not.
- */
- int yy_at_bol;
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
- /* Whether to try to fill the input buffer when we reach the
- * end of it.
- */
- int yy_fill_buffer;
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
- int yy_buffer_status;
+ int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
- /* When an EOF's been seen but there's still some text to process
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
- * shouldn't try reading from the input source any more. We might
- * still have a bunch of tokens to match, though, because of
- * possible backing-up.
- *
- * When we actually see the EOF, we change the status to "new"
- * (via xbt_graph_parse_restart()), so that the user can continue scanning by
- * just pointing xbt_graph_parse_in at a new input file.
- */
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via xbt_graph_parse_restart()), so that the user can continue scanning by
+ * just pointing xbt_graph_parse_in at a new input file.
+ */
#define YY_BUFFER_EOF_PENDING 2
- };
+ };
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
/* yy_hold_char holds the character lost when xbt_graph_parse_text is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
int xbt_graph_parse_leng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0; /* whether we need to initialize */
-static int yy_start = 0; /* start state number */
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
/* Flag which is used to allow xbt_graph_parse_wrap()'s to do buffer switches
* instead of setting up a fresh xbt_graph_parse_in. A bit of a hack ...
#define yy_new_buffer xbt_graph_parse__create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
xbt_graph_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
#define yy_set_bol(at_bol) \
- { \
- if ( ! YY_CURRENT_BUFFER ){\
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
xbt_graph_parse_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); \
- } \
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
- }
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
* corresponding action - sets up xbt_graph_parse_text.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- xbt_graph_parse_leng = (size_t) (yy_cp - yy_bp); \
- (yy_hold_char) = *yy_cp; \
- *yy_cp = '\0'; \
- (yy_c_buf_p) = yy_cp;
+ (yytext_ptr) = yy_bp; \
+ xbt_graph_parse_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 92
#define YY_END_OF_BUFFER 93
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
- {
- flex_int32_t yy_verify;
- flex_int32_t yy_nxt;
- };
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
static yyconst flex_int16_t yy_accept[564] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* XML state. */
#ifdef FLEX_DEBUG
-# define ENTER(state) debug_enter(state,#state)
-# define LEAVE debug_leave()
-# define SET(state) debug_set(state,#state)
+# define ENTER(state) debug_enter(state,#state)
+# define LEAVE debug_leave()
+# define SET(state) debug_set(state,#state)
static void debug_enter(int, const char*);
static void debug_leave(void);
static void debug_set(int, const char*);
#else
-# define ENTER(state) (yy_push_state(state))
-# define LEAVE (yy_pop_state())
-# define SET(state) BEGIN(state)
+# define ENTER(state) (yy_push_state(state))
+# define LEAVE (yy_pop_state())
+# define SET(state) BEGIN(state)
#endif
/* Generic actions. */
-#define SKIP /*skip*/
+#define SKIP /*skip*/
#define SUCCEED CLEANUP; return 0
-#define FAIL return fail
+#define FAIL return fail
static int fail(const char*, ...);
enum {flexml_max_err_msg_size = 512};
static int ck_blimit()
{
if (bnext >= blimit) {
- blimit += FLEXML_BUFFERSTACKSIZE + 2;
- {
- char *temp = (char *) realloc(graphxml_bufferstack, blimit);
- assert(temp);
- graphxml_bufferstack = temp;
- }
+ blimit += FLEXML_BUFFERSTACKSIZE + 2;
+ {
+ char *temp = (char *) realloc(graphxml_bufferstack, blimit);
+ assert(temp);
+ graphxml_bufferstack = temp;
+ }
}
return 0;
}
static int ck_ilimit()
{
if (inext >= ilimit) {
- ilimit += FLEXML_INDEXSTACKSIZE + 2;
- {
- int *temp = (int *) realloc(indexstack, ilimit);
- assert(temp);
- indexstack = temp;
- }
+ ilimit += FLEXML_INDEXSTACKSIZE + 2;
+ {
+ int *temp = (int *) realloc(indexstack, ilimit);
+ assert(temp);
+ indexstack = temp;
+ }
}
return 0;
}
/* Miscellaneous. */
/* Parser states (flex `exclusive start conditions'):
*
- * PROLOG the XML prolog of the document before <?xml...>
- * DOCTYPE the XML prolog of the document after <?xml...>
- * EPILOG after the root element
- * INCOMMENT inside an XML comment <!--....-->
- * INPI inside an XML PI <?...?>
- * VALUE1 inside a '...'-delimited literal
- * VALUE2 inside a "..."-delimited literal
- * CDATA inside a <![CDATA[...] ]> section.
- * ROOT_<tag> expect root element <tag>
- * AL_<tag> inside the attribute list for <tag>
- * IN_<tag> inside a <tag> with element contents (ready for end tag)
- * IMPOSSIBLE dummy to permit disabling rules; must be last
+ * PROLOG the XML prolog of the document before <?xml...>
+ * DOCTYPE the XML prolog of the document after <?xml...>
+ * EPILOG after the root element
+ * INCOMMENT inside an XML comment <!--....-->
+ * INPI inside an XML PI <?...?>
+ * VALUE1 inside a '...'-delimited literal
+ * VALUE2 inside a "..."-delimited literal
+ * CDATA inside a <![CDATA[...] ]> section.
+ * ROOT_<tag> expect root element <tag>
+ * AL_<tag> inside the attribute list for <tag>
+ * IN_<tag> inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE dummy to permit disabling rules; must be last
*/
/* State names. */
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
- { \
- int c = '*'; \
- size_t n; \
- for ( n = 0; n < max_size && \
- (c = getc( xbt_graph_parse_in )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( xbt_graph_parse_in ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, xbt_graph_parse_in))==0 && ferror(xbt_graph_parse_in)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(xbt_graph_parse_in); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( xbt_graph_parse_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( xbt_graph_parse_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, xbt_graph_parse_in))==0 && ferror(xbt_graph_parse_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(xbt_graph_parse_in); \
+ } \
+ }\
\
#endif
#endif
#define YY_RULE_SETUP \
- YY_USER_ACTION
+ YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG);
/* COMMENTS and PIs: handled uniformly for efficiency. */
- if ( !(yy_init) )
- {
- (yy_init) = 1;
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
#ifdef YY_USER_INIT
- YY_USER_INIT;
+ YY_USER_INIT;
#endif
- if ( ! (yy_start) )
- (yy_start) = 1; /* first start state */
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
- if ( ! xbt_graph_parse_in )
- xbt_graph_parse_in = stdin;
+ if ( ! xbt_graph_parse_in )
+ xbt_graph_parse_in = stdin;
- if ( ! xbt_graph_parse_out )
- xbt_graph_parse_out = stdout;
+ if ( ! xbt_graph_parse_out )
+ xbt_graph_parse_out = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- xbt_graph_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ xbt_graph_parse_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE );
+ }
- xbt_graph_parse__load_buffer_state( );
- }
+ xbt_graph_parse__load_buffer_state( );
+ }
- while ( 1 ) /* loops until end-of-file is reached */
- {
- yy_cp = (yy_c_buf_p);
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
- /* Support of xbt_graph_parse_text. */
- *yy_cp = (yy_hold_char);
+ /* Support of xbt_graph_parse_text. */
+ *yy_cp = (yy_hold_char);
- /* yy_bp points to the position in yy_ch_buf of the start of
- * the current run.
- */
- yy_bp = yy_cp;
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
- yy_current_state = (yy_start);
+ yy_current_state = (yy_start);
yy_match:
- do
- {
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 564 )
- 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] != 1586 );
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 564 )
+ 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] != 1586 );
yy_find_action:
- yy_act = yy_accept[yy_current_state];
- if ( yy_act == 0 )
- { /* have to back up */
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- yy_act = yy_accept[yy_current_state];
- }
-
- YY_DO_BEFORE_ACTION;
-
- if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
- {
- int yyl;
- for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl )
- if ( xbt_graph_parse_text[yyl] == '\n' )
-
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+ {
+ int yyl;
+ for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl )
+ if ( xbt_graph_parse_text[yyl] == '\n' )
+
xbt_graph_parse_lineno++;
;
- }
+ }
-do_action: /* This label is used only to access EOF actions. */
+do_action: /* This label is used only to access EOF actions. */
- switch ( yy_act )
- { /* beginning of action switch */
- case 0: /* must back up */
- /* undo the effects of YY_DO_BEFORE_ACTION */
- *yy_cp = (yy_hold_char);
- yy_cp = (yy_last_accepting_cpos);
- yy_current_state = (yy_last_accepting_state);
- goto yy_find_action;
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
case 1:
YY_RULE_SETUP
ENTER(INCOMMENT);
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
ENTER(INPI);
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
+ YY_BREAK
case 4:
case 5:
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INCOMMENT):
FAIL("EOF in comment.");
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
+ YY_BREAK
case 8:
case 9:
/* rule 9 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INPI):
FAIL("EOF in PI (processing instruction).");
- YY_BREAK
+ YY_BREAK
/* SPACES: skipped uniformly */
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
SKIP;
- YY_BREAK
+ YY_BREAK
/* PROLOG: determine root element and process it. */
case 11:
/* rule 11 can match eol */
YY_RULE_SETUP
SET(DOCTYPE);
- YY_BREAK
+ YY_BREAK
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
FAIL("Bad declaration %s.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
SET(ROOT_graphxml_edge);
- YY_BREAK
+ YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
SET(ROOT_graphxml_node);
- YY_BREAK
+ YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
SET(ROOT_graphxml_graph);
- YY_BREAK
+ YY_BREAK
case 16:
/* rule 16 can match eol */
YY_RULE_SETUP
FAIL("Bad declaration %s.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case 17:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in prolog.", xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(PROLOG):
case YY_STATE_EOF(DOCTYPE):
FAIL("EOF in prolog.");
- YY_BREAK
+ YY_BREAK
/* RULES DERIVED FROM DTD. */
/* <!-- Small DTD for xbt graphs. --> */
/* rule 18 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <graph> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 19:
/* rule 19 can match eol */
YY_RULE_SETUP
graphxml_graph_isDirected_isset = 0;
ENTER(AL_graphxml_graph); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 20:
/* rule 20 can match eol */
/* rule 21 can match eol */
YY_RULE_SETUP
A_graphxml_graph_isDirected = A_graphxml_graph_isDirected_true;
- YY_BREAK
+ YY_BREAK
case 22:
/* rule 22 can match eol */
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
A_graphxml_graph_isDirected = A_graphxml_graph_isDirected_false;
- YY_BREAK
+ YY_BREAK
case 24:
YY_RULE_SETUP
{
LEAVE; STag_graphxml_graph();graphxml_pcdata_ix = 0; ENTER(S_graphxml_graph);
}
- YY_BREAK
+ YY_BREAK
case 25:
YY_RULE_SETUP
{
case ROOT_graphxml_graph: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 26:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of graph element.", xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 27:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `graph' element start tag.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_graphxml_graph):
FAIL("EOF in attribute list of `graph' element.");
- YY_BREAK
+ YY_BREAK
case 28:
/* rule 28 can match eol */
case ROOT_graphxml_graph: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 29:
/* rule 29 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</graph>' expected.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case 30:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</graph>' expected.",xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_graphxml_graph_1):
case YY_STATE_EOF(E_graphxml_graph):
case YY_STATE_EOF(S_graphxml_graph_3):
case YY_STATE_EOF(S_graphxml_graph_5):
case YY_STATE_EOF(S_graphxml_graph):
FAIL("Premature EOF: `</graph>' expected.");
- YY_BREAK
+ YY_BREAK
/* label CDATA ""
* name CDATA #REQUIRED
* data CDATA ""
- * position_x CDATA "-1.0"
- * position_y CDATA "-1.0"
+ * position_x CDATA "-1.0"
+ * position_y CDATA "-1.0"
* > */
case 31:
/* rule 31 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <node> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 32:
/* rule 32 can match eol */
YY_RULE_SETUP
graphxml_node_position_y_isset = 0;
ENTER(AL_graphxml_node); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 33:
/* rule 33 can match eol */
YY_RULE_SETUP
if (graphxml_node_label_isset != 0) {FAIL("Multiple definition of attribute label in <graphxml_node>");} graphxml_node_label_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_label);
- YY_BREAK
+ YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
if (graphxml_node_label_isset != 0) {FAIL("Multiple definition of attribute label in <graphxml_node>");} graphxml_node_label_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_label);
- YY_BREAK
+ YY_BREAK
case 35:
/* rule 35 can match eol */
YY_RULE_SETUP
if (graphxml_node_name_isset != 0) {FAIL("Multiple definition of attribute name in <graphxml_node>");} graphxml_node_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_name);
- YY_BREAK
+ YY_BREAK
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
if (graphxml_node_name_isset != 0) {FAIL("Multiple definition of attribute name in <graphxml_node>");} graphxml_node_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_name);
- YY_BREAK
+ YY_BREAK
case 37:
/* rule 37 can match eol */
YY_RULE_SETUP
if (graphxml_node_data_isset != 0) {FAIL("Multiple definition of attribute data in <graphxml_node>");} graphxml_node_data_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_data);
- YY_BREAK
+ YY_BREAK
case 38:
/* rule 38 can match eol */
YY_RULE_SETUP
if (graphxml_node_data_isset != 0) {FAIL("Multiple definition of attribute data in <graphxml_node>");} graphxml_node_data_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_data);
- YY_BREAK
+ YY_BREAK
case 39:
/* rule 39 can match eol */
YY_RULE_SETUP
if (graphxml_node_position_x_isset != 0) {FAIL("Multiple definition of attribute position_x in <graphxml_node>");} graphxml_node_position_x_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_position_x);
- YY_BREAK
+ YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
if (graphxml_node_position_x_isset != 0) {FAIL("Multiple definition of attribute position_x in <graphxml_node>");} graphxml_node_position_x_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_position_x);
- YY_BREAK
+ YY_BREAK
case 41:
/* rule 41 can match eol */
YY_RULE_SETUP
if (graphxml_node_position_y_isset != 0) {FAIL("Multiple definition of attribute position_y in <graphxml_node>");} graphxml_node_position_y_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_node_position_y);
- YY_BREAK
+ YY_BREAK
case 42:
/* rule 42 can match eol */
YY_RULE_SETUP
if (graphxml_node_position_y_isset != 0) {FAIL("Multiple definition of attribute position_y in <graphxml_node>");} graphxml_node_position_y_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_node_position_y);
- YY_BREAK
+ YY_BREAK
case 43:
YY_RULE_SETUP
{
if (!AX_graphxml_node_name) FAIL("Required attribute `name' not set for `node' element.");
LEAVE; STag_graphxml_node();graphxml_pcdata_ix = 0; ENTER(E_graphxml_node);
}
- YY_BREAK
+ YY_BREAK
case 44:
YY_RULE_SETUP
{
case ROOT_graphxml_node: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 45:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of node element.", xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 46:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `node' element start tag.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_graphxml_node):
FAIL("EOF in attribute list of `node' element.");
- YY_BREAK
+ YY_BREAK
case 47:
/* rule 47 can match eol */
case ROOT_graphxml_node: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 48:
/* rule 48 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</node>' expected.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case 49:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</node>' expected.",xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_graphxml_node):
FAIL("Premature EOF: `</node>' expected.");
- YY_BREAK
+ YY_BREAK
/* label CDATA ""
* name CDATA #IMPLIED
/* rule 50 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <edge> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 51:
/* rule 51 can match eol */
YY_RULE_SETUP
graphxml_edge_data_isset = 0;
ENTER(AL_graphxml_edge); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 52:
/* rule 52 can match eol */
YY_RULE_SETUP
if (graphxml_edge_label_isset != 0) {FAIL("Multiple definition of attribute label in <graphxml_edge>");} graphxml_edge_label_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_label);
- YY_BREAK
+ YY_BREAK
case 53:
/* rule 53 can match eol */
YY_RULE_SETUP
if (graphxml_edge_label_isset != 0) {FAIL("Multiple definition of attribute label in <graphxml_edge>");} graphxml_edge_label_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_label);
- YY_BREAK
+ YY_BREAK
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
if (graphxml_edge_name_isset != 0) {FAIL("Multiple definition of attribute name in <graphxml_edge>");} graphxml_edge_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_name);
- YY_BREAK
+ YY_BREAK
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
if (graphxml_edge_name_isset != 0) {FAIL("Multiple definition of attribute name in <graphxml_edge>");} graphxml_edge_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_name);
- YY_BREAK
+ YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
if (graphxml_edge_source_isset != 0) {FAIL("Multiple definition of attribute source in <graphxml_edge>");} graphxml_edge_source_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_source);
- YY_BREAK
+ YY_BREAK
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
if (graphxml_edge_source_isset != 0) {FAIL("Multiple definition of attribute source in <graphxml_edge>");} graphxml_edge_source_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_source);
- YY_BREAK
+ YY_BREAK
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
if (graphxml_edge_target_isset != 0) {FAIL("Multiple definition of attribute target in <graphxml_edge>");} graphxml_edge_target_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_target);
- YY_BREAK
+ YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
if (graphxml_edge_target_isset != 0) {FAIL("Multiple definition of attribute target in <graphxml_edge>");} graphxml_edge_target_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_target);
- YY_BREAK
+ YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
if (graphxml_edge_length_isset != 0) {FAIL("Multiple definition of attribute length in <graphxml_edge>");} graphxml_edge_length_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_length);
- YY_BREAK
+ YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
if (graphxml_edge_length_isset != 0) {FAIL("Multiple definition of attribute length in <graphxml_edge>");} graphxml_edge_length_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_length);
- YY_BREAK
+ YY_BREAK
case 62:
/* rule 62 can match eol */
YY_RULE_SETUP
if (graphxml_edge_data_isset != 0) {FAIL("Multiple definition of attribute data in <graphxml_edge>");} graphxml_edge_data_isset = 1; ENTER(VALUE1); BUFFERSET(AX_graphxml_edge_data);
- YY_BREAK
+ YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
if (graphxml_edge_data_isset != 0) {FAIL("Multiple definition of attribute data in <graphxml_edge>");} graphxml_edge_data_isset = 1; ENTER(VALUE2); BUFFERSET(AX_graphxml_edge_data);
- YY_BREAK
+ YY_BREAK
case 64:
YY_RULE_SETUP
{
if (!AX_graphxml_edge_target) FAIL("Required attribute `target' not set for `edge' element.");
LEAVE; STag_graphxml_edge();graphxml_pcdata_ix = 0; ENTER(E_graphxml_edge);
}
- YY_BREAK
+ YY_BREAK
case 65:
YY_RULE_SETUP
{
case ROOT_graphxml_edge: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 66:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of edge element.", xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 67:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `edge' element start tag.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_graphxml_edge):
FAIL("EOF in attribute list of `edge' element.");
- YY_BREAK
+ YY_BREAK
case 68:
/* rule 68 can match eol */
case ROOT_graphxml_edge: SET(EPILOG); break;
}
}
- YY_BREAK
+ YY_BREAK
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</edge>' expected.",xbt_graph_parse_text);
- YY_BREAK
+ YY_BREAK
case 70:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</edge>' expected.",xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_graphxml_edge):
FAIL("Premature EOF: `</edge>' expected.");
- YY_BREAK
+ YY_BREAK
/* EPILOG: after the root element. */
case 71:
YY_RULE_SETUP
{SET(PROLOG); yyless(0); CLEANUP; return -1;}
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(EPILOG):
SUCCEED;
- YY_BREAK
+ YY_BREAK
/* CHARACTER DATA. */
case 72:
YY_RULE_SETUP
BUFFERPUTC('&');
- YY_BREAK
+ YY_BREAK
case 73:
YY_RULE_SETUP
BUFFERPUTC('<');
- YY_BREAK
+ YY_BREAK
case 74:
YY_RULE_SETUP
BUFFERPUTC('>');
- YY_BREAK
+ YY_BREAK
case 75:
YY_RULE_SETUP
BUFFERPUTC('\'');
- YY_BREAK
+ YY_BREAK
case 76:
YY_RULE_SETUP
BUFFERPUTC('"');
- YY_BREAK
+ YY_BREAK
/* Character entities. */
case 77:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)atoi(xbt_graph_parse_text+2));
- YY_BREAK
+ YY_BREAK
case 78:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)strtol(xbt_graph_parse_text+3,NULL,16));
- YY_BREAK
+ YY_BREAK
case 79:
/* rule 79 can match eol */
/* rule 82 can match eol */
YY_RULE_SETUP
BUFFERPUTC('\n');
- YY_BREAK
+ YY_BREAK
case 83:
YY_RULE_SETUP
ENTER(CDATA);
- YY_BREAK
+ YY_BREAK
case 84:
YY_RULE_SETUP
FAIL("Unexpected `]""]>' in character data.");
- YY_BREAK
+ YY_BREAK
case 85:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE1):
FAIL("EOF in literal (\"'\" expected).");
- YY_BREAK
+ YY_BREAK
case 86:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE2):
FAIL("EOF in literal (`\"' expected).");
- YY_BREAK
+ YY_BREAK
case 87:
/* rule 87 can match eol */
YY_RULE_SETUP
BUFFERPUTC(xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 88:
YY_RULE_SETUP
FAIL("Spurious `%c' in character data.",xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 89:
YY_RULE_SETUP
LEAVE;
- YY_BREAK
-/* "]""]" BUFFERPUTC(xbt_graph_parse_text[0]); BUFFERPUTC(xbt_graph_parse_text[1]); */
+ YY_BREAK
+/* "]""]" BUFFERPUTC(xbt_graph_parse_text[0]); BUFFERPUTC(xbt_graph_parse_text[1]); */
case 90:
YY_RULE_SETUP
BUFFERPUTC(xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(CDATA):
FAIL("EOF in CDATA section.");
- YY_BREAK
+ YY_BREAK
/* Impossible rules to avoid warnings from flex(1). */
/* Ideally, this should be replaced by code in flexml.pl that
/* rule 91 can match eol */
YY_RULE_SETUP
FAIL("Syntax error on character `%c'.", xbt_graph_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 92:
YY_RULE_SETUP
ECHO;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(ROOT_graphxml_graph):
case YY_STATE_EOF(S_graphxml_graph_2):
case YY_STATE_EOF(ROOT_graphxml_node):
case YY_STATE_EOF(ROOT_graphxml_edge):
case YY_STATE_EOF(IMPOSSIBLE):
- yyterminate();
-
- case YY_END_OF_BUFFER:
- {
- /* Amount of text matched not including the EOB char. */
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
- *yy_cp = (yy_hold_char);
- YY_RESTORE_YY_MORE_OFFSET
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
- {
- /* We're scanning a new file or input source. It's
- * possible that this happened because the user
- * just pointed xbt_graph_parse_in at a new source and called
- * xbt_graph_parse_lex(). If so, then we have to assure
- * consistency between YY_CURRENT_BUFFER and our
- * globals. Here is the right place to do so, because
- * this is the first action (other than possibly a
- * back-up) that will match for the new input source.
- */
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_graph_parse_in;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
- }
-
- /* Note that here we test for yy_c_buf_p "<=" to the position
- * of the first EOB in the buffer, since yy_c_buf_p will
- * already have been incremented past the NUL character
- * (since all states make transitions on EOB to the
- * end-of-buffer state). Contrast this with the test
- * in input().
- */
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- { /* This was really a NUL. */
- yy_state_type yy_next_state;
-
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- /* Okay, we're now positioned to make the NUL
- * transition. We couldn't have
- * yy_get_previous_state() go ahead and do it
- * for us because it doesn't know how to deal
- * with the possibility of jamming (and we don't
- * want to build jamming into it because then it
- * will run more slowly).
- */
-
- yy_next_state = yy_try_NUL_trans( yy_current_state );
-
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
- if ( yy_next_state )
- {
- /* Consume the NUL. */
- yy_cp = ++(yy_c_buf_p);
- yy_current_state = yy_next_state;
- goto yy_match;
- }
-
- else
- {
- yy_cp = (yy_c_buf_p);
- goto yy_find_action;
- }
- }
-
- else switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_END_OF_FILE:
- {
- (yy_did_buffer_switch_on_eof) = 0;
-
- if ( xbt_graph_parse_wrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * xbt_graph_parse_text, we can now set up
- * yy_c_buf_p so that if some total
- * hoser (like flex itself) wants to
- * call the scanner after we return the
- * YY_NULL, it'll still work - another
- * YY_NULL will get returned.
- */
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
- yy_act = YY_STATE_EOF(YY_START);
- goto do_action;
- }
-
- else
- {
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
- }
- break;
- }
-
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) =
- (yytext_ptr) + yy_amount_of_matched_text;
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_match;
-
- case EOB_ACT_LAST_MATCH:
- (yy_c_buf_p) =
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
- yy_current_state = yy_get_previous_state( );
-
- yy_cp = (yy_c_buf_p);
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
- goto yy_find_action;
- }
- break;
- }
-
- default:
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--no action found" );
- } /* end of action switch */
- } /* end of scanning one token */
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed xbt_graph_parse_in at a new source and called
+ * xbt_graph_parse_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_graph_parse_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( xbt_graph_parse_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * xbt_graph_parse_text, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
} /* end of xbt_graph_parse_lex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
- * EOB_ACT_LAST_MATCH -
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- * EOB_ACT_END_OF_FILE - end of file
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = (yytext_ptr);
- register int number_to_move, i;
- int ret_val;
-
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
- YY_FATAL_ERROR(
- "fatal flex scanner internal error--end of buffer missed" );
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
- { /* Don't try to fill the buffer, so this is an EOF. */
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
- {
- /* We matched a single character, the EOB, so
- * treat this as a final EOF.
- */
- return EOB_ACT_END_OF_FILE;
- }
-
- else
- {
- /* We matched some text prior to the EOB, first
- * process it.
- */
- return EOB_ACT_LAST_MATCH;
- }
- }
-
- /* Try to read more data. */
-
- /* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
- for ( i = 0; i < number_to_move; ++i )
- *(dest++) = *(source++);
-
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
- /* don't do the read, it's not guaranteed to return an EOF,
- * just force an EOF
- */
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
- else
- {
- int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
- while ( num_to_read <= 0 )
- { /* Not enough room in the buffer - grow it. */
-
- /* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- int new_size = b->yy_buf_size * 2;
-
- if ( new_size <= 0 )
- b->yy_buf_size += b->yy_buf_size / 8;
- else
- b->yy_buf_size *= 2;
-
- b->yy_ch_buf = (char *)
- /* Include room in for 2 EOB chars. */
- xbt_graph_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
- }
- else
- /* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
-
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR(
- "fatal error - scanner input buffer overflow" );
-
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
-
- }
-
- if ( num_to_read > YY_READ_BUF_SIZE )
- num_to_read = YY_READ_BUF_SIZE;
-
- /* Read in more data. */
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
-
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- if ( (yy_n_chars) == 0 )
- {
- if ( number_to_move == YY_MORE_ADJ )
- {
- ret_val = EOB_ACT_END_OF_FILE;
- xbt_graph_parse_restart(xbt_graph_parse_in );
- }
-
- else
- {
- ret_val = EOB_ACT_LAST_MATCH;
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
- YY_BUFFER_EOF_PENDING;
- }
- }
-
- else
- ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_graph_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
-
- (yy_n_chars) += number_to_move;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ xbt_graph_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ xbt_graph_parse_restart(xbt_graph_parse_in );
+ }
- return ret_val;
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_graph_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 564 )
- yy_c = yy_meta[(unsigned int) yy_c];
- }
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- }
-
- return yy_current_state;
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 564 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
- * next_state = yy_try_NUL_trans( current_state );
+ * next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
- register int yy_is_jam;
- register char *yy_cp = (yy_c_buf_p);
-
- register YY_CHAR yy_c = 1;
- if ( yy_accept[yy_current_state] )
- {
- (yy_last_accepting_state) = yy_current_state;
- (yy_last_accepting_cpos) = yy_cp;
- }
- 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 >= 564 )
- 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 == 563);
-
- return yy_is_jam ? 0 : yy_current_state;
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ 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 >= 564 )
+ 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 == 563);
+
+ return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
#endif
{
- int c;
+ int c;
- *(yy_c_buf_p) = (yy_hold_char);
-
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
- {
- /* yy_c_buf_p now points to the character we want to return.
- * If this occurs *before* the EOB characters, then it's a
- * valid NUL; if not, then we've hit the end of the buffer.
- */
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
- /* This was really a NUL. */
- *(yy_c_buf_p) = '\0';
-
- else
- { /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
- ++(yy_c_buf_p);
-
- switch ( yy_get_next_buffer( ) )
- {
- case EOB_ACT_LAST_MATCH:
- /* This happens because yy_g_n_b()
- * sees that we've accumulated a
- * token and flags that we need to
- * try matching the token before
- * proceeding. But for input(),
- * there's no matching to consider.
- * So convert the EOB_ACT_LAST_MATCH
- * to EOB_ACT_END_OF_FILE.
- */
-
- /* Reset buffer status. */
- xbt_graph_parse_restart(xbt_graph_parse_in );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( xbt_graph_parse_wrap( ) )
- return EOF;
-
- if ( ! (yy_did_buffer_switch_on_eof) )
- YY_NEW_FILE;
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ xbt_graph_parse_restart(xbt_graph_parse_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( xbt_graph_parse_wrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
#ifdef __cplusplus
- return yyinput();
+ return yyinput();
#else
- return input();
+ return input();
#endif
- }
+ }
- case EOB_ACT_CONTINUE_SCAN:
- (yy_c_buf_p) = (yytext_ptr) + offset;
- break;
- }
- }
- }
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve xbt_graph_parse_text */
- (yy_hold_char) = *++(yy_c_buf_p);
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve xbt_graph_parse_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
- if ( c == '\n' )
-
+ if ( c == '\n' )
+
xbt_graph_parse_lineno++;
;
- return c;
+ return c;
}
-#endif /* ifndef YY_NO_INPUT */
+#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
void xbt_graph_parse_restart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
xbt_graph_parse_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE );
- }
+ }
- xbt_graph_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
- xbt_graph_parse__load_buffer_state( );
+ xbt_graph_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
+ xbt_graph_parse__load_buffer_state( );
}
/** Switch to a different input buffer.
void xbt_graph_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * xbt_graph_parse_pop_buffer_state();
- * xbt_graph_parse_push_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * xbt_graph_parse_pop_buffer_state();
+ * xbt_graph_parse_push_buffer_state(new_buffer);
*/
- xbt_graph_parse_ensure_buffer_stack ();
- if ( YY_CURRENT_BUFFER == new_buffer )
- return;
-
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
- xbt_graph_parse__load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (xbt_graph_parse_wrap()) processing, but the only time this flag
- * is looked at is after xbt_graph_parse_wrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ xbt_graph_parse_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ xbt_graph_parse__load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (xbt_graph_parse_wrap()) processing, but the only time this flag
+ * is looked at is after xbt_graph_parse_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
}
static void xbt_graph_parse__load_buffer_state (void)
{
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- xbt_graph_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
- (yy_hold_char) = *(yy_c_buf_p);
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ xbt_graph_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
*/
YY_BUFFER_STATE xbt_graph_parse__create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" );
+ b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = size;
- /* yy_ch_buf has to be 2 characters longer than the size given because
- * we need to put in 2 end-of-buffer characters.
- */
- b->yy_ch_buf = (char *) xbt_graph_parse_alloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" );
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) xbt_graph_parse_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- xbt_graph_parse__init_buffer(b,file );
+ xbt_graph_parse__init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void xbt_graph_parse__delete_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
- if ( b->yy_is_our_buffer )
- xbt_graph_parse_free((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ xbt_graph_parse_free((void *) b->yy_ch_buf );
- xbt_graph_parse_free((void *) b );
+ xbt_graph_parse_free((void *) b );
}
#ifndef __cplusplus
static void xbt_graph_parse__init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- xbt_graph_parse__flush_buffer(b );
+ xbt_graph_parse__flush_buffer(b );
- b->yy_input_file = file;
- b->yy_fill_buffer = 1;
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
/* If b is the current buffer, then xbt_graph_parse__init_buffer was _probably_
* called from xbt_graph_parse_restart() or through yy_get_next_buffer.
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
- errno = oerrno;
+ errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
*/
void xbt_graph_parse__flush_buffer (YY_BUFFER_STATE b )
{
- if ( ! b )
- return;
+ if ( ! b )
+ return;
- b->yy_n_chars = 0;
+ b->yy_n_chars = 0;
- /* We always need two end-of-buffer characters. The first causes
- * a transition to the end-of-buffer state. The second causes
- * a jam in that state.
- */
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
- b->yy_buf_pos = &b->yy_ch_buf[0];
+ b->yy_buf_pos = &b->yy_ch_buf[0];
- b->yy_at_bol = 1;
- b->yy_buffer_status = YY_BUFFER_NEW;
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
- if ( b == YY_CURRENT_BUFFER )
- xbt_graph_parse__load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ xbt_graph_parse__load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
-
- xbt_graph_parse_ensure_buffer_stack();
-
- /* This block is copied from xbt_graph_parse__switch_to_buffer. */
- if ( YY_CURRENT_BUFFER )
- {
- /* Flush out information for old buffer. */
- *(yy_c_buf_p) = (yy_hold_char);
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
- }
-
- /* Only push if top exists. Otherwise, replace top. */
- if (YY_CURRENT_BUFFER)
- (yy_buffer_stack_top)++;
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
- /* copied from xbt_graph_parse__switch_to_buffer. */
- xbt_graph_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ if (new_buffer == NULL)
+ return;
+
+ xbt_graph_parse_ensure_buffer_stack();
+
+ /* This block is copied from xbt_graph_parse__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from xbt_graph_parse__switch_to_buffer. */
+ xbt_graph_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void xbt_graph_parse_pop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
-
- xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- if ((yy_buffer_stack_top) > 0)
- --(yy_buffer_stack_top);
-
- if (YY_CURRENT_BUFFER) {
- xbt_graph_parse__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ xbt_graph_parse__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void xbt_graph_parse_ensure_buffer_stack (void)
{
- int num_to_alloc;
+ int num_to_alloc;
- if (!(yy_buffer_stack)) {
+ if (!(yy_buffer_stack)) {
- /* First allocation is just for 2 elements, since we don't know if this
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
- * immediate realloc on the next call.
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
*/
- num_to_alloc = 1;
- (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_alloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" );
-
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
- (yy_buffer_stack_max) = num_to_alloc;
- (yy_buffer_stack_top) = 0;
- return;
- }
-
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
- /* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
-
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_realloc
- ((yy_buffer_stack),
- num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" );
-
- /* zero only the new slots.*/
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
- (yy_buffer_stack_max) = num_to_alloc;
- }
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
*/
YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char * base, yy_size_t size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- if ( size < 2 ||
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
- base[size-1] != YY_END_OF_BUFFER_CHAR )
- /* They forgot to leave room for the EOB's. */
- return 0;
-
- b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_buffer()" );
-
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
- b->yy_buf_pos = b->yy_ch_buf = base;
- b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
- b->yy_n_chars = b->yy_buf_size;
- b->yy_is_interactive = 0;
- b->yy_at_bol = 1;
- b->yy_fill_buffer = 0;
- b->yy_buffer_status = YY_BUFFER_NEW;
-
- xbt_graph_parse__switch_to_buffer(b );
-
- return b;
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ xbt_graph_parse__switch_to_buffer(b );
+
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to xbt_graph_parse_lex() will
YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yystr )
{
- return xbt_graph_parse__scan_bytes(yystr,strlen(yystr) );
+ return xbt_graph_parse__scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to xbt_graph_parse_lex() will
*/
YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- int i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) xbt_graph_parse_alloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) xbt_graph_parse_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
- buf[i] = yybytes[i];
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = xbt_graph_parse__scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in xbt_graph_parse__scan_bytes()" );
+ b = xbt_graph_parse__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in xbt_graph_parse__scan_bytes()" );
- /* It's okay to grow etc. this buffer, and we should throw it
- * away when we're done.
- */
- b->yy_is_our_buffer = 1;
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
- return b;
+ return b;
}
static void yy_push_state (int new_state )
{
- if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
- {
- yy_size_t new_size;
+ if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
+ {
+ yy_size_t new_size;
- (yy_start_stack_depth) += YY_START_STACK_INCR;
- new_size = (yy_start_stack_depth) * sizeof( int );
+ (yy_start_stack_depth) += YY_START_STACK_INCR;
+ new_size = (yy_start_stack_depth) * sizeof( int );
- if ( ! (yy_start_stack) )
- (yy_start_stack) = (int *) xbt_graph_parse_alloc(new_size );
+ if ( ! (yy_start_stack) )
+ (yy_start_stack) = (int *) xbt_graph_parse_alloc(new_size );
- else
- (yy_start_stack) = (int *) xbt_graph_parse_realloc((void *) (yy_start_stack),new_size );
+ else
+ (yy_start_stack) = (int *) xbt_graph_parse_realloc((void *) (yy_start_stack),new_size );
- if ( ! (yy_start_stack) )
- YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
- }
+ if ( ! (yy_start_stack) )
+ YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
+ }
- (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
+ (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
- BEGIN(new_state);
+ BEGIN(new_state);
}
static void yy_pop_state (void)
{
- if ( --(yy_start_stack_ptr) < 0 )
- YY_FATAL_ERROR( "start-condition stack underflow" );
+ if ( --(yy_start_stack_ptr) < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
- BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
+ BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
}
#ifndef YY_EXIT_FAILURE
static void yy_fatal_error (yyconst char* msg )
{
- (void) fprintf( stderr, "%s\n", msg );
- exit( YY_EXIT_FAILURE );
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
- do \
- { \
- /* Undo effects of setting up xbt_graph_parse_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_graph_parse_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- xbt_graph_parse_text[xbt_graph_parse_leng] = (yy_hold_char); \
- (yy_c_buf_p) = xbt_graph_parse_text + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- xbt_graph_parse_leng = yyless_macro_arg; \
- } \
- while ( 0 )
+ xbt_graph_parse_text[xbt_graph_parse_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = xbt_graph_parse_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ xbt_graph_parse_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
{
/* Pop the buffer stack, destroying each element. */
- while(YY_CURRENT_BUFFER){
- xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- xbt_graph_parse_pop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ xbt_graph_parse_pop_buffer_state();
+ }
- /* Destroy the stack itself. */
- xbt_graph_parse_free((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ xbt_graph_parse_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
/* Destroy the start condition stack. */
xbt_graph_parse_free((yy_start_stack) );
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
- register int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
- register int n;
- for ( n = 0; s[n]; ++n )
- ;
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
- return n;
+ return n;
}
#endif
void *xbt_graph_parse_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *xbt_graph_parse_realloc (void * ptr, yy_size_t size )
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
}
void xbt_graph_parse_free (void * ptr )
{
- free( (char *) ptr ); /* see xbt_graph_parse_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see xbt_graph_parse_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
int graphxml_element_context(int i)
{
return (0<i && i<yy_start_stack_depth
- ? yy_start_stack[yy_start_stack_ptr - i]
- : 0);
+ ? yy_start_stack[yy_start_stack_ptr - i]
+ : 0);
}
#ifdef FLEX_DEBUG
static void debug_leave(void) {
if (xbt_graph_parse__flex_debug) {
print_yy_stack("--LEAVE : ");
- print_graphxml_bufferstack();
+ print_graphxml_bufferstack();
}
yy_pop_state();
}
{
if (graphxml_statenames) {
free(graphxml_statenames);
- graphxml_statenames = NULL;
+ graphxml_statenames = NULL;
}
free(graphxml_bufferstack);
graphxml_bufferstack = NULL;
va_list ap; va_start(ap, fmt);
#ifdef FLEXML_yylineno
used = sprintf(flexml_err_msg,
- "Invalid XML (XML input line %d, state %d): ",
- xbt_graph_parse_lineno, YY_START);
+ "Invalid XML (XML input line %d, state %d): ",
+ xbt_graph_parse_lineno, YY_START);
#else
used = sprintf(flexml_err_msg,
- "Invalid XML (state %d): ",
- YY_START);
+ "Invalid XML (state %d): ",
+ YY_START);
#endif
chars_left = flexml_max_err_msg_size - used - 1;
vsnprintf(flexml_err_msg + used, chars_left, fmt, ap);
/**
* @brief Extracts from the heap and returns the element at position i.
* \param H the heap we're working on
- * \param i element position
+ * \param i element position
* \return the element at position i if ok, NULL otherwise
*
* Extracts from the heap and returns the element at position i. The heap is automatically reorded.
int it;
if (ptr == NULL)
- return;
+ return;
block = BLOCK(ptr);
/* Get as many statistics as early as we can. */
mdp -> heapstats.chunks_used--;
mdp -> heapstats.bytes_used -=
- mdp -> heapinfo[block].busy_block.size * BLOCKSIZE;
+ mdp -> heapinfo[block].busy_block.size * BLOCKSIZE;
mdp -> heapstats.bytes_free +=
- mdp -> heapinfo[block].busy_block.size * BLOCKSIZE;
+ mdp -> heapinfo[block].busy_block.size * BLOCKSIZE;
/* Find the free cluster previous to this one in the free list.
Start searching at the last block referenced; this may benefit
mdp->heapinfo[i].free_block.size += mdp->heapinfo[block].busy_block.size;
/* Mark all my ex-blocks as free */
for (it=0; it<mdp->heapinfo[block].busy_block.size; it++) {
- if (mdp->heapinfo[block+it].type <0) {
- fprintf(stderr,"Internal Error: Asked to free a block already marked as free (block=%lu it=%d type=%lu). Please report this bug.\n",
- (unsigned long)block,it,(unsigned long)mdp->heapinfo[block].type);
- abort();
- }
- mdp->heapinfo[block+it].type = -1;
+ if (mdp->heapinfo[block+it].type <0) {
+ fprintf(stderr,"Internal Error: Asked to free a block already marked as free (block=%lu it=%d type=%lu). Please report this bug.\n",
+ (unsigned long)block,it,(unsigned long)mdp->heapinfo[block].type);
+ abort();
+ }
+ mdp->heapinfo[block+it].type = -1;
}
block = i;
mdp -> heapstats.chunks_free++;
/* Mark all my ex-blocks as free */
for (it=0; it<mdp->heapinfo[block].free_block.size; it++) {
- if (mdp->heapinfo[block+it].type <0) {
- fprintf(stderr,"Internal error: Asked to free a block already marked as free (block=%lu it=%d/%lu type=%lu). Please report this bug.\n",
- (unsigned long)block,it,(unsigned long)mdp->heapinfo[block].free_block.size,(unsigned long)mdp->heapinfo[block].type);
- abort();
- }
- mdp->heapinfo[block+it].type = -1;
+ if (mdp->heapinfo[block+it].type <0) {
+ fprintf(stderr,"Internal error: Asked to free a block already marked as free (block=%lu it=%d/%lu type=%lu). Please report this bug.\n",
+ (unsigned long)block,it,(unsigned long)mdp->heapinfo[block].free_block.size,(unsigned long)mdp->heapinfo[block].type);
+ abort();
+ }
+ mdp->heapinfo[block+it].type = -1;
}
}
if(mdp1->heapinfo[i].type == 0){ /* busy large block */
if(mdp1->heapinfo[i].busy_block.size != mdp2->heapinfo[i].busy_block.size){
- fprintf(stderr,"Different size of a large cluster : %zu - %zu\n", mdp1->heapinfo[i].busy_block.size, mdp2->heapinfo[i].busy_block.size);
- fflush(NULL);
- errors++;
+ fprintf(stderr,"Different size of a large cluster : %zu - %zu\n", mdp1->heapinfo[i].busy_block.size, mdp2->heapinfo[i].busy_block.size);
+ fflush(NULL);
+ errors++;
}
if(mdp1->heapinfo[i].busy_block.busy_size != mdp2->heapinfo[i].busy_block.busy_size){
- fprintf(stderr,"Different busy_size of a large cluster : %zu - %zu\n", mdp1->heapinfo[i].busy_block.busy_size, mdp2->heapinfo[i].busy_block.busy_size);
- fflush(NULL);
- errors++;
+ fprintf(stderr,"Different busy_size of a large cluster : %zu - %zu\n", mdp1->heapinfo[i].busy_block.busy_size, mdp2->heapinfo[i].busy_block.busy_size);
+ fflush(NULL);
+ errors++;
}
//for(k=0;k<mdp1->heapinfo[i].busy_block.size * BLOCKSIZE;k++){
for(k=0;k<mdp1->heapinfo[i].busy_block.busy_size;k++){
- if((((char *)addr_block1) + k != 0) && (((char *)addr_block2) + k != 0)){
- if(memcmp(((char *)addr_block1) + k, ((char *)addr_block2) + k, 1) != 0){
- fprintf(stderr, "Different byte (offset=%d) (%p - %p) in block %zu\n", k, (char *)addr_block1 + k, (char *)addr_block2 + k, i); fflush(NULL);
- pointer_align = (k / sizeof(void*)) * sizeof(void*);
- address_pointed1 = *((void **)((char *)addr_block1 + pointer_align));
- address_pointed2 = *((void **)((char *)addr_block2 + pointer_align));
- if(((address_pointed1 > (void *)s_heap) && (address_pointed1 < mdp1->breakval)) && ((address_pointed2 > (void *)s_heap) && (address_pointed2 < mdp2->breakval))){
- block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
- block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
- //fprintf(stderr, "Blocks pointed : %d - %d\n", block_pointed1, block_pointed2);
- if((block_pointed1 == 0) && (block_pointed2 == 0)){
- block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
- block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
- if(mdp1->heapinfo[block_pointed1].type == mdp2->heapinfo[block_pointed2].type){
- if(mdp1->heapinfo[block_pointed1].type == 0){ // Large block
- if(mdp1->heapinfo[block_pointed1].busy_block.busy_size == mdp2->heapinfo[block_pointed2].busy_block.busy_size){
- addr_block_pointed1 = (char*)heapbase1 + ((block_pointed1 - 1)*BLOCKSIZE);
- addr_block_pointed2 = (char*)heapbase2 + ((block_pointed2 - 1)*BLOCKSIZE);
- if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_block.busy_size) != 0){
- distance++;
- }else{
- fprintf(stderr, "False difference detected\n");
- }
- }else{
- distance++;
- }
- }else{ // Fragmented block
- addr_block_pointed1 = (char*)mdp1 + ((char *)address_pointed1 - (char *)s_heap);
- addr_block_pointed2 = (char*)mdp2 + ((char *)address_pointed2 - (char *)s_heap);
- if(mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0] == mdp2->heapinfo[block_pointed2].busy_frag.frag_size[0]){
- if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0]) != 0){
- fprintf(stderr, "Pointed fragments are different \n");
- distance++;
- }else{
- fprintf(stderr, "False difference detected\n");
- }
- }else{
- fprintf(stderr, "Different size of pointed fragments\n");
- distance ++;
- }
- }
- }else{
- fprintf(stderr, "Pointers on blocks with different types \n");
- distance++;
- }
-
- }else{
- /* FIXME : peut pointer vers le début d'un fragment mais dans un bloc */
- fprintf(stderr, "Pointed addresses (%p - %p) not valid\n", address_pointed1, address_pointed2);
- distance++;
- }
- }else{
- fprintf(stderr, "Pointed addresses (%p - %p) not in std_heap\n", address_pointed1, address_pointed2);
- distance++;
- }
-
- }
- }
+ if((((char *)addr_block1) + k != 0) && (((char *)addr_block2) + k != 0)){
+ if(memcmp(((char *)addr_block1) + k, ((char *)addr_block2) + k, 1) != 0){
+ fprintf(stderr, "Different byte (offset=%d) (%p - %p) in block %zu\n", k, (char *)addr_block1 + k, (char *)addr_block2 + k, i); fflush(NULL);
+ pointer_align = (k / sizeof(void*)) * sizeof(void*);
+ address_pointed1 = *((void **)((char *)addr_block1 + pointer_align));
+ address_pointed2 = *((void **)((char *)addr_block2 + pointer_align));
+ if(((address_pointed1 > (void *)s_heap) && (address_pointed1 < mdp1->breakval)) && ((address_pointed2 > (void *)s_heap) && (address_pointed2 < mdp2->breakval))){
+ block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
+ block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
+ //fprintf(stderr, "Blocks pointed : %d - %d\n", block_pointed1, block_pointed2);
+ if((block_pointed1 == 0) && (block_pointed2 == 0)){
+ block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
+ block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
+ if(mdp1->heapinfo[block_pointed1].type == mdp2->heapinfo[block_pointed2].type){
+ if(mdp1->heapinfo[block_pointed1].type == 0){ // Large block
+ if(mdp1->heapinfo[block_pointed1].busy_block.busy_size == mdp2->heapinfo[block_pointed2].busy_block.busy_size){
+ addr_block_pointed1 = (char*)heapbase1 + ((block_pointed1 - 1)*BLOCKSIZE);
+ addr_block_pointed2 = (char*)heapbase2 + ((block_pointed2 - 1)*BLOCKSIZE);
+ if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_block.busy_size) != 0){
+ distance++;
+ }else{
+ fprintf(stderr, "False difference detected\n");
+ }
+ }else{
+ distance++;
+ }
+ }else{ // Fragmented block
+ addr_block_pointed1 = (char*)mdp1 + ((char *)address_pointed1 - (char *)s_heap);
+ addr_block_pointed2 = (char*)mdp2 + ((char *)address_pointed2 - (char *)s_heap);
+ if(mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0] == mdp2->heapinfo[block_pointed2].busy_frag.frag_size[0]){
+ if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0]) != 0){
+ fprintf(stderr, "Pointed fragments are different \n");
+ distance++;
+ }else{
+ fprintf(stderr, "False difference detected\n");
+ }
+ }else{
+ fprintf(stderr, "Different size of pointed fragments\n");
+ distance ++;
+ }
+ }
+ }else{
+ fprintf(stderr, "Pointers on blocks with different types \n");
+ distance++;
+ }
+
+ }else{
+ /* FIXME : peut pointer vers le début d'un fragment mais dans un bloc */
+ fprintf(stderr, "Pointed addresses (%p - %p) not valid\n", address_pointed1, address_pointed2);
+ distance++;
+ }
+ }else{
+ fprintf(stderr, "Pointed addresses (%p - %p) not in std_heap\n", address_pointed1, address_pointed2);
+ distance++;
+ }
+
+ }
+ }
}
if(distance>0){
- fprintf(stderr,"\nDifferent data in large block %zu (size = %zu (in blocks), busy_size = %zu (in bytes))\n", i, mdp1->heapinfo[i].busy_block.size, mdp1->heapinfo[i].busy_block.busy_size);
- fflush(NULL);
- fprintf(stderr, "Hamming distance between blocks : %d\n", distance);
- mmalloc_backtrace_block_display(mdp1, i);
- mmalloc_backtrace_block_display(mdp2, i);
- fprintf(stderr, "\n");
- errors++;
- total_distance += distance;
+ fprintf(stderr,"\nDifferent data in large block %zu (size = %zu (in blocks), busy_size = %zu (in bytes))\n", i, mdp1->heapinfo[i].busy_block.size, mdp1->heapinfo[i].busy_block.busy_size);
+ fflush(NULL);
+ fprintf(stderr, "Hamming distance between blocks : %d\n", distance);
+ mmalloc_backtrace_block_display(mdp1, i);
+ mmalloc_backtrace_block_display(mdp2, i);
+ fprintf(stderr, "\n");
+ errors++;
+ total_distance += distance;
}
if(mdp1->heapinfo[i].type > 0){ /* busy fragmented block */
- if(mdp1->heapinfo[i].type != mdp2->heapinfo[i].type){
- fprintf(stderr,"Different size of fragments in fragmented block %zu : %d - %d\n", i, mdp1->heapinfo[i].type, mdp2->heapinfo[i].type); fflush(NULL);
- errors++;
- }
-
- if(mdp1->heapinfo[i].busy_frag.nfree != mdp2->heapinfo[i].busy_frag.nfree){
- fprintf(stderr,"Different free fragments in fragmented block %zu : %zu - %zu\n", i, mdp1->heapinfo[i].busy_frag.nfree, mdp2->heapinfo[i].busy_frag.nfree); fflush(NULL);
- errors++;
- }
-
- if(mdp1->heapinfo[i].busy_frag.first != mdp2->heapinfo[i].busy_frag.first){
- fprintf(stderr,"Different busy_size of a large cluster : %zu - %zu\n", mdp1->heapinfo[i].busy_block.busy_size, mdp2->heapinfo[i].busy_block.busy_size); fflush(NULL);
- errors++;
- }
-
- frag_size = pow(2, mdp1->heapinfo[i].type);
-
- for(j=0; j< (BLOCKSIZE/frag_size); j++){
-
- if(mdp1->heapinfo[i].busy_frag.frag_size[j] != mdp2->heapinfo[i].busy_frag.frag_size[j]){
- fprintf(stderr,"Different busy_size for fragment %zu in block %zu : %hu - %hu\n", j, i, mdp1->heapinfo[i].busy_frag.frag_size[j], mdp2->heapinfo[i].busy_frag.frag_size[j]); fflush(NULL);
- errors++;
- }
-
- if(mdp1->heapinfo[i].busy_frag.frag_size[j] > 0){
-
- addr_frag1 = (char *)addr_block1 + (j * frag_size);
- xbt_assert(addr_frag1 < breakval1, "Fragment address out of heap memory used");
-
- addr_frag2 = (char *)addr_block2 + (j * frag_size);
- xbt_assert(addr_frag1 < breakval1, "Fragment address out of heap memory used");
-
- /* Hamming distance on different blocks */
- distance = 0;
- //for(k=0;k<frag_size;k++){
- for(k=0;k<mdp1->heapinfo[i].busy_frag.frag_size[j];k++){
- if((((char *)addr_frag1) + k != 0) && (((char *)addr_frag2) + k != 0)){
- if(memcmp(((char *)addr_frag1) + k, ((char *)addr_frag2) + k, 1) != 0){
- fprintf(stderr, "Different byte (offset=%d) (%p - %p) in fragment %zu in block %zu\n", k, (char *)addr_frag1 + k, (char *)addr_frag2 + k, j, i); fflush(NULL);
- pointer_align = (k / sizeof(void*)) * sizeof(void*);
- address_pointed1 = *((void **)((char *)addr_frag1 + pointer_align));
- address_pointed2 = *((void **)((char *)addr_frag2 + pointer_align));
- if(((address_pointed1 > (void *)s_heap) && (address_pointed1 < mdp1->breakval)) && ((address_pointed2 > (void *)s_heap) && (address_pointed2 < mdp2->breakval))){
- block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
- block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
- if((block_pointed1 == 0) && (block_pointed2 == 0)){
- block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
- block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
- if(mdp1->heapinfo[block_pointed1].type == mdp2->heapinfo[block_pointed2].type){
- if(mdp1->heapinfo[block_pointed1].type == 0){ // Large block
- if(mdp1->heapinfo[block_pointed1].busy_block.busy_size == mdp2->heapinfo[block_pointed2].busy_block.busy_size){
- addr_block_pointed1 = (char*)heapbase1 + ((block_pointed1 - 1)*BLOCKSIZE);
- addr_block_pointed2 = (char*)heapbase2 + ((block_pointed2 - 1)*BLOCKSIZE);
- fprintf(stderr, "Memcmp between blocks %d and %d (size = %zu)\n", block_pointed1, block_pointed2, mdp1->heapinfo[block_pointed1].busy_block.busy_size);
- if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_block.busy_size) != 0){
- distance++;
- }else{
- fprintf(stderr, "False difference detected\n");
- }
- }else{
- distance++;
- }
- }else{ // Fragmented block
- addr_block_pointed1 = (char*)mdp1 + ((char *)address_pointed1 - (char *)s_heap);
- addr_block_pointed2 = (char*)mdp2 + ((char *)address_pointed2 - (char *)s_heap);
- if(mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0] == mdp2->heapinfo[block_pointed2].busy_frag.frag_size[0]){
- if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0]) != 0){
- distance++;
- }else{
- fprintf(stderr, "False difference detected\n");
- }
- }else{
- distance ++;
- }
- }
- }else{
- fprintf(stderr, "Pointers on blocks with different types \n");
- distance++;
- }
- }else{
- /* FIXME : peut pointer vers le début d'un fragment mais dans un bloc */
- fprintf(stderr, "Pointed addresses (%p - %p) not valid \n", address_pointed1, address_pointed2);
- distance++;
- }
- }else{
- fprintf(stderr, "Pointed addresses (%p - %p) not in std_heap\n", address_pointed1, address_pointed2);
- distance++;
- }
- }
- }
-
- }
-
- if(distance > 0){
- fprintf(stderr,"\nDifferent data in fragment %zu (size = %zu, size used = %hu) in block %zu \n", j, frag_size, mdp1->heapinfo[i].busy_frag.frag_size[j], i);
- fprintf(stderr, "Hamming distance between fragments : %d\n", distance);
- mmalloc_backtrace_fragment_display(mdp1, i, j);
- mmalloc_backtrace_fragment_display(mdp2, i, j);
- fprintf(stderr, "\n");
- errors++;
- total_distance += distance;
-
- }
-
- }
- }
-
- i++;
+ if(mdp1->heapinfo[i].type != mdp2->heapinfo[i].type){
+ fprintf(stderr,"Different size of fragments in fragmented block %zu : %d - %d\n", i, mdp1->heapinfo[i].type, mdp2->heapinfo[i].type); fflush(NULL);
+ errors++;
+ }
+
+ if(mdp1->heapinfo[i].busy_frag.nfree != mdp2->heapinfo[i].busy_frag.nfree){
+ fprintf(stderr,"Different free fragments in fragmented block %zu : %zu - %zu\n", i, mdp1->heapinfo[i].busy_frag.nfree, mdp2->heapinfo[i].busy_frag.nfree); fflush(NULL);
+ errors++;
+ }
+
+ if(mdp1->heapinfo[i].busy_frag.first != mdp2->heapinfo[i].busy_frag.first){
+ fprintf(stderr,"Different busy_size of a large cluster : %zu - %zu\n", mdp1->heapinfo[i].busy_block.busy_size, mdp2->heapinfo[i].busy_block.busy_size); fflush(NULL);
+ errors++;
+ }
+
+ frag_size = pow(2, mdp1->heapinfo[i].type);
+
+ for(j=0; j< (BLOCKSIZE/frag_size); j++){
+
+ if(mdp1->heapinfo[i].busy_frag.frag_size[j] != mdp2->heapinfo[i].busy_frag.frag_size[j]){
+ fprintf(stderr,"Different busy_size for fragment %zu in block %zu : %hu - %hu\n", j, i, mdp1->heapinfo[i].busy_frag.frag_size[j], mdp2->heapinfo[i].busy_frag.frag_size[j]); fflush(NULL);
+ errors++;
+ }
+
+ if(mdp1->heapinfo[i].busy_frag.frag_size[j] > 0){
+
+ addr_frag1 = (char *)addr_block1 + (j * frag_size);
+ xbt_assert(addr_frag1 < breakval1, "Fragment address out of heap memory used");
+
+ addr_frag2 = (char *)addr_block2 + (j * frag_size);
+ xbt_assert(addr_frag1 < breakval1, "Fragment address out of heap memory used");
+
+ /* Hamming distance on different blocks */
+ distance = 0;
+ //for(k=0;k<frag_size;k++){
+ for(k=0;k<mdp1->heapinfo[i].busy_frag.frag_size[j];k++){
+ if((((char *)addr_frag1) + k != 0) && (((char *)addr_frag2) + k != 0)){
+ if(memcmp(((char *)addr_frag1) + k, ((char *)addr_frag2) + k, 1) != 0){
+ fprintf(stderr, "Different byte (offset=%d) (%p - %p) in fragment %zu in block %zu\n", k, (char *)addr_frag1 + k, (char *)addr_frag2 + k, j, i); fflush(NULL);
+ pointer_align = (k / sizeof(void*)) * sizeof(void*);
+ address_pointed1 = *((void **)((char *)addr_frag1 + pointer_align));
+ address_pointed2 = *((void **)((char *)addr_frag2 + pointer_align));
+ if(((address_pointed1 > (void *)s_heap) && (address_pointed1 < mdp1->breakval)) && ((address_pointed2 > (void *)s_heap) && (address_pointed2 < mdp2->breakval))){
+ block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
+ block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) % BLOCKSIZE;
+ if((block_pointed1 == 0) && (block_pointed2 == 0)){
+ block_pointed1 = ((char*)address_pointed1 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
+ block_pointed2 = ((char*)address_pointed2 - (char*)((struct mdesc*)s_heap)->heapbase) / BLOCKSIZE + 1;
+ if(mdp1->heapinfo[block_pointed1].type == mdp2->heapinfo[block_pointed2].type){
+ if(mdp1->heapinfo[block_pointed1].type == 0){ // Large block
+ if(mdp1->heapinfo[block_pointed1].busy_block.busy_size == mdp2->heapinfo[block_pointed2].busy_block.busy_size){
+ addr_block_pointed1 = (char*)heapbase1 + ((block_pointed1 - 1)*BLOCKSIZE);
+ addr_block_pointed2 = (char*)heapbase2 + ((block_pointed2 - 1)*BLOCKSIZE);
+ fprintf(stderr, "Memcmp between blocks %d and %d (size = %zu)\n", block_pointed1, block_pointed2, mdp1->heapinfo[block_pointed1].busy_block.busy_size);
+ if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_block.busy_size) != 0){
+ distance++;
+ }else{
+ fprintf(stderr, "False difference detected\n");
+ }
+ }else{
+ distance++;
+ }
+ }else{ // Fragmented block
+ addr_block_pointed1 = (char*)mdp1 + ((char *)address_pointed1 - (char *)s_heap);
+ addr_block_pointed2 = (char*)mdp2 + ((char *)address_pointed2 - (char *)s_heap);
+ if(mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0] == mdp2->heapinfo[block_pointed2].busy_frag.frag_size[0]){
+ if(memcmp(addr_block_pointed1, addr_block_pointed2, mdp1->heapinfo[block_pointed1].busy_frag.frag_size[0]) != 0){
+ distance++;
+ }else{
+ fprintf(stderr, "False difference detected\n");
+ }
+ }else{
+ distance ++;
+ }
+ }
+ }else{
+ fprintf(stderr, "Pointers on blocks with different types \n");
+ distance++;
+ }
+ }else{
+ /* FIXME : peut pointer vers le début d'un fragment mais dans un bloc */
+ fprintf(stderr, "Pointed addresses (%p - %p) not valid \n", address_pointed1, address_pointed2);
+ distance++;
+ }
+ }else{
+ fprintf(stderr, "Pointed addresses (%p - %p) not in std_heap\n", address_pointed1, address_pointed2);
+ distance++;
+ }
+ }
+ }
+
+ }
+
+ if(distance > 0){
+ fprintf(stderr,"\nDifferent data in fragment %zu (size = %zu, size used = %hu) in block %zu \n", j, frag_size, mdp1->heapinfo[i].busy_frag.frag_size[j], i);
+ fprintf(stderr, "Hamming distance between fragments : %d\n", distance);
+ mmalloc_backtrace_fragment_display(mdp1, i, j);
+ mmalloc_backtrace_fragment_display(mdp2, i, j);
+ fprintf(stderr, "\n");
+ errors++;
+ total_distance += distance;
+
+ }
+
+ }
+ }
+
+ i++;
}else{ /* free block */
- i++;
+ i++;
}
else if (sbuf.st_size > 0) {
/* We were given an valid file descriptor on an open file, so try to remap
- it into the current process at the same address to which it was previously
- mapped. It naturally have to pass some sanity checks for that.
+ it into the current process at the same address to which it was previously
+ mapped. It naturally have to pass some sanity checks for that.
- Note that we have to update the file descriptor number in the malloc-
- descriptor read from the file to match the current valid one, before
- trying to map the file in, and again after a successful mapping and
- after we've switched over to using the mapped in malloc descriptor
- rather than the temporary one on the stack.
+ Note that we have to update the file descriptor number in the malloc-
+ descriptor read from the file to match the current valid one, before
+ trying to map the file in, and again after a successful mapping and
+ after we've switched over to using the mapped in malloc descriptor
+ rather than the temporary one on the stack.
- Once we've switched over to using the mapped in malloc descriptor, we
- have to update the pointer to the morecore function, since it almost
- certainly will be at a different address if the process reusing the
- mapped region is from a different executable.
+ Once we've switched over to using the mapped in malloc descriptor, we
+ have to update the pointer to the morecore function, since it almost
+ certainly will be at a different address if the process reusing the
+ mapped region is from a different executable.
- Also note that if the heap being remapped previously used the mmcheckf()
- routines, we need to update the hooks since their target functions
- will have certainly moved if the executable has changed in any way.
- We do this by calling mmcheckf() internally.
+ Also note that if the heap being remapped previously used the mmcheckf()
+ routines, we need to update the hooks since their target functions
+ will have certainly moved if the executable has changed in any way.
+ We do this by calling mmcheckf() internally.
- Returns a pointer to the malloc descriptor if successful, or NULL if
- unsuccessful for some reason. */
+ Returns a pointer to the malloc descriptor if successful, or NULL if
+ unsuccessful for some reason. */
struct mdesc newmd;
struct mdesc *mdptr = NULL, *mdptemp = NULL;
if (lseek(fd, 0L, SEEK_SET) != 0)
- return NULL;
+ return NULL;
if (read(fd, (char *) &newmd, sizeof(newmd)) != sizeof(newmd))
- return NULL;
+ return NULL;
if (newmd.headersize != sizeof(newmd))
- return NULL;
+ return NULL;
if (strcmp(newmd.magic, MMALLOC_MAGIC) != 0)
- return NULL;
+ return NULL;
if (newmd.version > MMALLOC_VERSION)
- return NULL;
+ return NULL;
newmd.fd = fd;
if (__mmalloc_remap_core(&newmd) == newmd.base) {
- mdptr = (struct mdesc *) newmd.base;
- mdptr->fd = fd;
- if(!mdptr->refcount){
- sem_init(&mdptr->sem, 0, 1);
- mdptr->refcount++;
- }
+ mdptr = (struct mdesc *) newmd.base;
+ mdptr->fd = fd;
+ if(!mdptr->refcount){
+ sem_init(&mdptr->sem, 0, 1);
+ mdptr->refcount++;
+ }
}
/* Add the new heap to the linked list of heaps attached by mmalloc */
mdptemp = __mmalloc_default_mdp;
while(mdptemp->next_mdesc)
- mdptemp = mdptemp->next_mdesc;
+ mdptemp = mdptemp->next_mdesc;
LOCK(mdptemp);
mdptemp->next_mdesc = mdptr;
__mmalloc_default_mdp = xbt_mheap_new(-1, addr);
/* Fixme? only the default mdp in protected against forks */
res = xbt_os_thread_atfork(mmalloc_fork_prepare,
- mmalloc_fork_parent, mmalloc_fork_child);
+ mmalloc_fork_parent, mmalloc_fork_child);
if (res != 0)
THROWF(system_error,0,"xbt_os_thread_atfork() failed: return value %d",res);
}
}
if (--mdp->heapinfo[block].busy_frag.nfree != 0) {
mdp->heapinfo[block].busy_frag.first =
- RESIDUAL(next->next, BLOCKSIZE) >> log;
+ RESIDUAL(next->next, BLOCKSIZE) >> log;
}
/* Update the statistics. */
/* Link all fragments but the first into the free list, and mark their requested size to 0. */
block = BLOCK(result);
for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i) {
- mdp->heapinfo[block].busy_frag.frag_size[i] = 0;
+ mdp->heapinfo[block].busy_frag.frag_size[i] = 0;
next = (struct list *) ((char *) result + (i << log));
next->next = mdp->fraghead[log].next;
next->prev = &mdp->fraghead[log];
start = block = MALLOC_SEARCH_START;
while (mdp->heapinfo[block].free_block.size < blocks) {
if (mdp->heapinfo[block].type >=0) { // Don't trust xbt_die and friends in malloc-level library, you fool!
- fprintf(stderr,"Internal error: found a free block not marked as such (block=%lu type=%lu). Please report this bug.\n",(unsigned long)block,(unsigned long)mdp->heapinfo[block].type);
- abort();
+ fprintf(stderr,"Internal error: found a free block not marked as such (block=%lu type=%lu). Please report this bug.\n",(unsigned long)block,(unsigned long)mdp->heapinfo[block].type);
+ abort();
}
block = mdp->heapinfo[block].free_block.next;
continue;
}
result = register_morecore(mdp, blocks * BLOCKSIZE);
- memset(result, 0, requested_size);
+ memset(result, 0, requested_size);
block = BLOCK(result);
for (it=0;it<blocks;it++)
- mdp->heapinfo[block+it].type = 0;
+ mdp->heapinfo[block+it].type = 0;
mdp->heapinfo[block].busy_block.size = blocks;
mdp->heapinfo[block].busy_block.busy_size = requested_size;
mdp->heapinfo[block].busy_block.bt_size=xbt_backtrace_no_malloc(mdp->heapinfo[block].busy_block.bt,XBT_BACKTRACE_SIZE);
- mdp -> heapstats.chunks_used++;
- mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
+ mdp -> heapstats.chunks_used++;
+ mdp -> heapstats.bytes_used += blocks * BLOCKSIZE;
return result;
}
/* Need large block(s), but found some in the existing heap */
/* The block we found has a bit left over,
so relink the tail end back into the free list. */
mdp->heapinfo[block + blocks].free_block.size
- = mdp->heapinfo[block].free_block.size - blocks;
+ = mdp->heapinfo[block].free_block.size - blocks;
mdp->heapinfo[block + blocks].free_block.next
- = mdp->heapinfo[block].free_block.next;
+ = mdp->heapinfo[block].free_block.next;
mdp->heapinfo[block + blocks].free_block.prev
- = mdp->heapinfo[block].free_block.prev;
+ = mdp->heapinfo[block].free_block.prev;
mdp->heapinfo[mdp->heapinfo[block].free_block.prev].free_block.next
- = mdp->heapinfo[mdp->heapinfo[block].free_block.next].free_block.prev
- = mdp->heapindex = block + blocks;
+ = mdp->heapinfo[mdp->heapinfo[block].free_block.next].free_block.prev
+ = mdp->heapindex = block + blocks;
} else {
/* The block exactly matches our requirements,
so just remove it from the list. */
mdp->heapinfo[mdp->heapinfo[block].free_block.next].free_block.prev
- = mdp->heapinfo[block].free_block.prev;
+ = mdp->heapinfo[block].free_block.prev;
mdp->heapinfo[mdp->heapinfo[block].free_block.prev].free_block.next
- = mdp->heapindex = mdp->heapinfo[block].free_block.next;
+ = mdp->heapindex = mdp->heapinfo[block].free_block.next;
}
for (it=0;it<blocks;it++)
static size_t pagesize;
#define PAGE_ALIGN(addr) (void*) (((long)(addr) + pagesize - 1) & \
- ~(pagesize - 1))
+ ~(pagesize - 1))
/* Return MAP_PRIVATE if MDP represents /dev/zero. Otherwise, return
MAP_SHARED. */
/* Return -1 if MDP uses anonymous mapping. Otherwise, return MDP->FD */
#define MAP_ANON_OR_FD(MDP) (((MDP) -> flags & MMALLOC_ANONYMOUS) \
? -1 \
- : (MDP) -> fd)
+ : (MDP) -> fd)
/* Get core for the memory region specified by MDP, using SIZE as the
amount to either add to or subtract from the existing region. Works
(size_t) (((char *) mdp->top) - ((char *) moveto)) - 1);
mdp->top = moveto;
} else {
- fprintf(stderr,"Internal error: mmap was asked to deallocate more memory than it previously allocated. Bailling out now!\n");
- abort();
+ fprintf(stderr,"Internal error: mmap was asked to deallocate more memory than it previously allocated. Bailling out now!\n");
+ abort();
}
} else {
/* We are allocating memory. Make sure we have an open file
descriptor if not working with anonymous memory. */
if (!(mdp->flags & MMALLOC_ANONYMOUS) && mdp->fd < 0) {
- fprintf(stderr,"Internal error: mmap file descriptor <0 (%d), without MMALLOC_ANONYMOUS being in the flags.\n",mdp->fd);
- abort();
+ fprintf(stderr,"Internal error: mmap file descriptor <0 (%d), without MMALLOC_ANONYMOUS being in the flags.\n",mdp->fd);
+ abort();
} else if ((char *) mdp->breakval + size > (char *) mdp->top) {
/* The request would move us past the end of the currently
mapped memory, so map in enough more memory to satisfy
lseek(mdp->fd, foffset + mapbytes - 1, SEEK_SET);
test = write(mdp->fd, &buf, 1);
if (test == -1) {
- fprintf(stderr,"Internal error: write to mmap'ed fd failed! error: %s", strerror(errno));
- abort();
+ fprintf(stderr,"Internal error: write to mmap'ed fd failed! error: %s", strerror(errno));
+ abort();
}
}
MAP_FIXED, MAP_ANON_OR_FD(mdp), foffset);
if (mapto == (void *) -1/* That's MAP_FAILED */) {
- fprintf(stderr,"Internal error: mmap returned MAP_FAILED! error: %s",strerror(errno));
- abort();
+ fprintf(stderr,"Internal error: mmap returned MAP_FAILED! error: %s",strerror(errno));
+ abort();
}
if (mdp->top == 0)
- mdp->base = mdp->breakval = mapto;
+ mdp->base = mdp->breakval = mapto;
mdp->top = PAGE_ALIGN((char *) mdp->breakval + size);
result = (void *) mdp->breakval;
# endif
#endif
-#define MMALLOC_MAGIC "mmalloc" /* Mapped file magic number */
-#define MMALLOC_MAGIC_SIZE 8 /* Size of magic number buf */
-#define MMALLOC_VERSION 2 /* Current mmalloc version */
+#define MMALLOC_MAGIC "mmalloc" /* Mapped file magic number */
+#define MMALLOC_MAGIC_SIZE 8 /* Size of magic number buf */
+#define MMALLOC_VERSION 2 /* Current mmalloc version */
/* The allocator divides the heap into blocks of fixed size; large
requests receive one or more whole blocks, and small requests
FIXME: we are not targeting 16bits machines anymore; update values */
-#define INT_BIT (CHAR_BIT * sizeof(int))
-#define BLOCKLOG (INT_BIT > 16 ? 12 : 9)
-#define BLOCKSIZE ((unsigned int) 1 << BLOCKLOG)
-#define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE)
+#define INT_BIT (CHAR_BIT * sizeof(int))
+#define BLOCKLOG (INT_BIT > 16 ? 12 : 9)
+#define BLOCKSIZE ((unsigned int) 1 << BLOCKLOG)
+#define BLOCKIFY(SIZE) (((SIZE) + BLOCKSIZE - 1) / BLOCKSIZE)
/* We keep fragment-specific meta-data for introspection purposes, and these
* information are kept in fixed lenght arrays. Here is the computation of
sign of the result is machine dependent for negative values, so force
it to be treated as an unsigned int. */
-#define ADDR2UINT(addr) ((uintptr_t) ((char*) (addr) - (char*) NULL))
+#define ADDR2UINT(addr) ((uintptr_t) ((char*) (addr) - (char*) NULL))
#define RESIDUAL(addr,bsize) ((uintptr_t) (ADDR2UINT (addr) % (bsize)))
/* Determine the amount of memory spanned by the initial heap table
(not an absolute limit). */
-#define HEAP (INT_BIT > 16 ? 4194304 : 65536)
+#define HEAP (INT_BIT > 16 ? 4194304 : 65536)
/* Number of contiguous free blocks allowed to build up at the end of
memory before they will be returned to the system.
FIXME: this is not used anymore: we never return memory to the system. */
-#define FINAL_FREE_BLOCKS 8
+#define FINAL_FREE_BLOCKS 8
/* Where to start searching the free list when looking for new memory.
The two possible values are 0 and heapindex. Starting at 0 seems
to reduce total memory usage, while starting at heapindex seems to
run faster. */
-#define MALLOC_SEARCH_START mdp -> heapindex
+#define MALLOC_SEARCH_START mdp -> heapindex
/* Address to block number and vice versa. */
/* Statistics available to the user. */
struct mstats
{
- size_t bytes_total; /* Total size of the heap. */
- size_t chunks_used; /* Chunks allocated by the user. */
- size_t bytes_used; /* Byte total of user-allocated chunks. */
- size_t chunks_free; /* Chunks in the free list. */
- size_t bytes_free; /* Byte total of chunks in the free list. */
+ size_t bytes_total; /* Total size of the heap. */
+ size_t chunks_used; /* Chunks allocated by the user. */
+ size_t bytes_used; /* Byte total of user-allocated chunks. */
+ size_t chunks_free; /* Chunks in the free list. */
+ size_t bytes_free; /* Byte total of chunks in the free list. */
};
/* Data structure giving per-block information.
*/
typedef struct {
int type; /* 0: busy large block
- >0: busy fragmented (fragments of size 2^type bytes)
- <0: free block */
+ >0: busy fragmented (fragments of size 2^type bytes)
+ <0: free block */
union {
/* Heap information for a busy block. */
struct {
/* Bits to look at in the malloc descriptor flags word */
-#define MMALLOC_DEVZERO (1 << 0) /* Have mapped to /dev/zero */
+#define MMALLOC_DEVZERO (1 << 0) /* Have mapped to /dev/zero */
#define MMALLOC_ANONYMOUS (1 << 1) /* Use anonymous mapping */
-#define MMALLOC_INITIALIZED (1 << 2) /* Initialized mmalloc */
+#define MMALLOC_INITIALIZED (1 << 2) /* Initialized mmalloc */
/* A default malloc descriptor for the single sbrk() managed region. */
/* Change the size of a block allocated by `mmalloc'.
Copyright 1990, 1991 Free Software Foundation
- Written May 1989 by Mike Haertel. */
+ Written May 1989 by Mike Haertel. */
/* Copyright (c) 2010. The SimGrid Team.
* All rights reserved. */
/* The new size is smaller; return excess memory to the free list. */
//printf("(%s) return excess memory...",xbt_thread_self_name());
for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++)
- mdp->heapinfo[it].type = 0; // FIXME that should be useless, type should already be 0 here
+ mdp->heapinfo[it].type = 0; // FIXME that should be useless, type should already be 0 here
mdp->heapinfo[block + blocks].busy_block.size
= mdp->heapinfo[block].busy_block.size - blocks;
* http://www.ijs.si/software/snprintf/
*
* REVISION HISTORY
- * 1999-04 V0.9 Mark Martinec
- * - initial version, some modifications after comparing printf
- * man pages for Digital Unix 4.0, Solaris 2.6 and HPUX 10,
- * and checking how Perl handles sprintf (differently!);
- * 1999-04-09 V1.0 Mark Martinec <mark.martinec@ijs.si>
- * - added main test program, fixed remaining inconsistencies,
- * added optional (long long int) support;
- * 1999-04-12 V1.1 Mark Martinec <mark.martinec@ijs.si>
- * - support the 'p' conversion (pointer to void);
- * - if a string precision is specified
- * make sure the string beyond the specified precision
- * will not be referenced (e.g. by strlen);
- * 1999-04-13 V1.2 Mark Martinec <mark.martinec@ijs.si>
- * - support synonyms %D=%ld, %U=%lu, %O=%lo;
- * - speed up the case of long format string with few conversions;
- * 1999-06-30 V1.3 Mark Martinec <mark.martinec@ijs.si>
- * - fixed runaway loop (eventually crashing when str_l wraps
- * beyond 2^31) while copying format string without
- * conversion specifiers to a buffer that is too short
- * (thanks to Edwin Young <edwiny@autonomy.com> for
- * spotting the problem);
- * - added macros PORTABLE_SNPRINTF_VERSION_(MAJOR|MINOR)
- * to snprintf.h
- * 2000-02-14 V2.0 (never released) Mark Martinec <mark.martinec@ijs.si>
- * - relaxed license terms: The Artistic License now applies.
- * You may still apply the GNU GENERAL PUBLIC LICENSE
- * as was distributed with previous versions, if you prefer;
- * - changed REVISION HISTORY dates to use ISO 8601 date format;
- * - added vsnprintf (patch also independently proposed by
- * Caolan McNamara 2000-05-04, and Keith M Willenson 2000-06-01)
- * 2000-06-27 V2.1 Mark Martinec <mark.martinec@ijs.si>
- * - removed POSIX check for str_m<1; value 0 for str_m is
- * allowed by ISO C99 (and GNU C library 2.1) - (pointed out
- * on 2000-05-04 by Caolan McNamara, caolan@ csn dot ul dot ie).
- * Besides relaxed license this change in standards adherence
- * is the main reason to bump up the major version number;
- * - added nonstandard routines asnprintf, vasnprintf, asprintf,
- * vasprintf that dynamically allocate storage for the
- * resulting string; these routines are not compiled by default,
- * see comments where NEED_V?ASN?PRINTF macros are defined;
- * - autoconf contributed by Caolan McNamara
- * 2000-10-06 V2.2 Mark Martinec <mark.martinec@ijs.si>
- * - BUG FIX: the %c conversion used a temporary variable
- * that was no longer in scope when referenced,
- * possibly causing incorrect resulting character;
- * - BUG FIX: make precision and minimal field width unsigned
- * to handle huge values (2^31 <= n < 2^32) correctly;
- * also be more careful in the use of signed/unsigned/size_t
- * internal variables - probably more careful than many
- * vendor implementations, but there may still be a case
- * where huge values of str_m, precision or minimal field
- * could cause incorrect behaviour;
- * - use separate variables for signed/unsigned arguments,
- * and for short/int, long, and long long argument lengths
- * to avoid possible incompatibilities on certain
- * computer architectures. Also use separate variable
- * arg_sign to hold sign of a numeric argument,
- * to make code more transparent;
- * - some fiddling with zero padding and "0x" to make it
- * Linux compatible;
- * - systematically use macros fast_memcpy and fast_memset
- * instead of case-by-case hand optimization; determine some
- * breakeven string lengths for different architectures;
- * - terminology change: 'format' -> 'conversion specifier',
- * 'C9x' -> 'ISO/IEC 9899:1999 ("ISO C99")',
- * 'alternative form' -> 'alternate form',
- * 'data type modifier' -> 'length modifier';
- * - several comments rephrased and new ones added;
- * - make compiler not complain about 'credits' defined but
- * not used;
+ * 1999-04 V0.9 Mark Martinec
+ * - initial version, some modifications after comparing printf
+ * man pages for Digital Unix 4.0, Solaris 2.6 and HPUX 10,
+ * and checking how Perl handles sprintf (differently!);
+ * 1999-04-09 V1.0 Mark Martinec <mark.martinec@ijs.si>
+ * - added main test program, fixed remaining inconsistencies,
+ * added optional (long long int) support;
+ * 1999-04-12 V1.1 Mark Martinec <mark.martinec@ijs.si>
+ * - support the 'p' conversion (pointer to void);
+ * - if a string precision is specified
+ * make sure the string beyond the specified precision
+ * will not be referenced (e.g. by strlen);
+ * 1999-04-13 V1.2 Mark Martinec <mark.martinec@ijs.si>
+ * - support synonyms %D=%ld, %U=%lu, %O=%lo;
+ * - speed up the case of long format string with few conversions;
+ * 1999-06-30 V1.3 Mark Martinec <mark.martinec@ijs.si>
+ * - fixed runaway loop (eventually crashing when str_l wraps
+ * beyond 2^31) while copying format string without
+ * conversion specifiers to a buffer that is too short
+ * (thanks to Edwin Young <edwiny@autonomy.com> for
+ * spotting the problem);
+ * - added macros PORTABLE_SNPRINTF_VERSION_(MAJOR|MINOR)
+ * to snprintf.h
+ * 2000-02-14 V2.0 (never released) Mark Martinec <mark.martinec@ijs.si>
+ * - relaxed license terms: The Artistic License now applies.
+ * You may still apply the GNU GENERAL PUBLIC LICENSE
+ * as was distributed with previous versions, if you prefer;
+ * - changed REVISION HISTORY dates to use ISO 8601 date format;
+ * - added vsnprintf (patch also independently proposed by
+ * Caolan McNamara 2000-05-04, and Keith M Willenson 2000-06-01)
+ * 2000-06-27 V2.1 Mark Martinec <mark.martinec@ijs.si>
+ * - removed POSIX check for str_m<1; value 0 for str_m is
+ * allowed by ISO C99 (and GNU C library 2.1) - (pointed out
+ * on 2000-05-04 by Caolan McNamara, caolan@ csn dot ul dot ie).
+ * Besides relaxed license this change in standards adherence
+ * is the main reason to bump up the major version number;
+ * - added nonstandard routines asnprintf, vasnprintf, asprintf,
+ * vasprintf that dynamically allocate storage for the
+ * resulting string; these routines are not compiled by default,
+ * see comments where NEED_V?ASN?PRINTF macros are defined;
+ * - autoconf contributed by Caolan McNamara
+ * 2000-10-06 V2.2 Mark Martinec <mark.martinec@ijs.si>
+ * - BUG FIX: the %c conversion used a temporary variable
+ * that was no longer in scope when referenced,
+ * possibly causing incorrect resulting character;
+ * - BUG FIX: make precision and minimal field width unsigned
+ * to handle huge values (2^31 <= n < 2^32) correctly;
+ * also be more careful in the use of signed/unsigned/size_t
+ * internal variables - probably more careful than many
+ * vendor implementations, but there may still be a case
+ * where huge values of str_m, precision or minimal field
+ * could cause incorrect behaviour;
+ * - use separate variables for signed/unsigned arguments,
+ * and for short/int, long, and long long argument lengths
+ * to avoid possible incompatibilities on certain
+ * computer architectures. Also use separate variable
+ * arg_sign to hold sign of a numeric argument,
+ * to make code more transparent;
+ * - some fiddling with zero padding and "0x" to make it
+ * Linux compatible;
+ * - systematically use macros fast_memcpy and fast_memset
+ * instead of case-by-case hand optimization; determine some
+ * breakeven string lengths for different architectures;
+ * - terminology change: 'format' -> 'conversion specifier',
+ * 'C9x' -> 'ISO/IEC 9899:1999 ("ISO C99")',
+ * 'alternative form' -> 'alternate form',
+ * 'data type modifier' -> 'length modifier';
+ * - several comments rephrased and new ones added;
+ * - make compiler not complain about 'credits' defined but
+ * not used;
*/
check_overflow(len);
}
else if (!procname) {
- len = snprintf(p, rem_size, "%s::(%d) ",
- gras_os_myname(), xbt_getpid());
- check_overflow(len);
+ len = snprintf(p, rem_size, "%s::(%d) ",
+ gras_os_myname(), xbt_getpid());
+ check_overflow(len);
}
/* Display the date */
LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH
- && xbt_dll_process_is_attached == 0) {
- xbt_dll_process_is_attached = 1;
- xbt_preinit();
+ && xbt_dll_process_is_attached == 0) {
+ xbt_dll_process_is_attached = 1;
+ xbt_preinit();
} else if (fdwReason == DLL_PROCESS_DETACH
- && xbt_dll_process_is_attached == 1) {
- xbt_dll_process_is_attached = 0;
+ && xbt_dll_process_is_attached == 1) {
+ xbt_dll_process_is_attached = 0;
xbt_postexit();
}
return 1;
void (*parent)(void), void (*child)(void))
{
#ifdef WIN32
- THROW_UNIMPLEMENTED; //pthread_atfork is not implemented in pthread.h on windows
+ THROW_UNIMPLEMENTED; //pthread_atfork is not implemented in pthread.h on windows
#else
return pthread_atfork(prepare, parent, child);
#endif
#endif
/* the default size of the stack of the threads (in bytes)*/
-#define XBT_DEFAULT_THREAD_STACK_SIZE 4096
+#define XBT_DEFAULT_THREAD_STACK_SIZE 4096
/* key to the TLS containing the xbt_os_thread_t structure */
static unsigned long xbt_self_thread_key;
* Strips the whitespaces from the end of s.
* By default (when char_list=NULL), these characters get stripped:
*
- * - " " (ASCII 32 (0x20)) space.
- * - "\t" (ASCII 9 (0x09)) tab.
- * - "\n" (ASCII 10 (0x0A)) line feed.
- * - "\r" (ASCII 13 (0x0D)) carriage return.
- * - "\0" (ASCII 0 (0x00)) NULL.
- * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
+ * - " " (ASCII 32 (0x20)) space.
+ * - "\t" (ASCII 9 (0x09)) tab.
+ * - "\n" (ASCII 10 (0x0A)) line feed.
+ * - "\r" (ASCII 13 (0x0D)) carriage return.
+ * - "\0" (ASCII 0 (0x00)) NULL.
+ * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
*
* @param s The string to strip. Modified in place.
* @param char_list A string which contains the characters you want to strip.
* Strips the whitespaces from the begining of s.
* By default (when char_list=NULL), these characters get stripped:
*
- * - " " (ASCII 32 (0x20)) space.
- * - "\t" (ASCII 9 (0x09)) tab.
- * - "\n" (ASCII 10 (0x0A)) line feed.
- * - "\r" (ASCII 13 (0x0D)) carriage return.
- * - "\0" (ASCII 0 (0x00)) NULL.
- * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
+ * - " " (ASCII 32 (0x20)) space.
+ * - "\t" (ASCII 9 (0x09)) tab.
+ * - "\n" (ASCII 10 (0x0A)) line feed.
+ * - "\r" (ASCII 13 (0x0D)) carriage return.
+ * - "\0" (ASCII 0 (0x00)) NULL.
+ * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
*
* @param s The string to strip. Modified in place.
* @param char_list A string which contains the characters you want to strip.
* Strips the whitespaces from both the beginning and the end of s.
* By default (when char_list=NULL), these characters get stripped:
*
- * - " " (ASCII 32 (0x20)) space.
- * - "\t" (ASCII 9 (0x09)) tab.
- * - "\n" (ASCII 10 (0x0A)) line feed.
- * - "\r" (ASCII 13 (0x0D)) carriage return.
- * - "\0" (ASCII 0 (0x00)) NULL.
- * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
+ * - " " (ASCII 32 (0x20)) space.
+ * - "\t" (ASCII 9 (0x09)) tab.
+ * - "\n" (ASCII 10 (0x0A)) line feed.
+ * - "\r" (ASCII 13 (0x0D)) carriage return.
+ * - "\0" (ASCII 0 (0x00)) NULL.
+ * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
*
* @param s The string to strip.
* @param char_list A string which contains the characters you want to strip.
*
* By default (with sep=NULL), these characters are used as separator:
*
- * - " " (ASCII 32 (0x20)) space.
- * - "\t" (ASCII 9 (0x09)) tab.
- * - "\n" (ASCII 10 (0x0A)) line feed.
- * - "\r" (ASCII 13 (0x0D)) carriage return.
- * - "\0" (ASCII 0 (0x00)) NULL.
- * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
+ * - " " (ASCII 32 (0x20)) space.
+ * - "\t" (ASCII 9 (0x09)) tab.
+ * - "\n" (ASCII 10 (0x0A)) line feed.
+ * - "\r" (ASCII 13 (0x0D)) carriage return.
+ * - "\0" (ASCII 0 (0x00)) NULL.
+ * - "\x0B" (ASCII 11 (0x0B)) vertical tab.
*/
xbt_dynar_t xbt_str_split(const char *s, const char *sep)
int main(int argc, char **argv)
{
- SD_workstation_t w1, w2;
- const SD_workstation_t *workstations;
- int i, j;
- int list_size;
- xbt_os_timer_t timer = xbt_os_timer_new();
+ SD_workstation_t w1, w2;
+ const SD_workstation_t *workstations;
+ int i, j;
+ int list_size;
+ xbt_os_timer_t timer = xbt_os_timer_new();
- /* initialisation of SD */
- SD_init(&argc, argv);
+ /* initialisation of SD */
+ SD_init(&argc, argv);
- /* creation of the environment */
- SD_create_environment(argv[1]);
+ /* creation of the environment */
+ SD_create_environment(argv[1]);
- workstations = SD_workstation_get_list();
- list_size = SD_workstation_get_number();
+ workstations = SD_workstation_get_list();
+ list_size = SD_workstation_get_number();
- /* Random number initialization */
- srand( (int) (xbt_os_time()*1000) );
+ /* Random number initialization */
+ srand( (int) (xbt_os_time()*1000) );
- do{
- i = rand()%list_size;
- j = rand()%list_size;
- }while(i==j);
+ do{
+ i = rand()%list_size;
+ j = rand()%list_size;
+ }while(i==j);
- w1 = workstations[i];
- w2 = workstations[j];
- printf("%d\tand\t%d\t\t",i,j);
+ w1 = workstations[i];
+ w2 = workstations[j];
+ printf("%d\tand\t%d\t\t",i,j);
- xbt_os_timer_start(timer);
- SD_route_get_list(w1, w2);
+ xbt_os_timer_start(timer);
+ SD_route_get_list(w1, w2);
xbt_os_timer_stop(timer);
- printf("%lf\n", xbt_os_timer_elapsed(timer) );
+ printf("%lf\n", xbt_os_timer_elapsed(timer) );
- SD_exit();
+ SD_exit();
- return 0;
+ return 0;
}
{
xbt_os_timer_t timer = xbt_os_timer_new();
- /* initialization of SD */
- SD_init(&argc, argv);
+ /* initialization of SD */
+ SD_init(&argc, argv);
- /* creation of the environment, timed */
- xbt_os_timer_start(timer);
- SD_create_environment(argv[1]);
+ /* creation of the environment, timed */
+ xbt_os_timer_start(timer);
+ SD_create_environment(argv[1]);
xbt_os_timer_stop(timer);
/* Display the result and exit after cleanup */
- printf( "%lf\n", xbt_os_timer_elapsed(timer) );
- printf("Workstation number: %d, link number: %d\n",
- SD_workstation_get_number(), SD_link_get_number());
- if(argv[2]){
- printf("Wait for %ss\n",argv[2]);
- sleep(atoi(argv[2]));
- }
-
- SD_exit();
-
- free(timer);
- return 0;
+ printf( "%lf\n", xbt_os_timer_elapsed(timer) );
+ printf("Workstation number: %d, link number: %d\n",
+ SD_workstation_get_number(), SD_link_get_number());
+ if(argv[2]){
+ printf("Wait for %ss\n",argv[2]);
+ sleep(atoi(argv[2]));
+ }
+
+ SD_exit();
+
+ free(timer);
+ return 0;
}
SD_workstation_get_number(), SD_link_get_number());
if (argc >= 3) {
- if (!strcmp(argv[2], "ONE_LINK")) {
- workstations = SD_workstation_get_list();
- w1 = workstations[0];
- w2 = workstations[1];
- name1 = SD_workstation_get_name(w1);
- name2 = SD_workstation_get_name(w2);
+ if (!strcmp(argv[2], "ONE_LINK")) {
+ workstations = SD_workstation_get_list();
+ w1 = workstations[0];
+ w2 = workstations[1];
+ name1 = SD_workstation_get_name(w1);
+ name2 = SD_workstation_get_name(w2);
- printf("Route between %s and %s\n", name1, name2);
- route = SD_route_get_list(w1, w2);
- route_size = SD_route_get_size(w1, w2);
- printf("Route size %d\n", route_size);
- for (i = 0; i < route_size; i++) {
- printf(" Link %s: latency = %f, bandwidth = %f\n",
- SD_link_get_name(route[i]),
- SD_link_get_current_latency(route[i]),
- SD_link_get_current_bandwidth(route[i]));
- }
- printf("Route latency = %f, route bandwidth = %f\n",
- SD_route_get_current_latency(w1, w2),
- SD_route_get_current_bandwidth(w1, w2));
- }
- if (!strcmp(argv[2], "FULL_LINK")) {
- workstations = SD_workstation_get_list();
- list_size = SD_workstation_get_number();
- for (i = 0; i < list_size; i++) {
- w1 = workstations[i];
- name1 = SD_workstation_get_name(w1);
- for (j = 0; j < list_size; j++) {
- w2 = workstations[j];
- name2 = SD_workstation_get_name(w2);
- printf("Route between %s and %s\n", name1, name2);
- route = SD_route_get_list(w1, w2);
- route_size = SD_route_get_size(w1, w2);
- printf(" Route size %d\n", route_size);
- for (k = 0; k < route_size; k++) {
- printf(" Link %s: latency = %f, bandwidth = %f\n",
- SD_link_get_name(route[k]),
- SD_link_get_current_latency(route[k]),
- SD_link_get_current_bandwidth(route[k]));
- }
- printf(" Route latency = %f, route bandwidth = %f\n",
- SD_route_get_current_latency(w1, w2),
- SD_route_get_current_bandwidth(w1, w2));
- }
- }
- }
+ printf("Route between %s and %s\n", name1, name2);
+ route = SD_route_get_list(w1, w2);
+ route_size = SD_route_get_size(w1, w2);
+ printf("Route size %d\n", route_size);
+ for (i = 0; i < route_size; i++) {
+ printf(" Link %s: latency = %f, bandwidth = %f\n",
+ SD_link_get_name(route[i]),
+ SD_link_get_current_latency(route[i]),
+ SD_link_get_current_bandwidth(route[i]));
+ }
+ printf("Route latency = %f, route bandwidth = %f\n",
+ SD_route_get_current_latency(w1, w2),
+ SD_route_get_current_bandwidth(w1, w2));
+ }
+ if (!strcmp(argv[2], "FULL_LINK")) {
+ workstations = SD_workstation_get_list();
+ list_size = SD_workstation_get_number();
+ for (i = 0; i < list_size; i++) {
+ w1 = workstations[i];
+ name1 = SD_workstation_get_name(w1);
+ for (j = 0; j < list_size; j++) {
+ w2 = workstations[j];
+ name2 = SD_workstation_get_name(w2);
+ printf("Route between %s and %s\n", name1, name2);
+ route = SD_route_get_list(w1, w2);
+ route_size = SD_route_get_size(w1, w2);
+ printf(" Route size %d\n", route_size);
+ for (k = 0; k < route_size; k++) {
+ printf(" Link %s: latency = %f, bandwidth = %f\n",
+ SD_link_get_name(route[k]),
+ SD_link_get_current_latency(route[k]),
+ SD_link_get_current_bandwidth(route[k]));
+ }
+ printf(" Route latency = %f, route bandwidth = %f\n",
+ SD_route_get_current_latency(w1, w2),
+ SD_route_get_current_bandwidth(w1, w2));
+ }
+ }
+ }
}
SD_exit();
// Routers
xbt_lib_foreach(as_router_lib, cursor_src, key, value1) {
- if(((sg_routing_edge_t)xbt_lib_get_or_null(as_router_lib, key,
- ROUTING_ASR_LEVEL))->rc_type == SURF_NETWORK_ELEMENT_ROUTER)
- {
- printf(" <router id=\"%s\"/>\n",key);
- }
+ if(((sg_routing_edge_t)xbt_lib_get_or_null(as_router_lib, key,
+ ROUTING_ASR_LEVEL))->rc_type == SURF_NETWORK_ELEMENT_ROUTER)
+ {
+ printf(" <router id=\"%s\"/>\n",key);
+ }
}
// Links
xbt_lib_foreach(host_lib, cursor_src, src, value1) // Routes from host
{
value1 = xbt_lib_get_or_null(host_lib,src,ROUTING_HOST_LEVEL);
- xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
- {
- printf(" <route src=\"%s\" dst=\"%s\">\n "
- ,src
- ,dst);
- xbt_dynar_t route=NULL;
- value2 = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
- routing_get_route_and_latency(value1,value2,&route,NULL);
- for(i=0;i<xbt_dynar_length(route) ;i++)
- {
- void *link = xbt_dynar_get_as(route,i,void *);
-
- char *link_name = xbt_strdup(((surf_resource_t)link)->name);
- printf("<link_ctn id=\"%s\"/>",link_name);
- free(link_name);
- }
- printf("\n </route>\n");
- }
- xbt_lib_foreach(as_router_lib, cursor_dst, dst, value2) //to router
- {
- if(routing_get_network_element_type(dst) == SURF_NETWORK_ELEMENT_ROUTER){
- printf(" <route src=\"%s\" dst=\"%s\">\n "
- ,src
- ,dst);
- xbt_dynar_t route=NULL;
- value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
- routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
- for(i=0;i<xbt_dynar_length(route) ;i++)
- {
- void *link = xbt_dynar_get_as(route,i,void *);
-
- char *link_name = xbt_strdup(((surf_resource_t)link)->name);
- printf("<link_ctn id=\"%s\"/>",link_name);
- free(link_name);
- }
- printf("\n </route>\n");
- }
- }
+ xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
+ {
+ printf(" <route src=\"%s\" dst=\"%s\">\n "
+ ,src
+ ,dst);
+ xbt_dynar_t route=NULL;
+ value2 = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
+ routing_get_route_and_latency(value1,value2,&route,NULL);
+ for(i=0;i<xbt_dynar_length(route) ;i++)
+ {
+ void *link = xbt_dynar_get_as(route,i,void *);
+
+ char *link_name = xbt_strdup(((surf_resource_t)link)->name);
+ printf("<link_ctn id=\"%s\"/>",link_name);
+ free(link_name);
+ }
+ printf("\n </route>\n");
+ }
+ xbt_lib_foreach(as_router_lib, cursor_dst, dst, value2) //to router
+ {
+ if(routing_get_network_element_type(dst) == SURF_NETWORK_ELEMENT_ROUTER){
+ printf(" <route src=\"%s\" dst=\"%s\">\n "
+ ,src
+ ,dst);
+ xbt_dynar_t route=NULL;
+ value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
+ routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
+ for(i=0;i<xbt_dynar_length(route) ;i++)
+ {
+ void *link = xbt_dynar_get_as(route,i,void *);
+
+ char *link_name = xbt_strdup(((surf_resource_t)link)->name);
+ printf("<link_ctn id=\"%s\"/>",link_name);
+ free(link_name);
+ }
+ printf("\n </route>\n");
+ }
+ }
}
xbt_lib_foreach(as_router_lib, cursor_src, src, value1) // Routes from router
{
value1 = xbt_lib_get_or_null(as_router_lib,src,ROUTING_ASR_LEVEL);
- if(routing_get_network_element_type(src) == SURF_NETWORK_ELEMENT_ROUTER){
- xbt_lib_foreach(as_router_lib, cursor_dst, dst, value2) //to router
- {
- if(routing_get_network_element_type(dst) == SURF_NETWORK_ELEMENT_ROUTER){
- printf(" <route src=\"%s\" dst=\"%s\">\n "
- ,src
- ,dst);
- xbt_dynar_t route=NULL;
- value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
- routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
- for(i=0;i<xbt_dynar_length(route) ;i++)
- {
- void *link = xbt_dynar_get_as(route,i,void *);
-
- char *link_name = xbt_strdup(((surf_resource_t)link)->name);
- printf("<link_ctn id=\"%s\"/>",link_name);
- free(link_name);
- }
- printf("\n </route>\n");
- }
- }
- xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
- {
- printf(" <route src=\"%s\" dst=\"%s\">\n "
- ,src, dst);
- xbt_dynar_t route=NULL;
- value2 = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
- routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route, NULL);
- for(i=0;i<xbt_dynar_length(route) ;i++)
- {
- void *link = xbt_dynar_get_as(route,i,void *);
-
- char *link_name = xbt_strdup(((surf_resource_t)link)->name);
- printf("<link_ctn id=\"%s\"/>",link_name);
- free(link_name);
- }
- printf("\n </route>\n");
- }
- }
+ if(routing_get_network_element_type(src) == SURF_NETWORK_ELEMENT_ROUTER){
+ xbt_lib_foreach(as_router_lib, cursor_dst, dst, value2) //to router
+ {
+ if(routing_get_network_element_type(dst) == SURF_NETWORK_ELEMENT_ROUTER){
+ printf(" <route src=\"%s\" dst=\"%s\">\n "
+ ,src
+ ,dst);
+ xbt_dynar_t route=NULL;
+ value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
+ routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
+ for(i=0;i<xbt_dynar_length(route) ;i++)
+ {
+ void *link = xbt_dynar_get_as(route,i,void *);
+
+ char *link_name = xbt_strdup(((surf_resource_t)link)->name);
+ printf("<link_ctn id=\"%s\"/>",link_name);
+ free(link_name);
+ }
+ printf("\n </route>\n");
+ }
+ }
+ xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
+ {
+ printf(" <route src=\"%s\" dst=\"%s\">\n "
+ ,src, dst);
+ xbt_dynar_t route=NULL;
+ value2 = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
+ routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route, NULL);
+ for(i=0;i<xbt_dynar_length(route) ;i++)
+ {
+ void *link = xbt_dynar_get_as(route,i,void *);
+
+ char *link_name = xbt_strdup(((surf_resource_t)link)->name);
+ printf("<link_ctn id=\"%s\"/>",link_name);
+ free(link_name);
+ }
+ printf("\n </route>\n");
+ }
+ }
}
printf("</AS>\n");
#include <stdio.h>
#ifdef _MSC_VER
-#define snprintf _snprintf
+#define snprintf _snprintf
#endif
#include "xbt/module.h"
int timeout_value = 5; /* child timeout value */
int sort_len = 19; /* length of the prefix to sort */
char *option;
-int coverage = 0; /* whether the code coverage is enable */
+int coverage = 0; /* whether the code coverage is enable */
rctx_t rctx;
const char *testsuite_name;
exit(1);
}
if (!option){ //if option is NULL
- option = bprintf("--cfg=%s",argv[i+1]);
+ option = bprintf("--cfg=%s",argv[i+1]);
} else {
char *newoption = bprintf("%s --cfg=%s", option, argv[i+1]);
free(option);
i -= 2;
}
else if (!strcmp(argv[i], "--enable-coverage" )){
- coverage = 1;
- XBT_INFO("Enable coverage");
- memmove(argv + i, argv + i + 1, (argc - i - 1) * sizeof(char *));
- argc -= 1;
- i -= 1;
+ coverage = 1;
+ XBT_INFO("Enable coverage");
+ memmove(argv + i, argv + i + 1, (argc - i - 1) * sizeof(char *));
+ argc -= 1;
+ i -= 1;
}
}
} s_Buffer_t, *Buffer_t;
/* Asserts that a s_Buffer is valid. */
-#define ASSERT_VALID_Buffer(p) ( ASSERT_NOT_NULL(p) /*&& ASSERT_NOT_NULL((p)->data)*/ )
+#define ASSERT_VALID_Buffer(p) ( ASSERT_NOT_NULL(p) /*&& ASSERT_NOT_NULL((p)->data)*/ )
/* The default buffer capacity (512 bytes). */
-#define DEFAULT_Buffer_CAPACITY ((size_t)512)
+#define DEFAULT_Buffer_CAPACITY ((size_t)512)
/* struct s_buffet connected functions. */
#endif /* #ifndef false */
/* Asserts that a condition is true.*/
-#define ASSERT(c) assert(c)
+#define ASSERT(c) assert(c)
/* Asserts that a pointer is not NULL.*/
-#define ASSERT_NOT_NULL(p) assert(NULL != (p))
+#define ASSERT_NOT_NULL(p) assert(NULL != (p))
/* Error number type (int) */
#ifndef __ERRNO_TYPE_DEFINED
#include <string.h>
#include <windows.h>
-#define E_SUCCESS ((errno_t)0) /* Success */
-#define E_TEST_RUNNER_ALLOCATION_FAILED ((errno_t)1) /* Test runner allocation failed */
-#define E_TEST_CASE_CONTEXT_ALLOCATION_FAILED ((errno_t)2) /* Test case context allocation failed */
-#define E_BUFFER_ALLOCATION_FAILED ((errno_t)3) /* Buffer allocation failed */
-#define E_BUFFER_DATA_ALLOCATION_FAILED ((errno_t)4) /* Buffer data allocation failed */
-#define E_TEST_SUITE_ALLOCATION_FAILED ((errno_t)5) /* Test suite allocation failed */
-#define E_FILE_NOT_FOUND ((errno_t)6) /* Ffile not found */
-#define E_BAD_USAGE ((errno_t)7) /* Bad usage */
-#define E_INVALID_FILE_Stream ((errno_t)8) /* Invalid file stream */
-#define E_STREAM_ALLOCATION_FAILED ((errno_t)9) /* Stream allocation failed */
-#define E_Buffer_DATA_REALLOCATION_FAILED ((errno_t)10) /* Buffer data reallocation failed */
-#define E_STREAM_LINE_ALLOCATION_FAILED ((errno_t)11) /* Stream line allocation failed */
-#define E_STREAM_LINE_REALLOCATION_FAILED ((errno_t)12) /* Stream line reallocation failed */
-#define E_STREAM_EMPTY ((errno_t)13) /* File empty */
-#define E_STREAM_ERROR ((errno_t)14) /* File error */
-#define E_UNKWN_META_COMMAND ((errno_t)15) /* Unknown meta command detected */
-#define E_INVALID_TIMEOUT_VALUE ((errno_t)16) /* Invalid timeout value */
-#define E_INVALID_EXIT_CODE_VALUE ((errno_t)17) /* Invalid exit code */
-#define E_INVALID_EXPORT ((errno_t)18) /* Invalid export meta command */
-#define E_INVALID_UNSET ((errno_t)19) /* Invalid unset meta command */
-#define E_EXPORT_FAILED ((errno_t)20) /* Export failed */
-#define E_UNSET_FAILED ((errno_t)21) /* Unset failed */
-#define E_SYNC_TEST_CASE_ALLOCATION_FAILED ((errno_t)22) /* Synchrone test case allocation failed */
-#define E_CANNOT_CREATE_CHILD_STDOUT_READ_HANDLE ((errno_t)23) /* Can't create the child std output read handle */
-#define E_CANNOT_CREATE_CHILD_STDERR_READ_HANDLE ((errno_t)24) /* Can't create the child std error read handle */
-#define E_CANNOT_CREATE_CHILD_STDIN_WRITE_HANDLE ((errno_t)25) /* Can't create the child std input write handle */
-#define E_CANNOT_CREATE_STDOUT_READ_HANDLE ((errno_t)26) /* Can't create the std output handle */
-#define E_CANNOT_CREATE_STDIN_WRITE_HANDLE ((errno_t)27) /* Can't create the std input handle */
-#define E_CANNOT_CLOSE_CHILD_STDIN_TEMPORY_HANDLE ((errno_t)28) /* Can't close the tempory child std input handle */
-#define E_CANNOT_CLOSE_CHILD_STDOUT_TEMPORY_HANDLE ((errno_t)29) /* Can't close the tempory child std output handle */
-#define E_CANNOT_CREATE_CHILD_PROCESS ((errno_t)30) /* Can't create the child process */
-#define E_CANNOT_CLOSE_PROCESS_THREAD_HANDLE ((errno_t)31) /* Can't close the child process handle */
-#define E_CANNOT_CLOSE_CHILD_STDOUT_HANDLE ((errno_t)32) /* Can't close the child std output handle */
-#define E_CANNOT_CLOSE_CHILD_STDIN_HANDLE ((errno_t)33) /* Can't close the child std input handle */
-#define E_CANNOT_CLOSE_CHILD_STDERR_HANDLE ((errno_t)34) /* Can't close the child std error handle */
-#define E_CANNOT_WRITE_ON_CHILD_STDIN ((errno_t)35) /* Can't write on child std output */
-#define E_CANNOT_CREATE_READ_CHILD_OUTPUT_THREAD ((errno_t)36) /* Can't create the read child output thread */
-#define E_WAIT_THREAD_FAILED ((errno_t)37) /* Wait thread failed */
-#define E_CANNOT_CLOSE_THREAD_HANDLE ((errno_t)38) /* Can't close thread handle */
-#define E_CANNOT_CLOSE_READ_HANDLE ((errno_t)39) /* Can't close the read handle */
-#define E_CANNOT_CLOSE_WRITE_HANDLE ((errno_t)40) /* Can't close the write handle */
-#define E_WAIT_FAILURE ((errno_t)41) /* Wait failure */
-#define E_CANNOT_CLOSE_PROCESS_HANDLE ((errno_t)42) /* Can't close the process handle */
-#define E_OUTPUT_DONT_MATCH ((errno_t)43) /* Output don't match */
+#define E_SUCCESS ((errno_t)0) /* Success */
+#define E_TEST_RUNNER_ALLOCATION_FAILED ((errno_t)1) /* Test runner allocation failed */
+#define E_TEST_CASE_CONTEXT_ALLOCATION_FAILED ((errno_t)2) /* Test case context allocation failed */
+#define E_BUFFER_ALLOCATION_FAILED ((errno_t)3) /* Buffer allocation failed */
+#define E_BUFFER_DATA_ALLOCATION_FAILED ((errno_t)4) /* Buffer data allocation failed */
+#define E_TEST_SUITE_ALLOCATION_FAILED ((errno_t)5) /* Test suite allocation failed */
+#define E_FILE_NOT_FOUND ((errno_t)6) /* Ffile not found */
+#define E_BAD_USAGE ((errno_t)7) /* Bad usage */
+#define E_INVALID_FILE_Stream ((errno_t)8) /* Invalid file stream */
+#define E_STREAM_ALLOCATION_FAILED ((errno_t)9) /* Stream allocation failed */
+#define E_Buffer_DATA_REALLOCATION_FAILED ((errno_t)10) /* Buffer data reallocation failed */
+#define E_STREAM_LINE_ALLOCATION_FAILED ((errno_t)11) /* Stream line allocation failed */
+#define E_STREAM_LINE_REALLOCATION_FAILED ((errno_t)12) /* Stream line reallocation failed */
+#define E_STREAM_EMPTY ((errno_t)13) /* File empty */
+#define E_STREAM_ERROR ((errno_t)14) /* File error */
+#define E_UNKWN_META_COMMAND ((errno_t)15) /* Unknown meta command detected */
+#define E_INVALID_TIMEOUT_VALUE ((errno_t)16) /* Invalid timeout value */
+#define E_INVALID_EXIT_CODE_VALUE ((errno_t)17) /* Invalid exit code */
+#define E_INVALID_EXPORT ((errno_t)18) /* Invalid export meta command */
+#define E_INVALID_UNSET ((errno_t)19) /* Invalid unset meta command */
+#define E_EXPORT_FAILED ((errno_t)20) /* Export failed */
+#define E_UNSET_FAILED ((errno_t)21) /* Unset failed */
+#define E_SYNC_TEST_CASE_ALLOCATION_FAILED ((errno_t)22) /* Synchrone test case allocation failed */
+#define E_CANNOT_CREATE_CHILD_STDOUT_READ_HANDLE ((errno_t)23) /* Can't create the child std output read handle */
+#define E_CANNOT_CREATE_CHILD_STDERR_READ_HANDLE ((errno_t)24) /* Can't create the child std error read handle */
+#define E_CANNOT_CREATE_CHILD_STDIN_WRITE_HANDLE ((errno_t)25) /* Can't create the child std input write handle */
+#define E_CANNOT_CREATE_STDOUT_READ_HANDLE ((errno_t)26) /* Can't create the std output handle */
+#define E_CANNOT_CREATE_STDIN_WRITE_HANDLE ((errno_t)27) /* Can't create the std input handle */
+#define E_CANNOT_CLOSE_CHILD_STDIN_TEMPORY_HANDLE ((errno_t)28) /* Can't close the tempory child std input handle */
+#define E_CANNOT_CLOSE_CHILD_STDOUT_TEMPORY_HANDLE ((errno_t)29) /* Can't close the tempory child std output handle */
+#define E_CANNOT_CREATE_CHILD_PROCESS ((errno_t)30) /* Can't create the child process */
+#define E_CANNOT_CLOSE_PROCESS_THREAD_HANDLE ((errno_t)31) /* Can't close the child process handle */
+#define E_CANNOT_CLOSE_CHILD_STDOUT_HANDLE ((errno_t)32) /* Can't close the child std output handle */
+#define E_CANNOT_CLOSE_CHILD_STDIN_HANDLE ((errno_t)33) /* Can't close the child std input handle */
+#define E_CANNOT_CLOSE_CHILD_STDERR_HANDLE ((errno_t)34) /* Can't close the child std error handle */
+#define E_CANNOT_WRITE_ON_CHILD_STDIN ((errno_t)35) /* Can't write on child std output */
+#define E_CANNOT_CREATE_READ_CHILD_OUTPUT_THREAD ((errno_t)36) /* Can't create the read child output thread */
+#define E_WAIT_THREAD_FAILED ((errno_t)37) /* Wait thread failed */
+#define E_CANNOT_CLOSE_THREAD_HANDLE ((errno_t)38) /* Can't close thread handle */
+#define E_CANNOT_CLOSE_READ_HANDLE ((errno_t)39) /* Can't close the read handle */
+#define E_CANNOT_CLOSE_WRITE_HANDLE ((errno_t)40) /* Can't close the write handle */
+#define E_WAIT_FAILURE ((errno_t)41) /* Wait failure */
+#define E_CANNOT_CLOSE_PROCESS_HANDLE ((errno_t)42) /* Can't close the process handle */
+#define E_OUTPUT_DONT_MATCH ((errno_t)43) /* Output don't match */
#define E_OPEN_FILE_FAILED ((errno_t)44) /* Open file failed */
#define E_INVALID_TOKEN ((errno_t)45) /* Invalid token */
#define E_WAIT_TIMEOUT ((errno_t)46) /* Wait timeout detected */
} s_TestCaseContext_t, *TestCaseContext_t;
/* Output checking is disabled by default*/
-#define DEFAULT_OUTPUT_CHECKING_MODE false
+#define DEFAULT_OUTPUT_CHECKING_MODE false
/* Post output checking mode is disabled by default*/
-#define DEFAULT_POST_OUTPUT_CHECKING_MODE false
+#define DEFAULT_POST_OUTPUT_CHECKING_MODE false
/* The default timeout value is 5 seconds*/
-#define DEFAULT_TIMEOUT_VALUE ((int)120000)
+#define DEFAULT_TIMEOUT_VALUE ((int)120000)
/* Invalid exit code value (default value)*/
-#define INVALID_EXIT_CODE ((int)0xFFFFFF)
+#define INVALID_EXIT_CODE ((int)0xFFFFFF)
/*
* s_TestCaseContext struct connected functions.