for (i = 0; i < workers_count; i++)
if(host_self == workers[i]) {
- workers[i] = workers[workers_count-1];
- workers_count--;
- break;
+ workers[i] = workers[workers_count-1];
+ workers_count--;
+ break;
}
for (i = 0; i < workers_count; i++)
- MSG_process_create("worker", worker, master_name, workers[i]);
+ MSG_process_create("worker", worker, master_name, workers[i]);
}
XBT_INFO("Got %d workers and %d tasks to process", workers_count,
for (i = 0; i < number_of_tasks; i++) {
build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count]));
+ MSG_host_get_name(workers[i % workers_count]));
XBT_INFO("Sending \"%s\" to channel \"%s\"", todo[i]->name, channel);
for (i = 0; i < workers_count; i++) {
msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
MSG_task_send(finalize, build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count])));
+ MSG_host_get_name(workers[i % workers_count])));
}
XBT_INFO("Goodbye now!");
char channel[1024];
build_channel_name(channel,MSG_process_get_data(MSG_process_self()),
- MSG_host_get_name(MSG_host_self()));
+ MSG_host_get_name(MSG_host_self()));
XBT_INFO("Receiving on channel \"%s\"", channel);
for (i = 0; i < workers_count; i++)
if(host_self == workers[i]) {
- workers[i] = workers[workers_count-1];
- workers_count--;
- break;
+ workers[i] = workers[workers_count-1];
+ workers_count--;
+ break;
}
for (i = 0; i < workers_count; i++)
- MSG_process_create("worker", worker, master_name, workers[i]);
+ MSG_process_create("worker", worker, master_name, workers[i]);
}
XBT_INFO("Got %d workers and will send tasks for %g seconds!",
- workers_count, timeout);
+ workers_count, timeout);
for (i = 0; 1; i++) {
char sprintf_buffer[64];
sprintf(sprintf_buffer, "Task_%d", i);
task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
- NULL);
+ NULL);
build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count]));
+ MSG_host_get_name(workers[i % workers_count]));
XBT_DEBUG("Sending \"%s\" to channel \"%s\"", task->name, channel);
MSG_task_send(task, channel);
for (i = 0; i < workers_count; i++) {
msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
MSG_task_send(finalize, build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count])));
+ MSG_host_get_name(workers[i % workers_count])));
}
XBT_INFO("Sent %d tasks in total!", task_num);
char channel[1024];
build_channel_name(channel,MSG_process_get_data(MSG_process_self()),
- MSG_host_get_name(MSG_host_self()));
+ MSG_host_get_name(MSG_host_self()));
XBT_DEBUG("Receiving on channel \"%s\"", channel);
for (i = 0; i < workers_count; i++)
if(host_self == workers[i]) {
- workers[i] = workers[workers_count-1];
- workers_count--;
- break;
+ workers[i] = workers[workers_count-1];
+ workers_count--;
+ break;
}
for (i = 0; i < workers_count; i++)
- MSG_process_create("worker", worker, master_name, workers[i]);
+ MSG_process_create("worker", worker, master_name, workers[i]);
}
XBT_INFO("Got %d workers and will send tasks for %g seconds!",
- workers_count, timeout);
+ workers_count, timeout);
for (i = 0; 1; i++) {
char sprintf_buffer[64];
sprintf(sprintf_buffer, "Task_%d", i);
task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
- NULL);
+ NULL);
MSG_task_set_category(task, master_name);
build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count]));
+ MSG_host_get_name(workers[i % workers_count]));
XBT_DEBUG("Sending \"%s\" to channel \"%s\"", task->name, channel);
MSG_task_send(task, channel);
for (i = 0; i < workers_count; i++) {
msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
MSG_task_send(finalize, build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count])));
+ MSG_host_get_name(workers[i % workers_count])));
}
XBT_INFO("Sent %d tasks in total!", task_num);
char channel[1024];
build_channel_name(channel,MSG_process_get_data(MSG_process_self()),
- MSG_host_get_name(MSG_host_self()));
+ MSG_host_get_name(MSG_host_self()));
XBT_DEBUG("Receiving on channel \"%s\"", channel);
for (i = 0; i < workers_count; i++)
if(host_self == workers[i]) {
- workers[i] = workers[workers_count-1];
- workers_count--;
- break;
+ workers[i] = workers[workers_count-1];
+ workers_count--;
+ break;
}
for (i = 0; i < workers_count; i++)
- MSG_process_create("worker", worker, master_name, workers[i]);
+ MSG_process_create("worker", worker, master_name, workers[i]);
}
XBT_INFO("Got %d workers and will send tasks for %g seconds!",
- workers_count, timeout);
+ workers_count, timeout);
xbt_dynar_t idle_hosts = xbt_dynar_new(sizeof(msg_host_t), NULL);
msg_host_t request_host = NULL;
if(MSG_get_clock()>timeout) {
if(xbt_dynar_length(idle_hosts) == workers_count) break;
else {
- MSG_process_sleep(.1);
- continue;
+ MSG_process_sleep(.1);
+ continue;
}
}
sprintf(sprintf_buffer, "Task_%d", i);
task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
- NULL);
+ NULL);
MSG_task_set_category(task, master_name);
xbt_dynar_shift(idle_hosts, &request_host);
for (i = 0; i < workers_count; i++) {
msg_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
MSG_task_send(finalize, build_channel_name(channel,master_name,
- MSG_host_get_name(workers[i % workers_count])));
+ MSG_host_get_name(workers[i % workers_count])));
}
XBT_INFO("Sent %d tasks in total!", task_num);
MSG_action_init();
xbt_assert(argc > 2,
- "Usage: %s platform_file deployment_file [action_files]\n"
- "\t# if all actions are in the same file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml actions\n"
- "\t# if actions are in separate files, specified in deployment\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml ",
- argv[0],argv[0],argv[0]);
+ "Usage: %s platform_file deployment_file [action_files]\n"
+ "\t# if all actions are in the same file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml actions\n"
+ "\t# if actions are in separate files, specified in deployment\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml ",
+ argv[0],argv[0],argv[0]);
printf("WARNING: THIS BINARY IS KINDA DEPRECATED\n"
- "This example is still relevant if you want to learn about MSG-based trace replay, "
- "but if you want to simulate MPI-like traces, you should use the newer version "
- "that is in the examples/smpi/replay directory instead.\n");
+ "This example is still relevant if you want to learn about MSG-based trace replay, "
+ "but if you want to simulate MPI-like traces, you should use the newer version "
+ "that is in the examples/smpi/replay directory instead.\n");
/* Simulation setting */
MSG_create_environment(argv[1]);
double clock = MSG_get_clock(); /* this "call" is free thanks to inlining */
sprintf(full_name, "%s:%s", MSG_process_get_name(MSG_process_self()),
- file_name);
+ file_name);
ACT_DEBUG("Entering Open: %s (filename: %s)", NAME, file_name);
file = MSG_file_open(file_name, NULL);
XBT_DEBUG("Received a task (%p)", task_received);
task_data_t ans_data = MSG_task_get_data(task_received);
- // Once upon a time, our code assumed that here, task_received != task_sent all the time
- //
- // This assumption is wrong (as messages from differing round can interleave), leading to a bug in our code.
- // We failed to find this bug directly, as it only occured on large platforms, leading to hardly usable traces.
- // Instead, we used the model-checker to track down the issue by adding the following test here in the code:
- // if (MC_is_active()) {
- // MC_assert(task_received == task_sent);
+ // Once upon a time, our code assumed that here, task_received != task_sent all the time
+ //
+ // This assumption is wrong (as messages from differing round can interleave), leading to a bug in our code.
+ // We failed to find this bug directly, as it only occured on large platforms, leading to hardly usable traces.
+ // Instead, we used the model-checker to track down the issue by adding the following test here in the code:
+ // if (MC_is_active()) {
+ // MC_assert(task_received == task_sent);
// }
- // That explained the bug in a snap, with a very cool example and everything.
- //
- // This MC_assert is now desactivated as the case is now properly handled in our code and we don't want the
- // MC to fail any further under that condition, but this comment is here to as a memorial for this first
- // brillant victory of the model-checking in the SimGrid community :)
+ // That explained the bug in a snap, with a very cool example and everything.
+ //
+ // This MC_assert is now desactivated as the case is now properly handled in our code and we don't want the
+ // MC to fail any further under that condition, but this comment is here to as a memorial for this first
+ // brillant victory of the model-checking in the SimGrid community :)
if (task_received != task_sent ||
ans_data->type != TASK_FIND_SUCCESSOR_ANSWER) {
{
MSG_init(&argc, argv);
xbt_assert(argc > 2,
- "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
- "\tExample: %s ../msg_platform.xml chord.xml\n",
- argv[0], argv[0]);
+ "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
+ "\tExample: %s ../msg_platform.xml chord.xml\n",
+ argv[0], argv[0]);
char **options = &argv[1];
while (!strncmp(options[0], "-", 1)) {
double mig_end = MSG_get_clock();
XBT_INFO("%s migrated: %s->%s in %g s", MSG_vm_get_name(vm),
- MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
- mig_end - mig_sta);
+ MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
+ mig_end - mig_sta);
}
static int migration_worker_main(int argc, char *argv[])
struct task_data {
- msg_task_t task;
- double prev_computation_amount;
- double prev_clock;
+ msg_task_t task;
+ double prev_computation_amount;
+ double prev_clock;
};
**/
static double time_precise(void) {
- struct timeval tv;
- int ret = gettimeofday(&tv, NULL);
+ struct timeval tv;
+ int ret = gettimeofday(&tv, NULL);
if (ret < 0)
xbt_die("gettimeofday");
- double now = (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001;
+ double now = (double) tv.tv_sec + tv.tv_usec * 0.001 * 0.001;
- return now;
+ return now;
}
static int computation_fun(int argc, char *argv[]) {
int i = 0;
for (i = 0; i < npm; i++) {
- pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t);
+ pm[i] = xbt_dynar_get_as(hosts_dynar, i, msg_host_t);
}
for (i = 0; i < nvm; i++) {
- int pm_index = i % npm;
- char *vm_name = bprintf("vm%d", i);
- vm[i] = MSG_vm_create_core(pm[pm_index], vm_name);
- MSG_vm_start(vm[i]);
+ int pm_index = i % npm;
+ char *vm_name = bprintf("vm%d", i);
+ vm[i] = MSG_vm_create_core(pm[pm_index], vm_name);
+ MSG_vm_start(vm[i]);
launch_computation_worker(vm[i]);
- xbt_free(vm_name);
+ xbt_free(vm_name);
}
XBT_INFO("## Test (start)");
for (i = 0; i < 10; i++) {
- double clock_sta = time_precise();
- MSG_process_sleep(1);
- double clock_end = time_precise();
- XBT_INFO("duration %f", clock_end - clock_sta);
+ double clock_sta = time_precise();
+ MSG_process_sleep(1);
+ double clock_end = time_precise();
+ XBT_INFO("duration %f", clock_end - clock_sta);
}
for (i = 0; i < nvm; i++) {
- MSG_vm_destroy(vm[i]);
+ MSG_vm_destroy(vm[i]);
}
XBT_INFO("## Test (ended)");
launch_computation_worker(vm0);
while(MSG_get_clock()<100) {
- if (atask != NULL)
- XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask));
- MSG_process_sleep(1);
+ if (atask != NULL)
+ XBT_INFO("aTask remaining duration: %g", MSG_task_get_flops_amount(atask));
+ MSG_process_sleep(1);
}
MSG_process_sleep(10000);
XBT_INFO("Energetic profile: %s",
- MSG_host_get_property_value(host,"watt_per_state"));
+ MSG_host_get_property_value(host,"watt_per_state"));
XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
- MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
double start = MSG_get_clock();
XBT_INFO("Sleep for 10 seconds");
MSG_process_sleep(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J",
- MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock()-start,
+ MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
// Run a task
start = MSG_get_clock();
MSG_task_execute (task1);
MSG_task_destroy(task1);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW depending on load; Energy dissipated=%.0f J",
- MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)),
- sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)),
- sg_host_get_consumed_energy(host));
+ MSG_get_clock()-start,
+ MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)),
+ sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)),
+ sg_host_get_consumed_energy(host));
// ========= Change power peak =========
int pstate=2;
MSG_host_set_pstate(host, pstate);
XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)",
- pstate,
- MSG_host_get_power_peak_at(host, pstate),
- MSG_host_get_current_power_peak(host));
+ pstate,
+ MSG_host_get_power_peak_at(host, pstate),
+ MSG_host_get_current_power_peak(host));
// Run a second task
start = MSG_get_clock();
MSG_task_execute (task1);
MSG_task_destroy(task1);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock()-start,
+ MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
start = MSG_get_clock();
XBT_INFO("Sleep for 4 seconds");
MSG_process_sleep(4);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock()-start,
+ MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
// =========== Turn the other host off ==========
XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
- sg_host_get_consumed_energy(MSG_host_by_name("MyHost2")) );
+ sg_host_get_consumed_energy(MSG_host_by_name("MyHost2")) );
MSG_host_off(MSG_host_by_name("MyHost2"));
start = MSG_get_clock();
MSG_process_sleep(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock()-start,
+ MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
return 0;
}
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
MSG_create_environment(argv[1]);
#include "xbt/asserts.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
- "Messages specific for this msg example");
+ "Messages specific for this msg example");
static void simulate_bootup(msg_host_t host) {
msg_host_t host1 = MSG_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s",
- MSG_host_get_property_value(host1,"watt_per_state"));
+ MSG_host_get_property_value(host1,"watt_per_state"));
XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
XBT_INFO("Sleep for 10 seconds");
MSG_process_sleep(10);
XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
simulate_shutdown(host1);
XBT_INFO("Host1 is now OFF. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
XBT_INFO("Sleep for 10 seconds");
MSG_process_sleep(10);
XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
simulate_bootup(host1);
XBT_INFO("Host1 is now ON again. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
return 0;
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
MSG_create_environment(argv[1]);
/** @addtogroup MSG_examples
*
* - <b>energy/e1/e1.c</b> Shows how a set of pstates can be defined
- * for a host and how the current pstate can be accessed/changed
- * with @ref MSG_get_host_current_power_peak and @ref
- * MSG_set_host_pstate.
- * Make sure to read the platform XML file for details on how
- * to declare the CPU capacity for each pstate.
+ * for a host and how the current pstate can be accessed/changed
+ * with @ref MSG_get_host_current_power_peak and @ref
+ * MSG_set_host_pstate.
+ * Make sure to read the platform XML file for details on how
+ * to declare the CPU capacity for each pstate.
*
*/
// Change power peak
if ((new_peak_index >= nb) || (new_peak_index < 0))
- {
- XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb);
- return 0;
- }
+ {
+ XBT_INFO("Cannot set pstate %d, host supports only %d pstates", new_peak_index, nb);
+ return 0;
+ }
double peak_at = MSG_host_get_power_peak_at(host, new_peak_index);
XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_peak_index);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
MSG_create_environment(argv[1]);
MSG_init(&argc, argv);
xbt_assert(argc > 1, "Usage: %s platform_file\n"
- "\tExample: %s msg_platform.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml\n",
+ argv[0], argv[0]);
MSG_create_environment(argv[1]);
msg_error_t res = MSG_OK;
XBT_INFO("Let's work.");
- TRY {
+ TRY {
res = MSG_task_execute(MSG_task_create("Task", 1e14, 0, NULL));
if (res != MSG_OK) {
XBT_INFO("The MSG_task_execute caught the exception for me and returned %d)",res);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
MSG_function_register("terrorist", terrorist);
MSG_create_environment(argv[1]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s platform.xml deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s platform.xml deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
/* Check the arguments */
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
const char *platform_file = argv[1];
const char *deployment_file = argv[2];
MSG_init(&argc, argv);
xbt_assert(argc > 3, "Usage: %s platform_file number_of_jobs number_of_slaves\n"
- "\tExample: %s msg_platform.xml 10 5\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml 10 5\n",
+ argv[0], argv[0]);
MSG_function_register("master", master);
MSG_function_register("slave", slave);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n",
+ argv[0], argv[0]);
test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
platform_file = argv[1];
application_file = argv[2];
/* Argument checking */
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n",
+ argv[0], argv[0]);
/* Simulation setting */
MSG_create_environment(argv[1]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s platform.xml deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s platform.xml deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 1, "Usage: %s platform_file\n"
- "\tExample: %s msg_platform.xml", argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml", argv[0], argv[0]);
res = test_all(argv[1]);
return res != MSG_OK;
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
int i, dist;
for (i=0; i<NAMESPACE_SIZE; i++) {
if (node->namespace_set[i]!=-1) {
- dist = abs(node->namespace_set[i] - dest);
- if (dist<best_dist) {
- best_dist = dist;
- res = node->namespace_set[i];
- }
+ dist = abs(node->namespace_set[i] - dest);
+ if (dist<best_dist) {
+ best_dist = dist;
+ res = node->namespace_set[i];
+ }
}
}
}
if (next!=node->id) {
get_mailbox(next, mailbox);
task_data->sender_id = node->id;
- task_data->steps++;
+ task_data->steps++;
task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, task_data);
MSG_task_send_with_timeout(task_sent, mailbox, timeout);
type = TASK_JOIN_REPLY;
// if first node touched reply, copy its neighborood set
if (task_data->sender_id == node->known_id) {
- node->neighborhood_set[0] = task_data->sender_id;
+ node->neighborhood_set[0] = task_data->sender_id;
for (i=1; i<NEIGHBORHOOD_SIZE; i++)
node->neighborhood_set[i] = task_data->state->neighborhood_set[i-1];
}
for (i=min;i<max;i++) {
d = domain(node->id, i);
for (j=0; j<LEVEL_SIZE; j++)
- if (d!=j)
+ if (d!=j)
node->routing_table[i][j] = task_data->state->routing_table[i][j];
}
XBT_DEBUG("Node %i is ready!!!", node->id);
while(xbt_fifo_size(node->pending_tasks))
- handle_task(node, xbt_fifo_pop(node->pending_tasks));
+ handle_task(node, xbt_fifo_pop(node->pending_tasks));
- for (i=0; i<NAMESPACE_SIZE; i++) {
+ for (i=0; i<NAMESPACE_SIZE; i++) {
j = node->namespace_set[i];
if (j!=-1) {
XBT_DEBUG("Send update to %i", j);
get_mailbox(j, mailbox);
-
- req_data = xbt_new0(s_task_data_t,1);
+
+ req_data = xbt_new0(s_task_data_t,1);
req_data->answer_id = node->id;
req_data->steps = 0;
req_data->type = TASK_UPDATE;
i=0;
for (; i<NAMESPACE_SIZE/2; i++){
curr_namespace_set[i] = node->namespace_set[i];
- task_namespace_set[i] = task_data->state->namespace_set[i];
+ task_namespace_set[i] = task_data->state->namespace_set[i];
}
task_namespace_set[i] = task_data->state->id;
for (; i<NAMESPACE_SIZE; i++){
- curr_namespace_set[i] = node->namespace_set[i];
- task_namespace_set[i+1] = task_data->state->namespace_set[i];
+ curr_namespace_set[i] = node->namespace_set[i];
+ task_namespace_set[i+1] = task_data->state->namespace_set[i];
}
// get the index of values before and after node->id in task_namespace
min = -1;
max = -1;
for (i=0; i<=NAMESPACE_SIZE; i++) {
- j = task_namespace_set[i];
+ j = task_namespace_set[i];
if (i<NAMESPACE_SIZE)
- printf("%08x %08x | ", j, curr_namespace_set[i]);
- if (j != -1 && j < node->id) min = i;
- if (j != -1 && max == -1 && j > node->id) max = i;
+ printf("%08x %08x | ", j, curr_namespace_set[i]);
+ if (j != -1 && j < node->id) min = i;
+ if (j != -1 && max == -1 && j > node->id) max = i;
}
printf("\n");
// add lower elements
j = NAMESPACE_SIZE/2-1;
for (i=NAMESPACE_SIZE/2-1; i>=0; i--) {
- printf("i:%i, j:%i, min:%i, currj:%08x, taskmin:%08x\n", i, j, min, curr_namespace_set[j], task_namespace_set[min]);
+ printf("i:%i, j:%i, min:%i, currj:%08x, taskmin:%08x\n", i, j, min, curr_namespace_set[j], task_namespace_set[min]);
if (min<0) {
- node->namespace_set[i] = curr_namespace_set[j];
- j--;
- } else if (curr_namespace_set[j] == task_namespace_set[min]) {
- node->namespace_set[i] = curr_namespace_set[j];
- j--; min--;
- } else if (curr_namespace_set[j] > task_namespace_set[min]) {
+ node->namespace_set[i] = curr_namespace_set[j];
+ j--;
+ } else if (curr_namespace_set[j] == task_namespace_set[min]) {
+ node->namespace_set[i] = curr_namespace_set[j];
+ j--; min--;
+ } else if (curr_namespace_set[j] > task_namespace_set[min]) {
node->namespace_set[i] = curr_namespace_set[j];
- j--;
- } else {
+ j--;
+ } else {
node->namespace_set[i] = task_namespace_set[min];
- min--;
- }
+ min--;
+ }
}
// add greater elements
j = NAMESPACE_SIZE/2;
for (i=NAMESPACE_SIZE/2; i<NAMESPACE_SIZE; i++) {
- printf("i:%i, j:%i, max:%i, currj:%08x, taskmax:%08x\n", i, j, max, curr_namespace_set[j], task_namespace_set[max]);
+ printf("i:%i, j:%i, max:%i, currj:%08x, taskmax:%08x\n", i, j, max, curr_namespace_set[j], task_namespace_set[max]);
if (min<0 || max>=NAMESPACE_SIZE) {
- node->namespace_set[i] = curr_namespace_set[j];
- j++;
- } else if (curr_namespace_set[j] == -1) {
- node->namespace_set[i] = task_namespace_set[max];
- max++;
- } else if (curr_namespace_set[j] == task_namespace_set[max]) {
- node->namespace_set[i] = curr_namespace_set[j];
- j++; max++;
- } else if (curr_namespace_set[j] < task_namespace_set[max]) {
+ node->namespace_set[i] = curr_namespace_set[j];
+ j++;
+ } else if (curr_namespace_set[j] == -1) {
+ node->namespace_set[i] = task_namespace_set[max];
+ max++;
+ } else if (curr_namespace_set[j] == task_namespace_set[max]) {
+ node->namespace_set[i] = curr_namespace_set[j];
+ j++; max++;
+ } else if (curr_namespace_set[j] < task_namespace_set[max]) {
node->namespace_set[i] = curr_namespace_set[j];
- j++;
- } else {
+ j++;
+ } else {
node->namespace_set[i] = task_namespace_set[max];
- max++;
- }
+ max++;
+ }
}
print_node_namespace_set(node);
node->routing_table[i][j] = task_data->state->routing_table[i][j];
}
}
- }
+ }
}
/**
* Print the node id
*/
static void print_node_id(node_t node) {
- int i;
+ int i;
printf(" id: %i '%08x' ", node->id, node->id);
for (i=0;i<LEVELS_COUNT;i++)
printf(" %x", domain(node->id, i));
* Print the node neighborood set
*/
static void print_node_neighborood_set(node_t node) {
- int i;
+ int i;
printf(" neighborood:\n");
for (i=0; i<NEIGHBORHOOD_SIZE; i++)
printf(" %08x\n", node->neighborhood_set[i]);
* Print the routing table
*/
static void print_node_routing_table(node_t node) {
- int i,j;
+ int i,j;
printf(" routing table:\n");
for (i=0; i<LEVELS_COUNT; i++){
printf(" ");
* Get the corresponding state of a node
*/
static state_t node_get_state(node_t node) {
- int i,j;
+ int i,j;
state_t state = xbt_new0(s_state_t,1);
state->id = node->id;
for (i=0; i<NEIGHBORHOOD_SIZE; i++)
{
MSG_init(&argc, argv);
xbt_assert(argc > 2,
- "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
- "\tExample: %s ../msg_platform.xml pastry10.xml\n",
- argv[0], argv[0]);
+ "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
+ "\tExample: %s ../msg_platform.xml pastry10.xml\n",
+ argv[0], argv[0]);
char **options = &argv[1];
while (!strncmp(options[0], "-", 1)) {
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_process_create_with_arguments(xbt_strdup("Alice"), peer, NULL,
- h, 8, aliceTimes);
+ h, 8, aliceTimes);
MSG_process_create_with_arguments(xbt_strdup("Bob"), peer, NULL,
- h, 8, bobTimes);
+ h, 8, bobTimes);
msg_error_t res = MSG_main();
printf("Finished\n");
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
res = test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
test_all(argv[1], argv[2]);
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment_suspend.xml\n",
+ argv[0], argv[0]);
test_all(argv[1], argv[2]);
class Worker : simgrid::s4u::Actor {
public:
- Worker(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
- : simgrid::s4u::Actor(procname,host,argc,argv){}
+ Worker(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
+ : simgrid::s4u::Actor(procname,host,argc,argv){}
- int main(int argc, char **argv) {
- XBT_INFO("Hello s4u, I'm ready to serve");
+ int main(int argc, char **argv) {
+ XBT_INFO("Hello s4u, I'm ready to serve");
- char *msg = (char*)recv(*simgrid::s4u::Mailbox::byName("worker"));
- XBT_INFO("I received '%s'",msg);
- XBT_INFO("I'm done. See you.");
- return 1;
- }
+ char *msg = (char*)recv(*simgrid::s4u::Mailbox::byName("worker"));
+ XBT_INFO("I received '%s'",msg);
+ XBT_INFO("I'm done. See you.");
+ return 1;
+ }
};
class Master : simgrid::s4u::Actor {
public:
- Master(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
- : Actor(procname,host,argc,argv){}
+ Master(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
+ : Actor(procname,host,argc,argv){}
- int main(int argc, char **argv) {
- const char *msg = "GaBuZoMeu";
- XBT_INFO("Hello s4u, I have something to send");
- send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg));
+ int main(int argc, char **argv) {
+ const char *msg = "GaBuZoMeu";
+ XBT_INFO("Hello s4u, I have something to send");
+ send(*simgrid::s4u::Mailbox::byName("worker"), xbt_strdup(msg), strlen(msg));
- XBT_INFO("I'm done. See you.");
- return 1;
- }
+ XBT_INFO("I'm done. See you.");
+ return 1;
+ }
};
int main(int argc, char **argv) {
- simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
- e->loadPlatform("../../platforms/two_hosts_platform.xml");
+ simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
+ e->loadPlatform("../../platforms/two_hosts_platform.xml");
- new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL);
- new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL);
- e->run();
- return 0;
+ new Worker("worker", simgrid::s4u::Host::by_name("host0"), 0, NULL);
+ new Master("master", simgrid::s4u::Host::by_name("host1"), 0, NULL);
+ e->run();
+ return 0;
}
class myHost : simgrid::s4u::Actor {
public:
- myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
+ myHost(const char*procname, simgrid::s4u::Host *host,int argc, char **argv)
: simgrid::s4u::Actor(procname,host,argc,argv){}
- void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage*> const&mounts) {
- XBT_INFO("Storage info on %s:",
- simgrid::s4u::Host::current()->name().c_str());
-
- for (const auto&kv : mounts) {
- const char* mountpoint = kv.first.c_str();
- simgrid::s4u::Storage &storage = *kv.second;
-
- // Retrieve disk's information
- sg_size_t free_size = storage.size_free();
- sg_size_t used_size = storage.size_used();
- sg_size_t size = storage.size();
-
- XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.",
- storage.name(), mountpoint, used_size, free_size, size);
- }
- }
-
- int main(int argc, char **argv) {
- boost::unordered_map <std::string, simgrid::s4u::Storage *> const& mounts =
- simgrid::s4u::Host::current()->mounted_storages();
-
- show_info(mounts);
-
- // Open an non-existing file to create it
- const char *filename = "/home/tmp/data.txt";
- simgrid::s4u::File *file = new simgrid::s4u::File(filename, NULL);
- sg_size_t write, read, file_size;
-
- write = file->write(200000); // Write 200,000 bytes
- XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename);
-
- // check that sizes have changed
- show_info(mounts);
-
- // Now retrieve the size of created file and read it completely
- file_size = file->size();
- file->seek(0);
- read = file->read(file_size);
- XBT_INFO("Read %llu bytes on %s", read, filename);
-
- // Now write 100,000 bytes in tmp/data.txt
- write = file->write(100000); // Write 100,000 bytes
- XBT_INFO("Write %llu bytes on %s", write, filename);
-
- simgrid::s4u::Storage &storage = simgrid::s4u::Storage::byName("Disk4");
-
- // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
- const char *newpath = "/home/tmp/simgrid.readme";
- XBT_INFO("Move '%s' to '%s'", file->path(), newpath);
- file->move(newpath);
-
- // Test attaching some user data to the file
- file->set_userdata(xbt_strdup("777"));
- XBT_INFO("User data attached to the file: %s", (char*)file->userdata());
-
- // Close the file
- delete file;
-
- // Now attach some user data to disk1
- XBT_INFO("Get/set data for storage element: %s",storage.name());
- XBT_INFO(" Uninitialized storage data: '%s'", (char*)storage.userdata());
-
- storage.set_userdata(xbt_strdup("Some user data"));
- XBT_INFO(" Set and get data: '%s'", (char*)storage.userdata());
-
- /*
- // Dump disks contents
- XBT_INFO("*** Dump content of %s ***",Host::current()->name());
- xbt_dict_t contents = NULL;
- contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts
- xbt_dict_cursor_t curs, curs2 = NULL;
- char* mountname;
- xbt_dict_t content;
- char* path;
- sg_size_t *size;
- xbt_dict_foreach(contents, curs, mountname, content){
- XBT_INFO("Print the content of mount point: %s",mountname);
- xbt_dict_foreach(content,curs2,path,size){
- XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size));
- }
- xbt_dict_free(&content);
- }
- xbt_dict_free(&contents);
- */
- return 0;
- }
+ void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage*> const&mounts) {
+ XBT_INFO("Storage info on %s:",
+ simgrid::s4u::Host::current()->name().c_str());
+
+ for (const auto&kv : mounts) {
+ const char* mountpoint = kv.first.c_str();
+ simgrid::s4u::Storage &storage = *kv.second;
+
+ // Retrieve disk's information
+ sg_size_t free_size = storage.size_free();
+ sg_size_t used_size = storage.size_used();
+ sg_size_t size = storage.size();
+
+ XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.",
+ storage.name(), mountpoint, used_size, free_size, size);
+ }
+ }
+
+ int main(int argc, char **argv) {
+ boost::unordered_map <std::string, simgrid::s4u::Storage *> const& mounts =
+ simgrid::s4u::Host::current()->mounted_storages();
+
+ show_info(mounts);
+
+ // Open an non-existing file to create it
+ const char *filename = "/home/tmp/data.txt";
+ simgrid::s4u::File *file = new simgrid::s4u::File(filename, NULL);
+ sg_size_t write, read, file_size;
+
+ write = file->write(200000); // Write 200,000 bytes
+ XBT_INFO("Create a %llu bytes file named '%s' on /sd1", write, filename);
+
+ // check that sizes have changed
+ show_info(mounts);
+
+ // Now retrieve the size of created file and read it completely
+ file_size = file->size();
+ file->seek(0);
+ read = file->read(file_size);
+ XBT_INFO("Read %llu bytes on %s", read, filename);
+
+ // Now write 100,000 bytes in tmp/data.txt
+ write = file->write(100000); // Write 100,000 bytes
+ XBT_INFO("Write %llu bytes on %s", write, filename);
+
+ simgrid::s4u::Storage &storage = simgrid::s4u::Storage::byName("Disk4");
+
+ // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
+ const char *newpath = "/home/tmp/simgrid.readme";
+ XBT_INFO("Move '%s' to '%s'", file->path(), newpath);
+ file->move(newpath);
+
+ // Test attaching some user data to the file
+ file->set_userdata(xbt_strdup("777"));
+ XBT_INFO("User data attached to the file: %s", (char*)file->userdata());
+
+ // Close the file
+ delete file;
+
+ // Now attach some user data to disk1
+ XBT_INFO("Get/set data for storage element: %s",storage.name());
+ XBT_INFO(" Uninitialized storage data: '%s'", (char*)storage.userdata());
+
+ storage.set_userdata(xbt_strdup("Some user data"));
+ XBT_INFO(" Set and get data: '%s'", (char*)storage.userdata());
+
+ /*
+ // Dump disks contents
+ XBT_INFO("*** Dump content of %s ***",Host::current()->name());
+ xbt_dict_t contents = NULL;
+ contents = MSG_host_get_storage_content(MSG_host_self()); // contents is a dict of dicts
+ xbt_dict_cursor_t curs, curs2 = NULL;
+ char* mountname;
+ xbt_dict_t content;
+ char* path;
+ sg_size_t *size;
+ xbt_dict_foreach(contents, curs, mountname, content){
+ XBT_INFO("Print the content of mount point: %s",mountname);
+ xbt_dict_foreach(content,curs2,path,size){
+ XBT_INFO("%s size: %llu bytes", path,*((sg_size_t*)size));
+ }
+ xbt_dict_free(&content);
+ }
+ xbt_dict_free(&contents);
+ */
+ return 0;
+ }
};
int main(int argc, char **argv) {
- simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
- e->loadPlatform("../../platforms/storage/storage.xml");
+ simgrid::s4u::Engine *e = new simgrid::s4u::Engine(&argc,argv);
+ e->loadPlatform("../../platforms/storage/storage.xml");
- new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL);
- e->run();
- return 0;
+ new myHost("host", simgrid::s4u::Host::by_name("denise"), 0, NULL);
+ e->run();
+ return 0;
}
/* Check our arguments */
xbt_assert(argc > 2, "Usage: %s platform_file dax_file [jedule_file]\n"
- "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed",
- argv[0], argv[0]);
+ "\tExample: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed",
+ argv[0], argv[0]);
char *last = strrchr(argv[2], '.');
char * tracefilename = bprintf("%.*s.trace",(int) (last == NULL ?
- strlen(argv[2]) :
- last - argv[2]), argv[2]);
+ strlen(argv[2]) :
+ last - argv[2]), argv[2]);
if (argc == 4)
tracefilename = xbt_strdup(argv[3]);
/* SD initialization */
SD_init(&argc, argv);
xbt_assert(argc > 1,
- "Usage: %s platform_file\n\tExample: %s ../two_hosts.xml",
- argv[0], argv[0]);
+ "Usage: %s platform_file\n\tExample: %s ../two_hosts.xml",
+ argv[0], argv[0]);
SD_create_environment(argv[1]);
grand_parents = SD_task_get_parents(parent);
xbt_assert(xbt_dynar_length(grand_parents) <2,
- "Error: transfer %s has 2 parents",
- SD_task_get_name(parent));
+ "Error: transfer %s has 2 parents",
+ SD_task_get_name(parent));
xbt_dynar_get_cpy(grand_parents, 0, &grand_parent);
/* xbt_log_control_set("sd.thres=debug"); */
xbt_assert(argc > 1, "Usage: %s platform_file\n"
- "\nExample: %s two_clusters.xml", argv[0], argv[0]);
+ "\nExample: %s two_clusters.xml", argv[0], argv[0]);
/* creation of the environment */
platform_file = argv[1];
/* xbt_log_control_set("sd.thres=debug"); */
xbt_assert(argc > 1, "Usage: %s platform_file\n"
- "\nExample: %s two_clusters.xml", argv[0], argv[0]);
+ "\nExample: %s two_clusters.xml", argv[0], argv[0]);
/* creation of the environment */
platform_file = argv[1];
/* creation of the environment */
xbt_assert(strstr(argv[1],".xml"),
- "Unsupported platform description style (not XML): %s",
- argv[1]);
+ "Unsupported platform description style (not XML): %s",
+ argv[1]);
SD_create_environment(argv[1]);
/* getting platform infos */
/* xbt_log_control_set("sd.thres=debug"); */
xbt_assert(argc > 1, "Usage: %s platform_file\n"
- "\nExample: %s two_clusters.xml", argv[0], argv[0]);
+ "\nExample: %s two_clusters.xml", argv[0], argv[0]);
/* creation of the environment */
platform_file = argv[1];
case 'h':
XBT_INFO(
"Usage: mxm_cblas_test [options]\n"
- " -M I M size (default: %zu)\n"
- " -N I N size (default: %zu)\n"
- " -K I K size (default: %zu)\n"
- " -B I Block size on the k dimension(default: %zu)\n"
- " -G I Number of processor groups(default: %zu)\n"
- " -g I group index(default: %zu)\n"
- " -k I group rank(default: %zu)\n"
- " -r I processor row size (default: %zu)\n"
- " -c I processor col size (default: %zu)\n"
- " -h help\n",
+ " -M I M size (default: %zu)\n"
+ " -N I N size (default: %zu)\n"
+ " -K I K size (default: %zu)\n"
+ " -B I Block size on the k dimension(default: %zu)\n"
+ " -G I Number of processor groups(default: %zu)\n"
+ " -g I group index(default: %zu)\n"
+ " -k I group rank(default: %zu)\n"
+ " -r I processor row size (default: %zu)\n"
+ " -c I processor col size (default: %zu)\n"
+ " -h help\n",
m, n, k, Block_size, NB_groups, group, key, row, col);
return 0;
case 'M':
int main(int argc, char **argv) {
- int recv_x = 1, size, rank;
+ int recv_x = 1, size, rank;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Finalize();
- return 0;
+ return 0;
}
#include "xbt/asserts.h"
#include "smpi/smpi.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
- "Messages specific for this msg example");
+ "Messages specific for this msg example");
static int smpi_replay(int argc, char *argv[]) {
- smpi_replay_run(&argc, &argv);
- return 0;
+ smpi_replay_run(&argc, &argv);
+ return 0;
}
int main(int argc, char *argv[]){
- msg_error_t res;
- const char *platform_file;
- const char *application_file;
- const char *description_file;
-
- MSG_init(&argc, argv);
-
- if (argc < 4) {
- printf("Usage: %s description_file platform_file deployment_file\n", argv[0]);
- printf("example: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0]);
- exit(1);
- }
- description_file = argv[1];
- platform_file = argv[2];
- application_file = argv[3];
-
-
- /* Simulation setting */
- MSG_create_environment(platform_file);
-
- /* Application deployment: read the description file in order to identify instances to launch */
- FILE* fp = fopen(description_file, "r");
- if (fp == NULL)
- xbt_die("Cannot open %s", description_file);
- ssize_t read;
- char *line = NULL;
- size_t n = 0;
- int instance_size = 0;
- const char* instance_id = NULL;
- while ((read = xbt_getline(&line, &n, fp)) != -1 ){
- xbt_dynar_t elems = xbt_str_split_quoted_in_place(line);
- if(xbt_dynar_length(elems)<3){
- xbt_die ("Not enough elements in the line");
- }
-
- const char** line_char= xbt_dynar_to_array(elems);
- instance_id = line_char[0];
- instance_size = atoi(line_char[2]);
-
- XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size);
- SMPI_app_instance_register(instance_id, smpi_replay,instance_size);
-
- xbt_free(line_char);
- }
-
- MSG_launch_application(application_file);
- SMPI_init();
-
- res = MSG_main();
-
- XBT_INFO("Simulation time %g", MSG_get_clock());
-
- SMPI_finalize();
- if (res == MSG_OK)
- return 0;
- else
- return 1;
+ msg_error_t res;
+ const char *platform_file;
+ const char *application_file;
+ const char *description_file;
+
+ MSG_init(&argc, argv);
+
+ if (argc < 4) {
+ printf("Usage: %s description_file platform_file deployment_file\n", argv[0]);
+ printf("example: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0]);
+ exit(1);
+ }
+ description_file = argv[1];
+ platform_file = argv[2];
+ application_file = argv[3];
+
+
+ /* Simulation setting */
+ MSG_create_environment(platform_file);
+
+ /* Application deployment: read the description file in order to identify instances to launch */
+ FILE* fp = fopen(description_file, "r");
+ if (fp == NULL)
+ xbt_die("Cannot open %s", description_file);
+ ssize_t read;
+ char *line = NULL;
+ size_t n = 0;
+ int instance_size = 0;
+ const char* instance_id = NULL;
+ while ((read = xbt_getline(&line, &n, fp)) != -1 ){
+ xbt_dynar_t elems = xbt_str_split_quoted_in_place(line);
+ if(xbt_dynar_length(elems)<3){
+ xbt_die ("Not enough elements in the line");
+ }
+
+ const char** line_char= xbt_dynar_to_array(elems);
+ instance_id = line_char[0];
+ instance_size = atoi(line_char[2]);
+
+ XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size);
+ SMPI_app_instance_register(instance_id, smpi_replay,instance_size);
+
+ xbt_free(line_char);
+ }
+
+ MSG_launch_application(application_file);
+ SMPI_init();
+
+ res = MSG_main();
+
+ XBT_INFO("Simulation time %g", MSG_get_clock());
+
+ SMPI_finalize();
+ if (res == MSG_OK)
+ return 0;
+ else
+ return 1;
}
* We allow to link against compiled versions that differ in the patch level.
*/
#define MSG_init(argc,argv) do { \
- sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\
+ sg_version_check(SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH);\
MSG_init_nocheck(argc,argv); \
} while (0)
*
* class Worker : simgrid::s4u::Actor {
*
- * int main(int argc, char **argv) {
- * printf("Hello s4u");
- * }
+ * int main(int argc, char **argv) {
+ * printf("Hello s4u");
+ * }
* };
* \endverbatim
*
*/
XBT_PUBLIC_CLASS Actor {
- friend Comm;
- Actor(smx_process_t smx_proc);
+ friend Comm;
+ Actor(smx_process_t smx_proc);
public:
- Actor(const char*name, s4u::Host *host, int argc, char **argv);
- Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime);
- virtual ~Actor() {}
-
- /** The main method of your agent */
- virtual int main(int argc, char **argv);
-
- /** The Actor that is currently running */
- static Actor *current();
- /** Retrieves the actor that have the given PID (or NULL if not existing) */
- static Actor *byPid(int pid);
-
- /** Retrieves the name of that actor */
- const char*getName();
- /** Retrieves the host on which that actor is running */
- s4u::Host *getHost();
- /** Retrieves the PID of that actor */
- int getPid();
-
- /** If set to true, the actor will automatically restart when its host reboots */
- void setAutoRestart(bool autorestart);
- /** Sets the time at which that actor should be killed */
- void setKillTime(double time);
- /** Retrieves the time at which that actor will be killed (or -1 if not set) */
- double getKillTime();
-
- /** Ask kindly to all actors to die. Only the issuer will survive. */
- static void killAll();
- /** Ask the actor to die.
- *
- * It will only notice your request when doing a simcall next time (a communication or similar).
- * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues.
- */
- void kill();
-
- /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */
- void sleep(double duration);
-
- /** Block the actor, computing the given amount of flops */
- e_smx_state_t execute(double flop);
-
- /** Block the actor until it gets a message from the given mailbox.
- *
- * See \ref Comm for the full communication API (including non blocking communications).
- */
- void *recv(Mailbox &chan);
-
- /** Block the actor until it delivers a message of the given simulated size to the given mailbox
- *
- * See \ref Comm for the full communication API (including non blocking communications).
- */
- void send(Mailbox &chan, void*payload, size_t simulatedSize);
+ Actor(const char*name, s4u::Host *host, int argc, char **argv);
+ Actor(const char*name, s4u::Host *host, int argc, char **argv, double killTime);
+ virtual ~Actor() {}
+
+ /** The main method of your agent */
+ virtual int main(int argc, char **argv);
+
+ /** The Actor that is currently running */
+ static Actor *current();
+ /** Retrieves the actor that have the given PID (or NULL if not existing) */
+ static Actor *byPid(int pid);
+
+ /** Retrieves the name of that actor */
+ const char*getName();
+ /** Retrieves the host on which that actor is running */
+ s4u::Host *getHost();
+ /** Retrieves the PID of that actor */
+ int getPid();
+
+ /** If set to true, the actor will automatically restart when its host reboots */
+ void setAutoRestart(bool autorestart);
+ /** Sets the time at which that actor should be killed */
+ void setKillTime(double time);
+ /** Retrieves the time at which that actor will be killed (or -1 if not set) */
+ double getKillTime();
+
+ /** Ask kindly to all actors to die. Only the issuer will survive. */
+ static void killAll();
+ /** Ask the actor to die.
+ *
+ * It will only notice your request when doing a simcall next time (a communication or similar).
+ * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues.
+ */
+ void kill();
+
+ /** Block the actor sleeping for that amount of seconds (may throws hostFailure) */
+ void sleep(double duration);
+
+ /** Block the actor, computing the given amount of flops */
+ e_smx_state_t execute(double flop);
+
+ /** Block the actor until it gets a message from the given mailbox.
+ *
+ * See \ref Comm for the full communication API (including non blocking communications).
+ */
+ void *recv(Mailbox &chan);
+
+ /** Block the actor until it delivers a message of the given simulated size to the given mailbox
+ *
+ * See \ref Comm for the full communication API (including non blocking communications).
+ */
+ void send(Mailbox &chan, void*payload, size_t simulatedSize);
protected:
- smx_process_t getInferior() {return p_smx_process;}
+ smx_process_t getInferior() {return p_smx_process;}
private:
- smx_process_t p_smx_process;
+ smx_process_t p_smx_process;
};
}} // namespace simgrid::s4u
#if 0
public abstract class Actor implements Runnable {
- /** Suspends the process. See {@link #resume()} to resume it afterward */
- public native void suspend();
- /** Resume a process that was suspended by {@link #suspend()}. */
- public native void resume();
- /** Tests if a process is suspended. */
- public native boolean isSuspended();
-
- /**
- * Returns the value of a given process property.
- */
- public native String getProperty(String name);
-
-
- /**
- * Migrates a process to another host.
- *
- * @param host The host where to migrate the process.
- *
- */
- public native void migrate(Host host);
-
- public native void exit();
- /**
- * This static method returns the current amount of processes running
- *
- * @return The count of the running processes
- */
- public native static int getCount();
+ /** Suspends the process. See {@link #resume()} to resume it afterward */
+ public native void suspend();
+ /** Resume a process that was suspended by {@link #suspend()}. */
+ public native void resume();
+ /** Tests if a process is suspended. */
+ public native boolean isSuspended();
+
+ /**
+ * Returns the value of a given process property.
+ */
+ public native String getProperty(String name);
+
+
+ /**
+ * Migrates a process to another host.
+ *
+ * @param host The host where to migrate the process.
+ *
+ */
+ public native void migrate(Host host);
+
+ public native void exit();
+ /**
+ * This static method returns the current amount of processes running
+ *
+ * @return The count of the running processes
+ */
+ public native static int getCount();
}
#endif
SG_BEGIN_DECL();
typedef enum {
- inited, started, finished
+ inited, started, finished
} e_s4u_async_state_t;
SG_END_DECL();
* This class is the ancestor of every asynchronous actions, that is, of actions that do take time in the simulated world.
*/
XBT_PUBLIC_CLASS Async {
- friend Comm;
+ friend Comm;
protected:
- Async();
- virtual ~Async();
-
+ Async();
+ virtual ~Async();
+
private:
- struct s_smx_synchro *p_inferior = NULL;
+ struct s_smx_synchro *p_inferior = NULL;
private:
- e_s4u_async_state_t p_state = inited;
+ e_s4u_async_state_t p_state = inited;
public:
- /** Starts a previously created async.
- *
- * This function is optional: you can call wait() even if you didn't call start()
- */
- virtual void start()=0;
- /** Tests whether the given async is terminated yet */
- //virtual bool test()=0;
- /** Blocks until the async is terminated */
- virtual void wait()=0;
- /** Blocks until the async is terminated, or until the timeout is elapsed
- * Raises: timeout exception.*/
- virtual void wait(double timeout)=0;
- /** Cancel that async */
- //virtual void cancel();
- /** Retrieve the current state of the async */
- e_s4u_async_state_t getState() {return p_state;}
+ /** Starts a previously created async.
+ *
+ * This function is optional: you can call wait() even if you didn't call start()
+ */
+ virtual void start()=0;
+ /** Tests whether the given async is terminated yet */
+ //virtual bool test()=0;
+ /** Blocks until the async is terminated */
+ virtual void wait()=0;
+ /** Blocks until the async is terminated, or until the timeout is elapsed
+ * Raises: timeout exception.*/
+ virtual void wait(double timeout)=0;
+ /** Cancel that async */
+ //virtual void cancel();
+ /** Retrieve the current state of the async */
+ e_s4u_async_state_t getState() {return p_state;}
private:
- double p_remains = 0;
+ double p_remains = 0;
public:
- /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */
- double getRemains();
- /** Set the [remaining] amount of work that this Async will entail
- *
- * It is forbidden to change the amount of work once the Async is started */
- void setRemains(double remains);
+ /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */
+ double getRemains();
+ /** Set the [remaining] amount of work that this Async will entail
+ *
+ * It is forbidden to change the amount of work once the Async is started */
+ void setRemains(double remains);
private:
- void *p_userData = NULL;
+ void *p_userData = NULL;
public:
- /** Put some user data onto the Async */
- void setUserData(void *data) {p_userData=data;}
- /** Retrieve the user data of the Async */
- void *getUserData() { return p_userData; }
+ /** Put some user data onto the Async */
+ void setUserData(void *data) {p_userData=data;}
+ /** Retrieve the user data of the Async */
+ void *getUserData() { return p_userData; }
}; // class
}}; // Namespace simgrid::s4u
* Represents all asynchronous communications, that you can test or wait onto.
*/
XBT_PUBLIC_CLASS Comm : public Async {
- Comm() : Async() {}
+ Comm() : Async() {}
public:
- virtual ~Comm();
+ virtual ~Comm();
public:
- /** Creates (but don't start) an async send to the mailbox #dest */
- static Comm &send_init(Actor *sender, Mailbox &dest);
- /** Creates and start an async send to the mailbox #dest */
- static Comm &send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedByteAmount);
+ /** Creates (but don't start) an async send to the mailbox #dest */
+ static Comm &send_init(Actor *sender, Mailbox &dest);
+ /** Creates and start an async send to the mailbox #dest */
+ static Comm &send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedByteAmount);
/** Creates (but don't start) an async recv onto the mailbox #from */
- static Comm &recv_init(s4u::Actor *receiver, Mailbox &from);
- /** Creates and start an async recv to the mailbox #from */
- static Comm &recv_async(s4u::Actor *receiver, Mailbox &from, void **data);
+ static Comm &recv_init(s4u::Actor *receiver, Mailbox &from);
+ /** Creates and start an async recv to the mailbox #from */
+ static Comm &recv_async(s4u::Actor *receiver, Mailbox &from, void **data);
- void start() override;
- void wait() override;
- void wait(double timeout) override;
+ void start() override;
+ void wait() override;
+ void wait(double timeout) override;
private:
- double p_rate=-1;
+ double p_rate=-1;
public:
- /** Sets the maximal communication rate (in byte/sec). Must be done before start */
- void setRate(double rate);
+ /** Sets the maximal communication rate (in byte/sec). Must be done before start */
+ void setRate(double rate);
private:
- void *p_dstBuff = NULL;
- size_t p_dstBuffSize = 0;
- void *p_srcBuff = NULL;
- size_t p_srcBuffSize = sizeof(void*);
+ void *p_dstBuff = NULL;
+ size_t p_dstBuffSize = 0;
+ void *p_srcBuff = NULL;
+ size_t p_srcBuffSize = sizeof(void*);
public:
- /** Specify the data to send */
- void setSrcData(void * buff);
- /** Specify the size of the data to send */
- void setSrcDataSize(size_t size);
- /** Specify the data to send and its size */
- void setSrcData(void * buff, size_t size);
+ /** Specify the data to send */
+ void setSrcData(void * buff);
+ /** Specify the size of the data to send */
+ void setSrcDataSize(size_t size);
+ /** Specify the data to send and its size */
+ void setSrcData(void * buff, size_t size);
- /** Specify where to receive the data */
- void setDstData(void ** buff);
- /** Specify the buffer in which the data should be received */
- void setDstData(void ** buff, size_t size);
- /** Retrieve the size of the received data */
- size_t getDstDataSize();
+ /** Specify where to receive the data */
+ void setDstData(void ** buff);
+ /** Specify the buffer in which the data should be received */
+ void setDstData(void ** buff, size_t size);
+ /** Retrieve the size of the received data */
+ size_t getDstDataSize();
private: /* FIXME: expose these elements in the API */
- int p_detached = 0;
+ int p_detached = 0;
int (*p_matchFunction)(void *, void *, smx_synchro_t) = NULL;
void (*p_cleanFunction)(void *) = NULL;
void (*p_copyDataFunction)(smx_synchro_t, void*, size_t) = NULL;
private:
- Actor *p_sender = NULL;
- Actor *p_receiver = NULL;
- Mailbox *p_mailbox = NULL;
+ Actor *p_sender = NULL;
+ Actor *p_receiver = NULL;
+ Mailbox *p_mailbox = NULL;
};
}} // namespace simgrid::s4u
*/
XBT_PUBLIC_CLASS Engine {
public:
- /** Constructor, taking the command line parameters of your main function */
- Engine(int *argc, char **argv);
-
- /** @brief Load a platform file describing the environment
- *
- * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
- * Some examples can be found in the directory examples/platforms.
- */
- void loadPlatform(const char *platf);
-
- /** Registers the main function of an actor that will be launched from the deployment file */
- void register_function(const char*name, int (*code)(int,char**));
-
- /** Registers a function as the default main function of actors
- *
- * It will be used as fallback when the function requested from the deployment file was not registered.
- * It is used for trace-based simulations (see examples/msg/actions).
- */
- void register_default(int (*code)(int,char**));
-
- /** @brief Load a deployment file and launch the actors that it contains */
- void loadDeployment(const char *deploy);
-
- /** @brief Run the simulation */
- void run();
-
- /** @brief Retrieve the simulation time */
- static double getClock();
-
+ /** Constructor, taking the command line parameters of your main function */
+ Engine(int *argc, char **argv);
+
+ /** @brief Load a platform file describing the environment
+ *
+ * The environment is either a XML file following the simgrid.dtd formalism, or a lua file.
+ * Some examples can be found in the directory examples/platforms.
+ */
+ void loadPlatform(const char *platf);
+
+ /** Registers the main function of an actor that will be launched from the deployment file */
+ void register_function(const char*name, int (*code)(int,char**));
+
+ /** Registers a function as the default main function of actors
+ *
+ * It will be used as fallback when the function requested from the deployment file was not registered.
+ * It is used for trace-based simulations (see examples/msg/actions).
+ */
+ void register_default(int (*code)(int,char**));
+
+ /** @brief Load a deployment file and launch the actors that it contains */
+ void loadDeployment(const char *deploy);
+
+ /** @brief Run the simulation */
+ void run();
+
+ /** @brief Retrieve the simulation time */
+ static double getClock();
+
};
}} // namespace simgrid::sgo
*/
XBT_PUBLIC_CLASS File {
public:
- File(const char *fullpath, void* userdata);
- ~File();
+ File(const char *fullpath, void* userdata);
+ ~File();
private:
- smx_file_t p_inferior;
- const char *p_path;
+ smx_file_t p_inferior;
+ const char *p_path;
public:
- /** Retrieves the path to the file */
- const char *path() { return p_path;}
+ /** Retrieves the path to the file */
+ const char *path() { return p_path;}
public:
- /** Simulates a read action. Returns the size of data actually read
- *
- * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
- */
- sg_size_t read(sg_size_t size);
- /** Simulates a write action. Returns the size of data actually written.
- *
- * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
- */
- sg_size_t write(sg_size_t size);
-
- /** Allows to store user data on that host */
- void set_userdata(void *data) {p_userdata = data;}
- /** Retrieves the previously stored data */
- void* userdata() {return p_userdata;}
+ /** Simulates a read action. Returns the size of data actually read
+ *
+ * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
+ */
+ sg_size_t read(sg_size_t size);
+ /** Simulates a write action. Returns the size of data actually written.
+ *
+ * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
+ */
+ sg_size_t write(sg_size_t size);
+
+ /** Allows to store user data on that host */
+ void set_userdata(void *data) {p_userdata = data;}
+ /** Retrieves the previously stored data */
+ void* userdata() {return p_userdata;}
private:
- void *p_userdata=NULL;
+ void *p_userdata=NULL;
public:
- /** Retrieve the datasize */
- sg_size_t size();
-
- /** Sets the file head to the given position. */
- void seek(sg_size_t pos);
- /** Retrieves the current file position */
- sg_size_t tell();
-
- /** Rename a file
- *
- * WARNING: It is forbidden to move the file to another mount point */
- void move(const char*fullpath);
-
- /** Remove a file from disk */
- void unlink();
-
- /* FIXME: add these to the S4U API:
- XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file);
- XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath);
- XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath);
- */
+ /** Retrieve the datasize */
+ sg_size_t size();
+
+ /** Sets the file head to the given position. */
+ void seek(sg_size_t pos);
+ /** Retrieves the current file position */
+ sg_size_t tell();
+
+ /** Rename a file
+ *
+ * WARNING: It is forbidden to move the file to another mount point */
+ void move(const char*fullpath);
+
+ /** Remove a file from disk */
+ void unlink();
+
+ /* FIXME: add these to the S4U API:
+ XBT_PUBLIC(const char *) MSG_file_get_name(msg_file_t file);
+ XBT_PUBLIC(msg_error_t) MSG_file_rcopy(msg_file_t fd, msg_host_t host, const char* fullpath);
+ XBT_PUBLIC(msg_error_t) MSG_file_rmove(msg_file_t fd, msg_host_t host, const char* fullpath);
+ */
};
public simgrid::xbt::Extendable<Host> {
private:
- Host(const char *name);
+ Host(const char *name);
public: // TODO, make me private
- ~Host();
+ ~Host();
public:
static Host* by_name_or_null(const char* name);
static Host* by_name_or_create(const char* name);
- /** Retrieves an host from its name. */
- static s4u::Host *by_name(std::string name);
- /** Retrieves the host on which the current actor is running */
- static s4u::Host *current();
-
- simgrid::xbt::string const& name() const { return name_; }
-
- /** Turns that host on if it was previously off
- *
- * All actors on that host which were marked autorestart will be restarted automatically.
- * This call does nothing if the host is already on.
- */
- void turn_on();
- /** Turns that host off. All actors are forcefully stopped. */
- void turn_off();
- /** Returns if that host is currently up and running */
- bool is_on();
- bool is_off() { return !is_on(); }
-
- double speed();
- int core_count();
- xbt_dict_t properties();
- xbt_swag_t processes();
- double current_power_peak();
- double power_peak_at(int pstate_index);
- void set_pstate(int pstate_index);
- int pstates_count() const;
- int pstate();
- void get_parameters(vm_params_t params);
- void set_parameters(vm_params_t params);
- xbt_dict_t mounted_storages_as_dict(); // HACK
- xbt_dynar_t attached_storages();
-
- /** Get an associative list [mount point]->[Storage] off all local mount points.
- *
- * This is defined in the platform file, and cannot be modified programatically (yet).
- */
- boost::unordered_map<std::string, Storage*> const &mounted_storages();
+ /** Retrieves an host from its name. */
+ static s4u::Host *by_name(std::string name);
+ /** Retrieves the host on which the current actor is running */
+ static s4u::Host *current();
+
+ simgrid::xbt::string const& name() const { return name_; }
+
+ /** Turns that host on if it was previously off
+ *
+ * All actors on that host which were marked autorestart will be restarted automatically.
+ * This call does nothing if the host is already on.
+ */
+ void turn_on();
+ /** Turns that host off. All actors are forcefully stopped. */
+ void turn_off();
+ /** Returns if that host is currently up and running */
+ bool is_on();
+ bool is_off() { return !is_on(); }
+
+ double speed();
+ int core_count();
+ xbt_dict_t properties();
+ xbt_swag_t processes();
+ double current_power_peak();
+ double power_peak_at(int pstate_index);
+ void set_pstate(int pstate_index);
+ int pstates_count() const;
+ int pstate();
+ void get_parameters(vm_params_t params);
+ void set_parameters(vm_params_t params);
+ xbt_dict_t mounted_storages_as_dict(); // HACK
+ xbt_dynar_t attached_storages();
+
+ /** Get an associative list [mount point]->[Storage] off all local mount points.
+ *
+ * This is defined in the platform file, and cannot be modified programatically (yet).
+ */
+ boost::unordered_map<std::string, Storage*> const &mounted_storages();
private:
- simgrid::xbt::string name_ = "noname";
- boost::unordered_map<std::string, Storage*> *mounts = NULL; // caching
+ simgrid::xbt::string name_ = "noname";
+ boost::unordered_map<std::string, Storage*> *mounts = NULL; // caching
public:
- // FIXME: these should be protected, but it leads to many errors
- // Use the extensions stuff for this? Go through simgrid::surf::Host?
+ // FIXME: these should be protected, but it leads to many errors
+ // Use the extensions stuff for this? Go through simgrid::surf::Host?
// TODO, this could be a unique_ptr
- surf::Cpu *pimpl_cpu = nullptr;
- surf::NetCard *pimpl_netcard = nullptr;
+ surf::Cpu *pimpl_cpu = nullptr;
+ surf::NetCard *pimpl_netcard = nullptr;
public:
- /*** Called on each newly created object */
- static simgrid::xbt::signal<void(Host&)> onCreation;
- /*** Called just before destructing an object */
- static simgrid::xbt::signal<void(Host&)> onDestruction;
- /*** Called when the machine is turned on or off */
- static simgrid::xbt::signal<void(Host&)> onStateChange;
+ /*** Called on each newly created object */
+ static simgrid::xbt::signal<void(Host&)> onCreation;
+ /*** Called just before destructing an object */
+ static simgrid::xbt::signal<void(Host&)> onDestruction;
+ /*** Called when the machine is turned on or off */
+ static simgrid::xbt::signal<void(Host&)> onStateChange;
};
}} // namespace simgrid::s4u
Host jacquelin;
try {
- jacquelin = Host.getByName("Jacquelin");
+ jacquelin = Host.getByName("Jacquelin");
} catch(HostNotFoundException e) {
- System.err.println(e.toString());
+ System.err.println(e.toString());
}
...
\endverbatim
*
*/
public class Host {
- /**
- * This static method returns all of the hosts of the installed platform.
- *
- * @return An array containing all the hosts installed.
- *
- */
- public native static Host[] all();
-
- /**
- * This static method sets a mailbox to receive in asynchronous mode.
- *
- * All messages sent to this mailbox will be transferred to
- * the receiver without waiting for the receive call.
- * The receive call will still be necessary to use the received data.
- * If there is a need to receive some messages asynchronously, and some not,
- * two different mailboxes should be used.
- *
- * @param mailboxName The name of the mailbox
- */
- public static native void setAsyncMailbox(String mailboxName);
-
- /**
- * This method returns the number of tasks currently running on a host.
- * The external load (comming from an availability trace) is not taken in account.
- *
- * @return The number of tasks currently running on a host.
- */
- public native int getLoad();
-
- /**
- * This method returns the speed of the processor of a host,
- * regardless of the current load of the machine.
- *
- * @return The speed of the processor of the host in flops.
- *
- */
- public native double getSpeed();
-
- /**
- * This method returns the number of core of a host.
- *
- * @return The speed of the processor of the host in flops.
- *
- */
- public native double getCoreNumber();
-
- /**
- * Returns the value of a given host property (set from the platform file).
- */
- public native String getProperty(String name);
-
- /**
- * Change the value of a given host property.
- */
- public native void setProperty(String name, String value);
-
- /** This methods returns the list of storages attached to an host
- * @return An array containing all storages (name) attached to the host
- */
- public native String[] getAttachedStorage();
+ /**
+ * This static method returns all of the hosts of the installed platform.
+ *
+ * @return An array containing all the hosts installed.
+ *
+ */
+ public native static Host[] all();
+
+ /**
+ * This static method sets a mailbox to receive in asynchronous mode.
+ *
+ * All messages sent to this mailbox will be transferred to
+ * the receiver without waiting for the receive call.
+ * The receive call will still be necessary to use the received data.
+ * If there is a need to receive some messages asynchronously, and some not,
+ * two different mailboxes should be used.
+ *
+ * @param mailboxName The name of the mailbox
+ */
+ public static native void setAsyncMailbox(String mailboxName);
+
+ /**
+ * This method returns the number of tasks currently running on a host.
+ * The external load (comming from an availability trace) is not taken in account.
+ *
+ * @return The number of tasks currently running on a host.
+ */
+ public native int getLoad();
+
+ /**
+ * This method returns the speed of the processor of a host,
+ * regardless of the current load of the machine.
+ *
+ * @return The speed of the processor of the host in flops.
+ *
+ */
+ public native double getSpeed();
+
+ /**
+ * This method returns the number of core of a host.
+ *
+ * @return The speed of the processor of the host in flops.
+ *
+ */
+ public native double getCoreNumber();
+
+ /**
+ * Returns the value of a given host property (set from the platform file).
+ */
+ public native String getProperty(String name);
+
+ /**
+ * Change the value of a given host property.
+ */
+ public native void setProperty(String name, String value);
+
+ /** This methods returns the list of storages attached to an host
+ * @return An array containing all storages (name) attached to the host
+ */
+ public native String[] getAttachedStorage();
}
* sender and receiver.
*/
XBT_PUBLIC_CLASS Mailbox {
- friend Comm;
+ friend Comm;
private:
- Mailbox(const char*name, smx_rdv_t inferior);
+ Mailbox(const char*name, smx_rdv_t inferior);
public:
- ~Mailbox();
-
+ ~Mailbox();
+
protected:
- smx_rdv_t getInferior() { return p_inferior; }
+ smx_rdv_t getInferior() { return p_inferior; }
public:
- /** Get the name of that mailbox */
- const char *getName();
- /** Retrieve the mailbox associated to the given string */
- static Mailbox *byName(const char *name);
+ /** Get the name of that mailbox */
+ const char *getName();
+ /** Retrieve the mailbox associated to the given string */
+ static Mailbox *byName(const char *name);
private:
- std::string p_name;
- smx_rdv_t p_inferior;
- static boost::unordered_map<std::string, Mailbox *> *mailboxes;
+ std::string p_name;
+ smx_rdv_t p_inferior;
+ static boost::unordered_map<std::string, Mailbox *> *mailboxes;
};
}} // namespace simgrid::s4u
XBT_PUBLIC_CLASS Storage {
private:
- Storage(std::string name, smx_storage_t inferior);
- virtual ~Storage();
+ Storage(std::string name, smx_storage_t inferior);
+ virtual ~Storage();
public:
- /** Retrieve a Storage by its name. It must exist in the platform file */
- static Storage &byName(const char* name);
- const char *name();
- sg_size_t size_free();
- sg_size_t size_used();
- /** Retrieve the total amount of space of this storage element */
- sg_size_t size();
-
- /* TODO: missing API:
+ /** Retrieve a Storage by its name. It must exist in the platform file */
+ static Storage &byName(const char* name);
+ const char *name();
+ sg_size_t size_free();
+ sg_size_t size_used();
+ /** Retrieve the total amount of space of this storage element */
+ sg_size_t size();
+
+ /* TODO: missing API:
XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage);
XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn);
XBT_PUBLIC(const char *)MSG_storage_get_property_value(msg_storage_t storage, const char *name);
XBT_PUBLIC(xbt_dict_t) MSG_storage_get_content(msg_storage_t storage);
XBT_PUBLIC(msg_error_t) MSG_storage_file_move(msg_file_t fd, msg_host_t dest, char* mount, char* fullname);
XBT_PUBLIC(const char *) MSG_storage_get_host(msg_storage_t storage);
- */
+ */
protected:
- smx_storage_t inferior();
+ smx_storage_t inferior();
private:
- static boost::unordered_map<std::string, Storage *> *storages;
- std::string p_name;
- smx_storage_t p_inferior;
+ static boost::unordered_map<std::string, Storage *> *storages;
+ std::string p_name;
+ smx_storage_t p_inferior;
public:
- void set_userdata(void *data) {p_userdata = data;}
- void *userdata() {return p_userdata;}
+ void set_userdata(void *data) {p_userdata = data;}
+ void *userdata() {return p_userdata;}
private:
- void *p_userdata = NULL;
+ void *p_userdata = NULL;
};
/* Define _GNU_SOURCE for getline, isfinite, etc. */
#ifndef _GNU_SOURCE
- #define _GNU_SOURCE
+ #define _GNU_SOURCE
#endif
/* Attributes are only in recent versions of GCC */
#endif
#ifdef _MSC_VER /* MSVC has no ssize_t, and I fail to use the SSIZE_T declared in BaseTsd.h */
- #if defined(_WIN64)
- typedef __int64 ssize_t;
- #else
- typedef long ssize_t;
- #endif
+ #if defined(_WIN64)
+ typedef __int64 ssize_t;
+ #else
+ typedef long ssize_t;
+ #endif
/* Microsoft wants to improve the code quality blah blah blah */
/* See: https://msdn.microsoft.com/en-us/library/8ef0s5kh.aspx */
- /* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */
- #define _CRT_NONSTDC_NO_WARNINGS
- /* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */
- #define _CRT_SECURE_NO_WARNINGS
+ /* warning C4996: '_strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. */
+ #define _CRT_NONSTDC_NO_WARNINGS
+ /* warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. */
+ #define _CRT_SECURE_NO_WARNINGS
#endif
#if !defined (max) && !defined(__cplusplus)
* @brief Log an event at the DEBUG priority on the specified category with these args.
*/
#define XBT_CDEBUG(categ, ...) \
- do { \
- if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = &(_XBT_LOGV(categ)); \
- _log_ev.priority = xbt_log_priority_debug; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = &(_XBT_LOGV(categ)); \
+ _log_ev.priority = xbt_log_priority_debug; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the VERB priority on the specified category with these args.
*/
#define XBT_CVERB(categ, ...) \
- do { \
- if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = &(_XBT_LOGV(categ)); \
- _log_ev.priority = xbt_log_priority_verbose; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = &(_XBT_LOGV(categ)); \
+ _log_ev.priority = xbt_log_priority_verbose; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the INFO priority on the specified category with these args.
*/
#define XBT_CINFO(categ, ...) \
- do { \
- if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = &(_XBT_LOGV(categ)); \
- _log_ev.priority = xbt_log_priority_info; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = &(_XBT_LOGV(categ)); \
+ _log_ev.priority = xbt_log_priority_info; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @brief Log an event at the WARN priority on the specified category with these args.
*/
#define XBT_CWARN(categ, ...) \
- do { \
- if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = &(_XBT_LOGV(categ)); \
- _log_ev.priority = xbt_log_priority_warning; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = &(_XBT_LOGV(categ)); \
+ _log_ev.priority = xbt_log_priority_warning; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @brief Log an event at the ERROR priority on the specified category with these args.
*/
#define XBT_CERROR(categ, ...) \
- do { \
- if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = &(_XBT_LOGV(categ)); \
- _log_ev.priority = xbt_log_priority_error; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = &(_XBT_LOGV(categ)); \
+ _log_ev.priority = xbt_log_priority_error; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10).
*/
#define XBT_CCRITICAL(categ, ...) \
- do { \
- if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = &(_XBT_LOGV(categ)); \
- _log_ev.priority = xbt_log_priority_critical; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = &(_XBT_LOGV(categ)); \
+ _log_ev.priority = xbt_log_priority_critical; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the DEBUG priority on the default category with these args.
*/
#define XBT_DEBUG(...) \
- do { \
- if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
- xbt_log_priority_debug)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = _simgrid_log_category__default; \
- _log_ev.priority = xbt_log_priority_debug; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
+ xbt_log_priority_debug)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = _simgrid_log_category__default; \
+ _log_ev.priority = xbt_log_priority_debug; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the VERB priority on the default category with these args.
*/
#define XBT_VERB(...) \
- do { \
- if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
- xbt_log_priority_verbose)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = _simgrid_log_category__default; \
- _log_ev.priority = xbt_log_priority_verbose; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
+ xbt_log_priority_verbose)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = _simgrid_log_category__default; \
+ _log_ev.priority = xbt_log_priority_verbose; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the INFO priority on the default category with these args.
*/
#define XBT_INFO(...) \
- do { \
- if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
- xbt_log_priority_info)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = _simgrid_log_category__default; \
- _log_ev.priority = xbt_log_priority_info; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
+ xbt_log_priority_info)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = _simgrid_log_category__default; \
+ _log_ev.priority = xbt_log_priority_info; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the WARN priority on the default category with these args.
*/
#define XBT_WARN(...) \
- do { \
- if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
- xbt_log_priority_warning)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = _simgrid_log_category__default; \
- _log_ev.priority = xbt_log_priority_warning; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
+ xbt_log_priority_warning)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = _simgrid_log_category__default; \
+ _log_ev.priority = xbt_log_priority_warning; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the ERROR priority on the default category with these args.
*/
#define XBT_ERROR(...) \
- do { \
- if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
- xbt_log_priority_error)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = _simgrid_log_category__default; \
- _log_ev.priority = xbt_log_priority_error; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
+ xbt_log_priority_error)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = _simgrid_log_category__default; \
+ _log_ev.priority = xbt_log_priority_error; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
/** @ingroup XBT_log
* @hideinitializer
* @brief Log an event at the CRITICAL priority on the default category with these args.
*/
#define XBT_CRITICAL(...) \
- do { \
- if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
- xbt_log_priority_critical)) { \
- s_xbt_log_event_t _log_ev; \
- _log_ev.cat = _simgrid_log_category__default; \
- _log_ev.priority = xbt_log_priority_critical; \
- _log_ev.fileName = __FILE__; \
- _log_ev.functionName = _XBT_FUNCTION; \
- _log_ev.lineNum = __LINE__; \
- _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
- } \
- } while (0)
+ do { \
+ if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default, \
+ xbt_log_priority_critical)) { \
+ s_xbt_log_event_t _log_ev; \
+ _log_ev.cat = _simgrid_log_category__default; \
+ _log_ev.priority = xbt_log_priority_critical; \
+ _log_ev.fileName = __FILE__; \
+ _log_ev.functionName = _XBT_FUNCTION; \
+ _log_ev.lineNum = __LINE__; \
+ _xbt_log_event_log(&_log_ev, __VA_ARGS__); \
+ } \
+ } while (0)
#define _XBT_IN_OUT(...) \
_XBT_IF_ONE_ARG(_XBT_IN_OUT_ARG1, _XBT_IN_OUT_ARGN, __VA_ARGS__)(__VA_ARGS__)
void jmsg_throw_status(JNIEnv *env, msg_error_t status);
/*
- * Class org_simgrid_msg_Msg
- * Method getClock
- * Signature ()D
+ * Class org_simgrid_msg_Msg
+ * Method getClock
+ * Signature ()D
*/
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Msg_getClock(JNIEnv *, jclass);
/**
- * Class org_simgrid_msg_Msg
- * Method run
+ * Class org_simgrid_msg_Msg
+ * Method run
*/
JNIEXPORT void JNICALL
JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv * env, jclass cls);
void jfile_bind(JNIEnv *env, jobject jfile, msg_file_t fd);
msg_file_t jfile_get_native(JNIEnv *env, jobject jfile);
/**
- * Class org_simgrid_msg_File
- * Method nativeInit
- * Signature ()V
+ * Class org_simgrid_msg_File
+ * Method nativeInit
+ * Signature ()V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_File_nativeInit(JNIEnv*, jclass);
/**
- * Class org_simgrid_msg_File
- * Method open
- * Signature (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ * Class org_simgrid_msg_File
+ * Method open
+ * Signature (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_File_open(JNIEnv*, jobject, jobject);
/**
- * Class org_simgrid_msg_File
- * Method read
+ * Class org_simgrid_msg_File
+ * Method read
*/
JNIEXPORT jlong JNICALL
Java_org_simgrid_msg_File_read(JNIEnv*, jobject, jlong);
/**
- * Class org_simgrid_msg_File
- * Method write
+ * Class org_simgrid_msg_File
+ * Method write
*/
JNIEXPORT jlong JNICALL
Java_org_simgrid_msg_File_write(JNIEnv*, jobject, jlong);
/**
- * Class org_simgrid_msg_File
- * Method close
+ * Class org_simgrid_msg_File
+ * Method close
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_File_close(JNIEnv*, jobject);
/* get the C string from the java string */
if (jname == NULL) {
- jxbt_throw_null(env,bprintf("No host can have a null name"));
- return NULL;
+ jxbt_throw_null(env,bprintf("No host can have a null name"));
+ return NULL;
}
const char *name = env->GetStringUTFChars(jname, 0);
/* get the host by name (the hosts are created during the grid resolution) */
}
int index = 0;
- jobjectArray jtable;
- xbt_dict_t dict = MSG_host_get_mounted_storage_list(host);
- int count = xbt_dict_length(dict);
- jclass cls = env->FindClass("org/simgrid/msg/Storage");
+ jobjectArray jtable;
+ xbt_dict_t dict = MSG_host_get_mounted_storage_list(host);
+ int count = xbt_dict_length(dict);
+ jclass cls = env->FindClass("org/simgrid/msg/Storage");
- jtable = env->NewObjectArray((jsize) count, cls, NULL);
+ jtable = env->NewObjectArray((jsize) count, cls, NULL);
- if (!jtable) {
- jxbt_throw_jni(env, "Storages table allocation failed");
- return NULL;
- }
+ if (!jtable) {
+ jxbt_throw_jni(env, "Storages table allocation failed");
+ return NULL;
+ }
- xbt_dict_cursor_t cursor=NULL;
- const char *mount_name, *storage_name;
+ xbt_dict_cursor_t cursor=NULL;
+ const char *mount_name, *storage_name;
- xbt_dict_foreach(dict,cursor,mount_name,storage_name) {
- jname = env->NewStringUTF(storage_name);
- jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
- env->SetObjectArrayElement(jtable, index, jstorage);
+ xbt_dict_foreach(dict,cursor,mount_name,storage_name) {
+ jname = env->NewStringUTF(storage_name);
+ jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
+ env->SetObjectArrayElement(jtable, index, jstorage);
index++;
- }
- xbt_dict_free(&dict);
- return jtable;
+ }
+ xbt_dict_free(&dict);
+ return jtable;
}
JNIEXPORT jobjectArray JNICALL
jname = env->NewStringUTF(MSG_host_get_name(host));
jhost =
- Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
+ Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
/* FIXME: leak of jname ? */
}
/**
* This function returns a new java host instance.
*
- * @param env The environment of the current thread
+ * @param env The environment of the current thread
*
- * @return A new java host object.
+ * @return A new java host object.
*
- * @exception If the class Host is not found the function throws
- * the ClassNotFoundException. If the constructor of
- * this class is not found the function throws the exception
- * NotSuchMethodException.
+ * @exception If the class Host is not found the function throws
+ * the ClassNotFoundException. If the constructor of
+ * this class is not found the function throws the exception
+ * NotSuchMethodException.
*/
jobject jhost_new_instance(JNIEnv * env);
* This function returns a global reference to the java host instance
* specified by the parameter jhost.
*
- * @param jhost The original java host instance.
- * @param env The environment of the current thread
+ * @param jhost The original java host instance.
+ * @param env The environment of the current thread
*
- * @return The global reference to the original java host
- * instance.
+ * @return The global reference to the original java host
+ * instance.
*/
jobject jhost_ref(JNIEnv * env, jobject jhost);
/**
* This function delete a global reference to a java host instance.
*
- * @param The global refernce to delete.
- * @param env The environment of the current thread
+ * @param The global refernce to delete.
+ * @param env The environment of the current thread
*/
void jhost_unref(JNIEnv * env, jobject jhost);
/**
* This function associated a native host to a java host instance.
*
- * @param jhost The java host instance.
- * @param host The native host to bind.
- * @param env The environment of the current thread
+ * @param jhost The java host instance.
+ * @param host The native host to bind.
+ * @param env The environment of the current thread
*
- * @exception If the class Host is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Host is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
void jhost_bind(jobject jhost, msg_host_t host, JNIEnv * env);
/**
* This function returns a native host from a java host instance.
*
- * @param jhost The java host object from which get the native host.
- * @param env The environment of the current thread
+ * @param jhost The java host object from which get the native host.
+ * @param env The environment of the current thread
*
- * @return The function returns the native host associated to the
- * java host object.
+ * @return The function returns the native host associated to the
+ * java host object.
*
- * @exception If the class Host is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Host is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
msg_host_t jhost_get_native(JNIEnv * env, jobject jhost);
/**
* This function returns the name of a MSG host.
*
- * @param jhost A java host object.
- * @param env The environment of the current thread
+ * @param jhost A java host object.
+ * @param env The environment of the current thread
*
- * @return The name of the host.
+ * @return The name of the host.
*/
const char *jhost_get_name(jobject jhost, JNIEnv * env);
* This function tests if a java host instance is valid.
* A java host object is valid if it is bind to a native host.
*
- * @param jhost The host to test the validity.
- * @param env The environment of the current thread
+ * @param jhost The host to test the validity.
+ * @param env The environment of the current thread
*
- * @return If the java host is valid the function returns true.
- * Otherwise the function returns false.
+ * @return If the java host is valid the function returns true.
+ * Otherwise the function returns false.
*/
jboolean jhost_is_valid(jobject jhost, JNIEnv * env);
/*
- * Class org_simgrid_msg_Host
- * Method nativeInit
- * Signature ();
+ * Class org_simgrid_msg_Host
+ * Method nativeInit
+ * Signature ();
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls);
/*
- * Class org_simgrid_msg_Host
- * Method getByName
- * Signature (Ljava/lang/String;)Lsimgrid/msg/Host;
+ * Class org_simgrid_msg_Host
+ * Method getByName
+ * Signature (Ljava/lang/String;)Lsimgrid/msg/Host;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName
(JNIEnv *, jclass, jstring);
/**
* This function start the host if it is off
*
- * @param jhost The host to test the validity.
- * @param env The environment of the current thread
+ * @param jhost The host to test the validity.
+ * @param env The environment of the current thread
*
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost);
/**
* This function stop the host if it is on
*
- * @param jhost The host to test the validity.
- * @param env The environment of the current thread
+ * @param jhost The host to test the validity.
+ * @param env The environment of the current thread
*
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost);
/*
- * Class org_simgrid_msg_Host
- * Method currentHost
- * Signature ()Lsimgrid/msg/Host;
+ * Class org_simgrid_msg_Host
+ * Method currentHost
+ * Signature ()Lsimgrid/msg/Host;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost
(JNIEnv *, jclass);
/*
- * Class org_simgrid_msg_Host
- * Method getCount
- * Signature ()I
+ * Class org_simgrid_msg_Host
+ * Method getCount
+ * Signature ()I
*/
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount
(JNIEnv *, jclass);
/*
- * Class org_simgrid_msg_Host
- * Method getSpeed
- * Signature ()D
+ * Class org_simgrid_msg_Host
+ * Method getSpeed
+ * Signature ()D
*/
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Host
- * Method getCoreNumber
- * Signature ()D
+ * Class org_simgrid_msg_Host
+ * Method getCoreNumber
+ * Signature ()D
*/
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber
(JNIEnv *, jobject);
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
/*
- * Class org_simgrid_msg_Host
- * Method isOn
- * Signature ()Z
+ * Class org_simgrid_msg_Host
+ * Method isOn
+ * Signature ()Z
*/
JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Host
- * Method getMountedStorage
+ * Class org_simgrid_msg_Host
+ * Method getMountedStorage
* Signature: ()[Lorg/simgrid/msg/Storage;
*/
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost);
/*
- * Class org_simgrid_msg_Host
- * Method getAttachedStorageList
+ * Class org_simgrid_msg_Host
+ * Method getAttachedStorageList
*/
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost);
/*
- * Class org_simgrid_msg_Host
- * Method getStorageContent
+ * Class org_simgrid_msg_Host
+ * Method getStorageContent
*/
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost);
void jprocess_join(jobject jprocess, JNIEnv * env)
{
- msg_process_t process = jprocess_to_native_process(jprocess,env);
- simgrid::java::JavaContext* context =
+ msg_process_t process = jprocess_to_native_process(jprocess,env);
+ simgrid::java::JavaContext* context =
(simgrid::java::JavaContext*) MSG_process_get_smx_ctx(process);
- xbt_os_thread_join(context->thread,NULL);
+ xbt_os_thread_join(context->thread,NULL);
}
msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env)
simgrid::java::java_main_jprocess(jprocess);
return 0;
}, jprocess,
- host,
- /*argc, argv, properties*/
- 0, NULL, NULL);
+ host,
+ /*argc, argv, properties*/
+ 0, NULL, NULL);
MSG_process_set_kill_time(process, (double)jkill);
/* bind the java process instance to the native process */
jprocess_bind(jprocess, process, env);
Java_org_simgrid_msg_Process_kill(JNIEnv * env,
jobject jprocess)
{
- /* get the native instances from the java ones */
+ /* get the native instances from the java ones */
msg_process_t process = jprocess_to_native_process(jprocess, env);
if (!process) {
jxbt_throw_notbound(env, "process", jprocess);
return;
}
- MSG_process_kill(process);
+ MSG_process_kill(process);
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_migrate(JNIEnv * env,
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_setKillTime (JNIEnv *env , jobject jprocess, jdouble jkilltime) {
- msg_process_t process = jprocess_to_native_process(jprocess, env);
- MSG_process_set_kill_time(process, (double)jkilltime);
+ msg_process_t process = jprocess_to_native_process(jprocess, env);
+ MSG_process_set_kill_time(process, (double)jkilltime);
}
JNIEXPORT jint JNICALL
* This function returns a global reference to the java process instance
* specified by the parameter jprocess.
*
- * @param jprocess The original java process instance.
- * @param env The env of the current thread
+ * @param jprocess The original java process instance.
+ * @param env The env of the current thread
*
- * @return The global reference to the original java process
- * instance.
+ * @return The global reference to the original java process
+ * instance.
*/
jobject jprocess_new_global_ref(jobject jprocess, JNIEnv * env);
* This function delete a global reference to a java process instance.
* If the java process is alive the function joins it and stops it before.
*
- * @param The global refernce to delete.
- * @param env The env of the current thread
+ * @param The global refernce to delete.
+ * @param env The env of the current thread
*
- * @see jprocess_join()
- * @see jprocess_exit()
+ * @see jprocess_join()
+ * @see jprocess_exit()
*/
void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env);
/**
* This function waits for a java process to terminate.
*
- * @param jprocess The java process ot wait for.
- * @param env The env of the current thread
+ * @param jprocess The java process ot wait for.
+ * @param env The env of the current thread
*
- * @exception If the class Process is not found the function throws
- * the ClassNotFoundException. If the methos join() of
- * this class is not found the function throws the exception
- * NotSuchMethodException.
+ * @exception If the class Process is not found the function throws
+ * the ClassNotFoundException. If the methos join() of
+ * this class is not found the function throws the exception
+ * NotSuchMethodException.
*
*/
void jprocess_join(jobject jprocess, JNIEnv * env);
/**
* This function associated a native process to a java process instance.
*
- * @param jprocess The java process instance.
- * @param process The native process to bind.
- * @param env The env of the current thread
+ * @param jprocess The java process instance.
+ * @param process The native process to bind.
+ * @param env The env of the current thread
*
- * @exception If the class Process is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Process is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
void jprocess_bind(jobject jprocess, msg_process_t process, JNIEnv * env);
/**
* This function returns a native process from a java process instance.
*
- * @param jprocess The java process object from which get the native process.
- * @param env The env of the current thread
+ * @param jprocess The java process object from which get the native process.
+ * @param env The env of the current thread
*
- * @return The function returns the native process associated to the
- * java process object.
+ * @return The function returns the native process associated to the
+ * java process object.
*
- * @exception If the class Process is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Process is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env);
/**
* This function gets the id of the specified java process.
*
- * @param jprocess The java process to get the id.
- * @param env The env of the current thread
+ * @param jprocess The java process to get the id.
+ * @param env The env of the current thread
*
- * @exception If the class Process is not found the function throws
- * the ClassNotFoundException. If the field id of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Process is not found the function throws
+ * the ClassNotFoundException. If the field id of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*
- * @return The id of the specified java process.
+ * @return The id of the specified java process.
*/
jlong jprocess_get_id(jobject jprocess, JNIEnv * env);
* A java process object is valid if it is bind to a native
* process.
*
- * @param jprocess The java process to test the validity.
- * @param env The env of the current thread
+ * @param jprocess The java process to test the validity.
+ * @param env The env of the current thread
*
- * @return If the java process is valid the function returns true.
- * Otherwise the function returns false.
+ * @return If the java process is valid the function returns true.
+ * Otherwise the function returns false.
*/
jboolean jprocess_is_valid(jobject jprocess, JNIEnv * env);
/**
* This function gets the name of the specified java process.
*
- * @param jprocess The java process to get the name.
- * @param env The env of the current thread
+ * @param jprocess The java process to get the name.
+ * @param env The env of the current thread
*
- * @exception If the class Process is not found the function throws
- * the ClassNotFoundException. If the field name of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Process is not found the function throws
+ * the ClassNotFoundException. If the field name of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*
- * @return The name of the specified java process.
+ * @return The name of the specified java process.
*/
jstring jprocess_get_name(jobject jprocess, JNIEnv * env);
/*
- * Class org_simgrid_msg_Process
- * Method nativeInit
- * Signature ();
+ * Class org_simgrid_msg_Process
+ * Method nativeInit
+ * Signature ();
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jclass cls);
/*
- * Class org_simgrid_msg_Process
- * Method create
- * Signature (Lorg/simgrid/msg/Host;)V
+ * Class org_simgrid_msg_Process
+ * Method create
+ * Signature (Lorg/simgrid/msg/Host;)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_create(JNIEnv * env,
jobject jhostname);
/*
- * Class org_simgrid_msg_Process
- * Method killAll
- * Signature (I)I
+ * Class org_simgrid_msg_Process
+ * Method killAll
+ * Signature (I)I
*/
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll
(JNIEnv *, jclass, jint);
/*
- * Class org_simgrid_msg_Process
- * Method fromPID
- * Signature (I)Lorg/simgrid/msg/Process;
+ * Class org_simgrid_msg_Process
+ * Method fromPID
+ * Signature (I)Lorg/simgrid/msg/Process;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID
(JNIEnv *, jclass, jint);
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname);
/*
- * Class org_simgrid_msg_Process
- * Method currentProcess
- * Signature ()Lorg/simgrid/msg/Process;
+ * Class org_simgrid_msg_Process
+ * Method currentProcess
+ * Signature ()Lorg/simgrid/msg/Process;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getCurrentProcess
(JNIEnv *, jclass);
/*
- * Class org_simgrid_msg_Process
- * Method suspend
- * Signature (Lorg/simgrid/msg/Process;)V
+ * Class org_simgrid_msg_Process
+ * Method suspend
+ * Signature (Lorg/simgrid/msg/Process;)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Process_suspend(JNIEnv * env,
jobject jprocess);
/*
- * Class org_simgrid_msg_Process
- * Method resume
- * Signature (Lorg/simgrid/msg/Process;)V
+ * Class org_simgrid_msg_Process
+ * Method resume
+ * Signature (Lorg/simgrid/msg/Process;)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume
(JNIEnv *, jobject);
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Process
- * Method isSuspended
- * Signature (Lorg/simgrid/msg/Process;)Z
+ * Class org_simgrid_msg_Process
+ * Method isSuspended
+ * Signature (Lorg/simgrid/msg/Process;)Z
*/
JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Process
- * Method sleep
- * Signature (DI)V
+ * Class org_simgrid_msg_Process
+ * Method sleep
+ * Signature (DI)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep
(JNIEnv *, jclass, jlong, jint);
/*
- * Class org_simgrid_msg_Process
- * Method waitFor
- * Signature (D)V
+ * Class org_simgrid_msg_Process
+ * Method waitFor
+ * Signature (D)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor
(JNIEnv *, jobject, jdouble);
/*
- * Class org_simgrid_msg_Process
- * Method kill
- * Signature (Lorg/simgrid/msg/Process;)V
+ * Class org_simgrid_msg_Process
+ * Method kill
+ * Signature (Lorg/simgrid/msg/Process;)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Process
- * Method migrate
- * Signature (Lorg/simgrid/msg/Host;)V
+ * Class org_simgrid_msg_Process
+ * Method migrate
+ * Signature (Lorg/simgrid/msg/Host;)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate
(JNIEnv *, jobject, jobject);
/*
- * Class org_simgrid_msg_Process
- * Method setKillTime
- * Signature (D)V
+ * Class org_simgrid_msg_Process
+ * Method setKillTime
+ * Signature (D)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime
(JNIEnv *, jobject, jdouble);
/* get the C string from the java string */
if (jname == NULL) {
- jxbt_throw_null(env,bprintf("No host can have a null name"));
- return NULL;
+ jxbt_throw_null(env,bprintf("No host can have a null name"));
+ return NULL;
}
const char *name = env->GetStringUTFChars(jname, 0);
storage = MSG_storage_get_by_name(name);
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject jname, jobject jvalue) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ msg_storage_t storage = jstorage_get_native(env, jstorage);
if (!storage) {
jxbt_throw_notbound(env, "storage", jstorage);
/**
* This function returns a new java storage instance.
*
- * @param env The environment of the current thread
+ * @param env The environment of the current thread
*
- * @return A new java storage object.
+ * @return A new java storage object.
*
- * @exception If the class Storage is not found the function throws
- * the ClassNotFoundException. If the constructor of
- * this class is not found the function throws the exception
- * NotSuchMethodException.
+ * @exception If the class Storage is not found the function throws
+ * the ClassNotFoundException. If the constructor of
+ * this class is not found the function throws the exception
+ * NotSuchMethodException.
*/
jobject jstorage_new_instance(JNIEnv * env);
/**
* This function associated a native storage to a java storage instance.
*
- * @param jstorage The java storage instance.
- * @param storage The native storage to bind.
- * @param env The environment of the current thread
+ * @param jstorage The java storage instance.
+ * @param storage The native storage to bind.
+ * @param env The environment of the current thread
*
- * @exception If the class Storage is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Storage is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
/**
* This function returns a native storage from a java storage instance.
*
- * @param jstorage The java storage object from which get the native storage.
- * @param env The environment of the current thread
+ * @param jstorage The java storage object from which get the native storage.
+ * @param env The environment of the current thread
*
- * @return The function returns the native storage associated to the
- * java storage object.
+ * @return The function returns the native storage associated to the
+ * java storage object.
*
- * @exception If the class Storage is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Storage is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage);
/**
- * Class org_simgrid_msg_Storage
- * Method nativeInit
- * Signature ()V
+ * Class org_simgrid_msg_Storage
+ * Method nativeInit
+ * Signature ()V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Storage_nativeInit(JNIEnv*, jclass);
* This function returns a global reference to the java storage instance
* specified by the parameter jstorage.
*
- * @param jstorage The original java storage instance.
- * @param env The environment of the current thread
+ * @param jstorage The original java storage instance.
+ * @param env The environment of the current thread
*
- * @return The global reference to the original java storage
- * instance.
+ * @return The global reference to the original java storage
+ * instance.
*/
jobject jstorage_ref(JNIEnv * env, jobject jstorage);
/**
* This function delete a global reference to a java storage instance.
*
- * @param The global reference to delete.
- * @param env The environment of the current thread
+ * @param The global reference to delete.
+ * @param env The environment of the current thread
*/
void jstorage_unref(JNIEnv * env, jobject jstorage);
/**
* This function returns the name of a MSG storage.
*
- * @param jstorage A java storage object.
- * @param env The environment of the current thread
+ * @param jstorage A java storage object.
+ * @param env The environment of the current thread
*
- * @return The name of the storage.
+ * @return The name of the storage.
*/
const char *jstorage_get_name(jobject jstorage, JNIEnv * env);
/*
- * Class org_simgrid_msg_Storage
- * Method getByName
- * Signature (Ljava/lang/String;)Lsimgrid/msg/Storage;
+ * Class org_simgrid_msg_Storage
+ * Method getByName
+ * Signature (Ljava/lang/String;)Lsimgrid/msg/Storage;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv *, jclass, jstring);
/*
- * Class org_simgrid_msg_Storage
- * Method getSize
- * Signature ()D
+ * Class org_simgrid_msg_Storage
+ * Method getSize
+ * Signature ()D
*/
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Storage
- * Method getFreeSize
- * Signature ()D
+ * Class org_simgrid_msg_Storage
+ * Method getFreeSize
+ * Signature ()D
*/
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Storage
- * Method getUsedSize
- * Signature ()D
+ * Class org_simgrid_msg_Storage
+ * Method getUsedSize
+ * Signature ()D
*/
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *, jobject);
process = MSG_task_get_sender(task);
if (process == NULL) {
- return NULL;
+ return NULL;
}
return (jobject) native_to_java_process(process);
}
host = MSG_task_get_source(task);
if (host == NULL) {
- return NULL;
+ return NULL;
}
if (!host->extension(JAVA_HOST_LEVEL)) {
jxbt_throw_jni(env, "MSG_task_get_source() failed");
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname) {
- msg_task_t task = jtask_to_native_task(jtask, env);
+ msg_task_t task = jtask_to_native_task(jtask, env);
- if (!task) {
- jxbt_throw_notbound(env, "task", jtask);
- return;
- }
- const char *name = env->GetStringUTFChars((jstring) jname, 0);
+ if (!task) {
+ jxbt_throw_notbound(env, "task", jtask);
+ return;
+ }
+ const char *name = env->GetStringUTFChars((jstring) jname, 0);
- env->SetObjectField(jtask, jtask_field_Task_name, jname);
- MSG_task_set_name(task, name);
+ env->SetObjectField(jtask, jtask_field_Task_name, jname);
+ MSG_task_set_name(task, name);
- env->ReleaseStringUTFChars((jstring) jname, name);
+ env->ReleaseStringUTFChars((jstring) jname, name);
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setPriority(JNIEnv * env,
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setFlopsAmount
- (JNIEnv *env, jobject jtask, jdouble computationAmount) {
- msg_task_t task = jtask_to_native_task(jtask, env);
+ (JNIEnv *env, jobject jtask, jdouble computationAmount) {
+ msg_task_t task = jtask_to_native_task(jtask, env);
- if (!task) {
+ if (!task) {
jxbt_throw_notbound(env, "task", jtask);
return;
- }
- MSG_task_set_flops_amount(task, (double) computationAmount);
+ }
+ MSG_task_set_flops_amount(task, (double) computationAmount);
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setBytesAmount
- (JNIEnv *env, jobject jtask, jdouble dataSize) {
- msg_task_t task = jtask_to_native_task(jtask, env);
+ (JNIEnv *env, jobject jtask, jdouble dataSize) {
+ msg_task_t task = jtask_to_native_task(jtask, env);
- if (!task) {
+ if (!task) {
jxbt_throw_notbound(env, "task", jtask);
return;
- }
+ }
env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize);
- MSG_task_set_bytes_amount(task, (double) dataSize);
+ MSG_task_set_bytes_amount(task, (double) dataSize);
}
JNIEXPORT void JNICALL
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox) {
- msg_comm_t comm;
- const char *mailbox;
- jclass comm_class;
- //pointer to store the task object pointer.
- msg_task_t *task = xbt_new(msg_task_t,1);
- *task = NULL;
- /* There should be a cache here */
- comm_class = env->FindClass("org/simgrid/msg/Comm");
+ msg_comm_t comm;
+ const char *mailbox;
+ jclass comm_class;
+ //pointer to store the task object pointer.
+ msg_task_t *task = xbt_new(msg_task_t,1);
+ *task = NULL;
+ /* There should be a cache here */
+ comm_class = env->FindClass("org/simgrid/msg/Comm");
- if (!comm_class) {
- jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
- return NULL;
- }
+ if (!comm_class) {
+ jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
+ return NULL;
+ }
- jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
- if (!jcomm) {
- jxbt_throw_native(env,bprintf("Can't create a Comm object."));
- return NULL;
- }
+ jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
+ if (!jcomm) {
+ jxbt_throw_native(env,bprintf("Can't create a Comm object."));
+ return NULL;
+ }
- mailbox = env->GetStringUTFChars(jmailbox, 0);
+ mailbox = env->GetStringUTFChars(jmailbox, 0);
- comm = MSG_task_irecv(task,mailbox);
+ comm = MSG_task_irecv(task,mailbox);
- env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
- env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
- env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
+ env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
+ env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
+ env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
- env->ReleaseStringUTFChars(jmailbox, mailbox);
+ env->ReleaseStringUTFChars(jmailbox, mailbox);
- return jcomm;
+ return jcomm;
}
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls,
- jstring jmailbox, jdouble rate) {
- msg_comm_t comm;
- const char *mailbox;
- jclass comm_class;
- //pointer to store the task object pointer.
- msg_task_t *task = xbt_new(msg_task_t,1);
- *task = NULL;
- /* There should be a cac hee */
- comm_class = env->FindClass("org/simgrid/msg/Comm");
+ jstring jmailbox, jdouble rate) {
+ msg_comm_t comm;
+ const char *mailbox;
+ jclass comm_class;
+ //pointer to store the task object pointer.
+ msg_task_t *task = xbt_new(msg_task_t,1);
+ *task = NULL;
+ /* There should be a cac hee */
+ comm_class = env->FindClass("org/simgrid/msg/Comm");
- if (!comm_class) {
- jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
- return NULL;
- }
+ if (!comm_class) {
+ jxbt_throw_native(env,bprintf("fieldID or methodID or class not found."));
+ return NULL;
+ }
- jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
- if (!jcomm) {
- jxbt_throw_native(env,bprintf("Can't create a Comm object."));
- return NULL;
- }
+ jobject jcomm = env->NewObject(comm_class, jtask_method_Comm_constructor);
+ if (!jcomm) {
+ jxbt_throw_native(env,bprintf("Can't create a Comm object."));
+ return NULL;
+ }
- mailbox = env->GetStringUTFChars(jmailbox, 0);
+ mailbox = env->GetStringUTFChars(jmailbox, 0);
- comm = MSG_task_irecv_bounded(task,mailbox, (double) rate);
+ comm = MSG_task_irecv_bounded(task,mailbox, (double) rate);
- env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
- env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
- env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
+ env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
+ env->SetLongField(jcomm, jtask_field_Comm_taskBind, (jlong) (uintptr_t)(task));
+ env->SetBooleanField(jcomm, jtask_field_Comm_receiving, JNI_TRUE);
- env->ReleaseStringUTFChars(jmailbox, mailbox);
+ env->ReleaseStringUTFChars(jmailbox, mailbox);
- return jcomm;
+ return jcomm;
}
JNIEXPORT jobject JNICALL
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask) {
- msg_task_t task = jtask_to_native_task(jtask, env);
+ msg_task_t task = jtask_to_native_task(jtask, env);
- if (!task) {
- jxbt_throw_notbound(env, "task", jtask);
- return;
- }
+ if (!task) {
+ jxbt_throw_notbound(env, "task", jtask);
+ return;
+ }
- MSG_task_destroy(task);
+ MSG_task_destroy(task);
}
static void msg_task_cancel_on_failed_dsend(void*t) {
/**
* This function associated a native task to a java task instance.
*
- * @param jtask The java task instance.
- * @param task The native task to bind.
- * @param env The environment of the current thread.
+ * @param jtask The java task instance.
+ * @param task The native task to bind.
+ * @param env The environment of the current thread.
*
- * @exception If the class Task is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Task is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
/**
* This function returns a native task from a java task instance.
*
- * @param jtask The java task object from which get the native task.
- * @param env The environment of the current thread.
+ * @param jtask The java task object from which get the native task.
+ * @param env The environment of the current thread.
*
- * @return The function returns the native task associated to the
- * java task object.
+ * @return The function returns the native task associated to the
+ * java task object.
*
- * @exception If the class Task is not found the function throws
- * the ClassNotFoundException. If the field bind of
- * this class is not found the function throws the exception
- * NotSuchFieldException.
+ * @exception If the class Task is not found the function throws
+ * the ClassNotFoundException. If the field bind of
+ * this class is not found the function throws the exception
+ * NotSuchFieldException.
*/
msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
* A java task object is valid if it is bind to a native
* task.
*
- * @param jtask The java task to test the validity.
- * @param env The environment of the current thread.
+ * @param jtask The java task to test the validity.
+ * @param env The environment of the current thread.
*
- * @return If the java task is valid the function returns true.
- * Otherwise the function returns false.
+ * @return If the java task is valid the function returns true.
+ * Otherwise the function returns false.
*/
jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
/*
- * Class org_simgrid_msg_Task
- * Method nativeInit
- * Signature ();
+ * Class org_simgrid_msg_Task
+ * Method nativeInit
+ * Signature ();
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls);
/*
- * Class org_simgrid_msg_Task
- * Method create
+ * Class org_simgrid_msg_Task
+ * Method create
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_create
- (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
+ (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_nativeFinalize(JNIEnv * env, jobject jtask);
/*
- * Class org_simgrid_msg_Task
- * Method parallelCreate
+ * Class org_simgrid_msg_Task
+ * Method parallelCreate
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_parallelCreate
- (JNIEnv *, jobject,
+ (JNIEnv *, jobject,
jstring, jobjectArray,
jdoubleArray,
jdoubleArray);
/*
- * Class org_simgrid_msg_Task
- * Method destroy
- * Signature (Lsimgrid/msg/Task;)V
+ * Class org_simgrid_msg_Task
+ * Method destroy
+ * Signature (Lsimgrid/msg/Task;)V
*/
/* JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy */
/* (JNIEnv *, jobject); */
/*
- * Class org_simgrid_msg_Task
- * Method cancel
- * Signature ()V
+ * Class org_simgrid_msg_Task
+ * Method cancel
+ * Signature ()V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Task
- * Method execute
- * Signature ()V
+ * Class org_simgrid_msg_Task
+ * Method execute
+ * Signature ()V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Task
- * Method setBound
- * Signature ()V
+ * Class org_simgrid_msg_Task
+ * Method setBound
+ * Signature ()V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound
(JNIEnv *, jobject, jdouble);
/*
- * Class org_simgrid_msg_Task
- * Method getName
- * Signature ()Ljava/lang/String;
+ * Class org_simgrid_msg_Task
+ * Method getName
+ * Signature ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Task
- * Method getSender
- * Signature ()Lsimgrid/msg/Process;
+ * Class org_simgrid_msg_Task
+ * Method getSender
+ * Signature ()Lsimgrid/msg/Process;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Task
- * Method getSource
- * Signature ()Lsimgrid/msg/Host;
+ * Class org_simgrid_msg_Task
+ * Method getSource
+ * Signature ()Lsimgrid/msg/Host;
*/
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource
(JNIEnv *, jobject);
/*
- * Class org_simgrid_msg_Task
- * Method getFlopsAmount
- * Signature ()D
+ * Class org_simgrid_msg_Task
+ * Method getFlopsAmount
+ * Signature ()D
*/
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getFlopsAmount
(JNIEnv *, jobject);
/**
- * Class org_simgrid_msg_Task
- * Method setName
- * Signature (Ljava/lang/string;)V
+ * Class org_simgrid_msg_Task
+ * Method setName
+ * Signature (Ljava/lang/string;)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname);
/*
- * Class org_simgrid_msg_Task
- * Method setPriority
- * Signature (D)V
+ * Class org_simgrid_msg_Task
+ * Method setPriority
+ * Signature (D)V
*/
JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
(JNIEnv *, jobject, jdouble);
/**
- * Class org_simgrid_msg_Task
- * Method setComputeDuration
- * Signature (D)V
+ * Class org_simgrid_msg_Task
+ * Method setComputeDuration
+ * Signature (D)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setFlopsAmount
- (JNIEnv *env, jobject jtask, jdouble computationAmount);
-
- /**
- * Class org_simgrid_msg_Task
- * Method setDataSize
- * Signature (D)V
+ (JNIEnv *env, jobject jtask, jdouble computationAmount);
+
+ /**
+ * Class org_simgrid_msg_Task
+ * Method setDataSize
+ * Signature (D)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setBytesAmount
- (JNIEnv *env, jobject jtask, jdouble dataSize);
-
+ (JNIEnv *env, jobject jtask, jdouble dataSize);
+
/**
- * Class org_simgrid_msg_Task
- * Method send
+ * Class org_simgrid_msg_Task
+ * Method send
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_send
(JNIEnv *, jobject, jstring, jdouble);
/**
- * Class org_simgrid_msg_Task
- * Method sendBounded
+ * Class org_simgrid_msg_Task
+ * Method sendBounded
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_sendBounded
/**
- * Class org_simgrid_msg_Task
- * Method receive
+ * Class org_simgrid_msg_Task
+ * Method receive
*/
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_receive
(JNIEnv *, jclass, jstring, jdouble, jobject);
/**
- * Class org_simgrid_msg_Task
- * Method irecv
- * Signature (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
+ * Class org_simgrid_msg_Task
+ * Method irecv
+ * Signature (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
*/
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox);
/**
- * Class org_simgrid_msg_Task
- * Method receiveBounded
+ * Class org_simgrid_msg_Task
+ * Method receiveBounded
*/
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls,
jstring jalias, jdouble jtimeout,
jobject jhost, jdouble rate);
/**
- * Class org_simgrid_msg_Task
- * Method irecvBounded
+ * Class org_simgrid_msg_Task
+ * Method irecvBounded
*/
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls,
jstring jmailbox, jdouble rate);
/**
- * Class org_simgrid_msg_Task
- * Method isend
- * Signature (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
+ * Class org_simgrid_msg_Task
+ * Method isend
+ * Signature (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
*/
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox);
/**
- * Class org_simgrid_msg_Task
- * Method isendBounded
+ * Class org_simgrid_msg_Task
+ * Method isendBounded
*/
JNIEXPORT jobject JNICALL
Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox, jdouble maxrate);
/**
- * Class org_simgrid_msg_Task
- * Method dsend
+ * Class org_simgrid_msg_Task
+ * Method dsend
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask,
jstring jalias);
/**
- * Class org_simgrid_msg_Task
- * Method dsendBounded
+ * Class org_simgrid_msg_Task
+ * Method dsendBounded
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask,
jstring jalias, jdouble maxrate);
/**
- * Class org_simgrid_msg_Task
- * Method listen
+ * Class org_simgrid_msg_Task
+ * Method listen
*/
JNIEXPORT jboolean JNICALL
Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring);
/**
- * Class org_simgrid_msg_Task
- * Method listenFromHost
+ * Class org_simgrid_msg_Task
+ * Method listenFromHost
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring,
jobject);
/**
- * Class org_simgrid_msg_Task
- * Method listenFrom
+ * Class org_simgrid_msg_Task
+ * Method listenFrom
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring);
Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass cls) {
jclass jprocess_class_VM = env->FindClass("org/simgrid/msg/VM");
jvm_field_bind = jxbt_get_jfield(env, jprocess_class_VM, "bind", "J");
- if (!jvm_field_bind ) {
+ if (!jvm_field_bind ) {
jxbt_throw_native(env,bprintf("Can't find some fields in Java class. You should report this bug."));
}
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load) {
- msg_vm_t vm = jvm_get_native(env,jvm);
- double bound = MSG_get_host_speed(vm) * load / 100;
- MSG_vm_set_bound(vm, bound);
+ msg_vm_t vm = jvm_get_native(env,jvm);
+ double bound = MSG_get_host_speed(vm) * load / 100;
+ MSG_vm_set_bound(vm, bound);
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
- jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) {
+ jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint jmig_netspeed, jint jdp_intensity) {
msg_host_t host = jhost_get_native(env, jhost);
// disk_path = xbt_strdup(disk_path);
msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize,
- (int) jnetcap, NULL, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity);
+ (int) jnetcap, NULL, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity);
jvm_bind(env,jvm,vm);
}
msg_vm_t jvm_get_native(JNIEnv *env, jobject jvm);
/*
- * Class org_simgrid_msg_VM
- * Method nativeInit
- * Signature ()V
+ * Class org_simgrid_msg_VM
+ * Method nativeInit
+ * Signature ()V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_nativeInit(JNIEnv *env, jclass);
/**
- * Class org_simgrid_msg_VM
- * Method isCreated
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isCreated
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isCreated(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isRunning
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isRunning
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isRunning(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isMigrating
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isMigrating
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isMigrating(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isSuspended
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isSuspended
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isSuspended(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isResuming
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isResuming
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isResuming(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isSuspended
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isSuspended
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isSaving(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isSave
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isSave
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isSaved(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method isResuming
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method isResuming
+ * Signature ()B
*/
JNIEXPORT jint JNICALL
Java_org_simgrid_msg_VM_isRestoring(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method setBound
- * Signature ()B
+ * Class org_simgrid_msg_VM
+ * Method setBound
+ * Signature ()B
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_setBound(JNIEnv *env, jobject jvm, jint load);
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, jobject jhost, jstring jname,
- jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint dprate, jint mig_netspeed);
+ jint jncore, jint jramsize, jint jnetcap, jstring jdiskpath, jint jdisksize, jint dprate, jint mig_netspeed);
/**
* Class org_simgrid_msg_VM
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method start
- * Signature (I)V
+ * Class org_simgrid_msg_VM
+ * Method start
+ * Signature (I)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_start(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method nativeMigrate
- * Signature (Lorg/simgrid/msg/Host;)V
+ * Class org_simgrid_msg_VM
+ * Method nativeMigrate
+ * Signature (Lorg/simgrid/msg/Host;)V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject jvm, jobject jhost);
/**
- * Class org_simgrid_msg_VM
- * Method suspend
- * Signature ()V
+ * Class org_simgrid_msg_VM
+ * Method suspend
+ * Signature ()V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_suspend(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method resume
- * Signature ()V
+ * Class org_simgrid_msg_VM
+ * Method resume
+ * Signature ()V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_resume(JNIEnv *env, jobject jvm);
/**
- * Class org_simgrid_msg_VM
- * Method shutdown
- * Signature ()V
+ * Class org_simgrid_msg_VM
+ * Method shutdown
+ * Signature ()V
*/
JNIEXPORT void JNICALL
Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm);
SG_BEGIN_DECL()
-/********************************** Configuration of MC **************************************/
+/********************************** Configuration of MC **************************************/
extern XBT_PUBLIC(int) _sg_do_model_check;
extern XBT_PRIVATE int _sg_do_model_check_record;
*/
XBT_PUBLIC(int) lmm_constraint_concurrency_maximum_get(lmm_constraint_t cnst);
-
+
/**
* @brief Create a new Linear MaxMin variable
*
*/
XBT_PUBLIC(const char * ) surf_resource_name(surf_cpp_resource_t resource);
static inline const char * surf_cpu_name(surf_cpu_t cpu) {
- return surf_resource_name((surf_cpp_resource_t)cpu);
+ return surf_resource_name((surf_cpp_resource_t)cpu);
}
/** @brief Get the available speed of cpu associated to a host */
char *instr_vm_id (msg_vm_t vm, char *str, int len)
{
- return instr_vm_id_2 (MSG_vm_get_name(vm), str, len);
+ return instr_vm_id_2 (MSG_vm_get_name(vm), str, len);
}
char *instr_vm_id_2 (const char *vm_name, char *str, int len)
{
if (priv == NULL)
- return;
+ return;
unsigned int size = xbt_dict_size(priv->dp_objs);
if (size > 0)
XBT_WARN("dp_objs: %u pending task?", size);
* \return Returns the processor speed associated with pstate_index
*/
double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) {
- xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return host->power_peak_at(pstate_index);
+ xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+ return host->power_peak_at(pstate_index);
}
/** \ingroup m_host_management
* \return Returns the current processor speed
*/
double MSG_host_get_current_power_peak(msg_host_t host) {
- xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return host->current_power_peak();
+ xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
+ return host->current_power_peak();
}
/** \ingroup m_host_management
* \param host host to test
*/
int MSG_host_get_nb_pstates(msg_host_t host) {
- return sg_host_get_nb_pstates(host);
+ return sg_host_get_nb_pstates(host);
}
/** \ingroup m_host_management
xbt_dynar_t res = xbt_dynar_new(sizeof(msg_storage_t),NULL);
xbt_lib_foreach(storage_lib, cursor, key, data) {
- if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) {
+ if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), MSG_STORAGE_LEVEL) != NULL) {
xbt_dictelm_t elm = xbt_dict_cursor_get_elm(cursor);
xbt_dynar_push(res, &elm);
}
*/
double MSG_task_get_flops_amount(msg_task_t task) {
- if (task->simdata->compute) {
- return simcall_execution_get_remains(task->simdata->compute);
- } else {
- return task->simdata->flops_amount;
- }
+ if (task->simdata->compute) {
+ return simcall_execution_get_remains(task->simdata->compute);
+ } else {
+ return task->simdata->flops_amount;
+ }
}
/* C main function of a actor, running this->main */
static int s4u_actor_runner(int argc, char **argv) {
- smx_process_t smx_proc = SIMIX_process_self();
- simgrid::s4u::Actor *actor = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
- int res = actor->main(argc,argv);
- return res;
+ smx_process_t smx_proc = SIMIX_process_self();
+ simgrid::s4u::Actor *actor = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
+ int res = actor->main(argc,argv);
+ return res;
}
using namespace simgrid;
s4u::Actor::Actor(smx_process_t smx_proc) {
- p_smx_process = smx_proc;
+ p_smx_process = smx_proc;
}
s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv)
: s4u::Actor::Actor(name,host, argc,argv, -1) {
}
s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv, double killTime) {
- p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
+ p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
- xbt_assert(p_smx_process,"Cannot create the actor");
-// TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
-// simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process);
+ xbt_assert(p_smx_process,"Cannot create the actor");
+// TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
+// simcall_process_on_exit(p_smx_process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,p_smx_process);
}
int s4u::Actor::main(int argc, char **argv) {
- fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName());
- return 0;
+ fprintf(stderr,"Error: You should override the method main(int, char**) in Actor class %s\n",getName());
+ return 0;
}
s4u::Actor *s4u::Actor::current() {
- smx_process_t smx_proc = SIMIX_process_self();
- simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
- if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object
- res = new Actor(smx_proc);
- return res;
+ smx_process_t smx_proc = SIMIX_process_self();
+ simgrid::s4u::Actor* res = (simgrid::s4u::Actor*) SIMIX_process_self_get_data(smx_proc);
+ if (res == NULL) // The smx_process was not created by S4U (but by deployment?). Embed it in a S4U object
+ res = new Actor(smx_proc);
+ return res;
}
s4u::Actor *s4u::Actor::byPid(int pid) {
- return (simgrid::s4u::Actor*) SIMIX_process_self_get_data(SIMIX_process_from_PID(pid));
+ return (simgrid::s4u::Actor*) SIMIX_process_self_get_data(SIMIX_process_from_PID(pid));
}
void s4u::Actor::setAutoRestart(bool autorestart) {
- simcall_process_auto_restart_set(p_smx_process,autorestart);
+ simcall_process_auto_restart_set(p_smx_process,autorestart);
}
s4u::Host *s4u::Actor::getHost() {
- return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process)));
+ return s4u::Host::by_name(sg_host_get_name(simcall_process_get_host(p_smx_process)));
}
const char* s4u::Actor::getName() {
- return simcall_process_get_name(p_smx_process);
+ return simcall_process_get_name(p_smx_process);
}
int s4u::Actor::getPid(){
- return simcall_process_get_PID(p_smx_process);
+ return simcall_process_get_PID(p_smx_process);
}
void s4u::Actor::setKillTime(double time) {
- simcall_process_set_kill_time(p_smx_process,time);
+ simcall_process_set_kill_time(p_smx_process,time);
}
double s4u::Actor::getKillTime() {
- return simcall_process_get_kill_time(p_smx_process);
+ return simcall_process_get_kill_time(p_smx_process);
}
void s4u::Actor::killAll() {
- simcall_process_killall(1);
+ simcall_process_killall(1);
}
void s4u::Actor::kill() {
- simcall_process_kill(p_smx_process);
+ simcall_process_kill(p_smx_process);
}
void s4u::Actor::sleep(double duration) {
- simcall_process_sleep(duration);
+ simcall_process_sleep(duration);
}
e_smx_state_t s4u::Actor::execute(double flops) {
- smx_synchro_t s = simcall_execution_start(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
- return simcall_execution_wait(s);
+ smx_synchro_t s = simcall_execution_start(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
+ return simcall_execution_wait(s);
}
void *s4u::Actor::recv(Mailbox &chan) {
- void *res=NULL;
+ void *res=NULL;
- Comm c = Comm::recv_init(this, chan);
- c.setDstData(&res,sizeof(res));
- c.wait();
+ Comm c = Comm::recv_init(this, chan);
+ c.setDstData(&res,sizeof(res));
+ c.wait();
return res;
}
void s4u::Actor::send(Mailbox &chan, void *payload, size_t simulatedSize) {
- Comm c = Comm::send_init(this,chan);
- c.setRemains(simulatedSize);
- c.setSrcData(payload);
- // c.start() is optional.
- c.wait();
+ Comm c = Comm::send_init(this,chan);
+ c.setRemains(simulatedSize);
+ c.setSrcData(payload);
+ // c.start() is optional.
+ c.wait();
}
}
void s4u::Async::setRemains(double remains) {
- xbt_assert(p_state == inited, "Cannot change the remaining amount of work once the Async is started");
- p_remains = remains;
+ xbt_assert(p_state == inited, "Cannot change the remaining amount of work once the Async is started");
+ p_remains = remains;
}
}
s4u::Comm &s4u::Comm::send_init(s4u::Actor *sender, s4u::Mailbox &chan) {
- s4u::Comm *res = new s4u::Comm();
- res->p_sender = sender;
- res->p_mailbox = &chan;
+ s4u::Comm *res = new s4u::Comm();
+ res->p_sender = sender;
+ res->p_mailbox = &chan;
- return *res;
+ return *res;
}
s4u::Comm &s4u::Comm::recv_init(s4u::Actor *receiver, s4u::Mailbox &chan) {
- s4u::Comm *res = new s4u::Comm();
- res->p_receiver = receiver;
- res->p_mailbox = &chan;
+ s4u::Comm *res = new s4u::Comm();
+ res->p_receiver = receiver;
+ res->p_mailbox = &chan;
- return *res;
+ return *res;
}
void s4u::Comm::setRate(double rate) {
- xbt_assert(p_state==inited);
- p_rate = rate;
+ xbt_assert(p_state==inited);
+ p_rate = rate;
}
void s4u::Comm::setSrcData(void * buff) {
- xbt_assert(p_state==inited);
- xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_srcBuff = buff;
+ xbt_assert(p_state==inited);
+ xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
+ p_srcBuff = buff;
}
void s4u::Comm::setSrcDataSize(size_t size){
- xbt_assert(p_state==inited);
- p_srcBuffSize = size;
+ xbt_assert(p_state==inited);
+ p_srcBuffSize = size;
}
void s4u::Comm::setSrcData(void * buff, size_t size) {
- xbt_assert(p_state==inited);
+ xbt_assert(p_state==inited);
- xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_srcBuff = buff;
- p_srcBuffSize = size;
+ xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
+ p_srcBuff = buff;
+ p_srcBuffSize = size;
}
void s4u::Comm::setDstData(void ** buff) {
- xbt_assert(p_state==inited);
- xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_dstBuff = buff;
+ xbt_assert(p_state==inited);
+ xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
+ p_dstBuff = buff;
}
size_t s4u::Comm::getDstDataSize(){
- xbt_assert(p_state==finished);
- return p_dstBuffSize;
+ xbt_assert(p_state==finished);
+ return p_dstBuffSize;
}
void s4u::Comm::setDstData(void ** buff, size_t size) {
- xbt_assert(p_state==inited);
+ xbt_assert(p_state==inited);
- xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_dstBuff = buff;
- p_dstBuffSize = size;
+ xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
+ p_dstBuff = buff;
+ p_dstBuffSize = size;
}
void s4u::Comm::start() {
- xbt_assert(p_state == inited);
-
- if (p_srcBuff != NULL) { // Sender side
- p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
- p_srcBuff, p_srcBuffSize,
- p_matchFunction, p_cleanFunction, p_copyDataFunction,
- p_userData, p_detached);
- } else if (p_dstBuff != NULL) { // Receiver side
- p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, p_rate);
-
- } else {
- xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
- }
- p_state = started;
+ xbt_assert(p_state == inited);
+
+ if (p_srcBuff != NULL) { // Sender side
+ p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
+ p_srcBuff, p_srcBuffSize,
+ p_matchFunction, p_cleanFunction, p_copyDataFunction,
+ p_userData, p_detached);
+ } else if (p_dstBuff != NULL) { // Receiver side
+ p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
+ p_matchFunction, p_copyDataFunction,
+ p_userData, p_rate);
+
+ } else {
+ xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
+ }
+ p_state = started;
}
void s4u::Comm::wait() {
- xbt_assert(p_state == started || p_state == inited);
-
- if (p_state == started)
- simcall_comm_wait(p_inferior, -1/*timeout*/);
- else {// p_state == inited. Save a simcall and do directly a blocking send/recv
- if (p_srcBuff != NULL) {
- simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
- p_srcBuff, p_srcBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, -1 /*timeout*/);
- } else {
- simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, -1/*timeout*/, p_rate);
- }
- }
- p_state = finished;
+ xbt_assert(p_state == started || p_state == inited);
+
+ if (p_state == started)
+ simcall_comm_wait(p_inferior, -1/*timeout*/);
+ else {// p_state == inited. Save a simcall and do directly a blocking send/recv
+ if (p_srcBuff != NULL) {
+ simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
+ p_srcBuff, p_srcBuffSize,
+ p_matchFunction, p_copyDataFunction,
+ p_userData, -1 /*timeout*/);
+ } else {
+ simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
+ p_matchFunction, p_copyDataFunction,
+ p_userData, -1/*timeout*/, p_rate);
+ }
+ }
+ p_state = finished;
}
void s4u::Comm::wait(double timeout) {
- xbt_assert(p_state == started || p_state == inited);
-
- if (p_state == started) {
- simcall_comm_wait(p_inferior, timeout);
- p_state = finished;
- return;
- }
-
- // It's not started yet. Do it in one simcall
- if (p_srcBuff != NULL) {
- simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
- p_srcBuff, p_srcBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, timeout);
- } else { // Receiver
- simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, timeout, p_rate);
- }
- p_state = finished;
+ xbt_assert(p_state == started || p_state == inited);
+
+ if (p_state == started) {
+ simcall_comm_wait(p_inferior, timeout);
+ p_state = finished;
+ return;
+ }
+
+ // It's not started yet. Do it in one simcall
+ if (p_srcBuff != NULL) {
+ simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
+ p_srcBuff, p_srcBuffSize,
+ p_matchFunction, p_copyDataFunction,
+ p_userData, timeout);
+ } else { // Receiver
+ simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
+ p_matchFunction, p_copyDataFunction,
+ p_userData, timeout, p_rate);
+ }
+ p_state = finished;
}
s4u::Comm &s4u::Comm::send_async(s4u::Actor *sender, Mailbox &dest, void *data, int simulatedSize) {
- s4u::Comm &res = s4u::Comm::send_init(sender, dest);
+ s4u::Comm &res = s4u::Comm::send_init(sender, dest);
- res.setRemains(simulatedSize);
- res.p_srcBuff = data;
- res.p_srcBuffSize = sizeof(void*);
+ res.setRemains(simulatedSize);
+ res.p_srcBuff = data;
+ res.p_srcBuffSize = sizeof(void*);
- res.start();
- return res;
+ res.start();
+ return res;
}
s4u::Comm &s4u::Comm::recv_async(s4u::Actor *receiver, Mailbox &dest, void **data) {
- s4u::Comm &res = s4u::Comm::recv_init(receiver, dest);
+ s4u::Comm &res = s4u::Comm::recv_init(receiver, dest);
- res.setDstData(data);
+ res.setDstData(data);
- res.start();
- return res;
+ res.start();
+ return res;
}
using namespace simgrid;
double s4u::Engine::getClock() {
- return SIMIX_get_clock();
+ return SIMIX_get_clock();
}
s4u::Engine::Engine(int *argc, char **argv) {
- SIMIX_global_init(argc, argv);
+ SIMIX_global_init(argc, argv);
}
void s4u::Engine::loadPlatform(const char *platf) {
- SIMIX_create_environment(platf);
+ SIMIX_create_environment(platf);
}
void s4u::Engine::register_function(const char*name, int (*code)(int,char**)) {
- SIMIX_function_register(name,code);
+ SIMIX_function_register(name,code);
}
void s4u::Engine::register_default(int (*code)(int,char**)) {
- SIMIX_function_register_default(code);
+ SIMIX_function_register_default(code);
}
void s4u::Engine::loadDeployment(const char *deploy) {
- SIMIX_launch_application(deploy);
+ SIMIX_launch_application(deploy);
}
void s4u::Engine::run() {
- if (MC_is_active()) {
- MC_run();
- } else {
- SIMIX_run();
- }
+ if (MC_is_active()) {
+ MC_run();
+ } else {
+ SIMIX_run();
+ }
}
namespace s4u {
File::File(const char*fullpath, void *userdata) {
- // this cannot fail because we get a xbt_die if the mountpoint does not exist
- p_inferior = simcall_file_open(fullpath, Host::current());
- p_path = fullpath;
+ // this cannot fail because we get a xbt_die if the mountpoint does not exist
+ p_inferior = simcall_file_open(fullpath, Host::current());
+ p_path = fullpath;
}
File::~File() {
- simcall_file_close(p_inferior, Host::current());
+ simcall_file_close(p_inferior, Host::current());
}
sg_size_t File::read(sg_size_t size) {
- return simcall_file_read(p_inferior, size, Host::current());
+ return simcall_file_read(p_inferior, size, Host::current());
}
sg_size_t File::write(sg_size_t size) {
- return simcall_file_write(p_inferior,size, Host::current());
+ return simcall_file_write(p_inferior,size, Host::current());
}
sg_size_t File::size() {
- return simcall_file_get_size(p_inferior);
+ return simcall_file_get_size(p_inferior);
}
void File::seek(sg_size_t pos) {
- simcall_file_seek(p_inferior,pos,SEEK_SET);
+ simcall_file_seek(p_inferior,pos,SEEK_SET);
}
sg_size_t File::tell() {
- return simcall_file_tell(p_inferior);
+ return simcall_file_tell(p_inferior);
}
void File::move(const char*fullpath) {
- simcall_file_move(p_inferior,fullpath);
+ simcall_file_move(p_inferior,fullpath);
}
void File::unlink() {
- sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
- simcall_file_unlink(p_inferior,attached);
+ sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
+ simcall_file_unlink(p_inferior,attached);
}
}} // namespace simgrid::s4u
}
Host::~Host() {
- delete pimpl_cpu;
- delete mounts;
+ delete pimpl_cpu;
+ delete mounts;
}
Host *Host::by_name(std::string name) {
- Host* host = Host::by_name_or_null(name.c_str());
- // TODO, raise an exception instead?
- if (host == nullptr)
- xbt_die("No such host: %s", name.c_str());
- return host;
+ Host* host = Host::by_name_or_null(name.c_str());
+ // TODO, raise an exception instead?
+ if (host == nullptr)
+ xbt_die("No such host: %s", name.c_str());
+ return host;
}
Host* Host::by_name_or_null(const char* name)
{
}
Host *Host::current(){
- smx_process_t smx_proc = SIMIX_process_self();
- if (smx_proc == NULL)
- xbt_die("Cannot call Host::current() from the maestro context");
- return SIMIX_process_get_host(smx_proc);
+ smx_process_t smx_proc = SIMIX_process_self();
+ if (smx_proc == NULL)
+ xbt_die("Cannot call Host::current() from the maestro context");
+ return SIMIX_process_get_host(smx_proc);
}
void Host::turn_on() {
- simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
+ simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
}
void Host::turn_off() {
}
bool Host::is_on() {
- return this->pimpl_cpu->isOn();
+ return this->pimpl_cpu->isOn();
}
int Host::pstates_count() const {
- return this->pimpl_cpu->getNbPStates();
+ return this->pimpl_cpu->getNbPStates();
}
boost::unordered_map<std::string, Storage*> const& Host::mounted_storages() {
- if (mounts == NULL) {
- mounts = new boost::unordered_map<std::string, Storage*> ();
-
- xbt_dict_t dict = this->mounted_storages_as_dict();
-
- xbt_dict_cursor_t cursor;
- char *mountname;
- char *storagename;
- xbt_dict_foreach(dict, cursor, mountname, storagename) {
- mounts->insert({mountname, &Storage::byName(storagename)});
- }
- xbt_dict_free(&dict);
- }
+ if (mounts == NULL) {
+ mounts = new boost::unordered_map<std::string, Storage*> ();
+
+ xbt_dict_t dict = this->mounted_storages_as_dict();
+
+ xbt_dict_cursor_t cursor;
+ char *mountname;
+ char *storagename;
+ xbt_dict_foreach(dict, cursor, mountname, storagename) {
+ mounts->insert({mountname, &Storage::byName(storagename)});
+ }
+ xbt_dict_free(&dict);
+ }
- return *mounts;
+ return *mounts;
}
/** Get the properties assigned to a host */
xbt_dict_t Host::properties() {
return simgrid::simix::kernel([&] {
- simgrid::surf::Host* surf_host = this->extension<simgrid::surf::Host>();
- return surf_host->getProperties();
- });
+ simgrid::surf::Host* surf_host = this->extension<simgrid::surf::Host>();
+ return surf_host->getProperties();
+ });
}
/** Get the processes attached to the host */
/** @brief Get the speed of the cpu associated to a host */
double Host::speed() {
- return pimpl_cpu->getSpeed(1.0);
+ return pimpl_cpu->getSpeed(1.0);
}
/** @brief Returns the number of core of the processor. */
int Host::core_count() {
- return pimpl_cpu->getCore();
+ return pimpl_cpu->getCore();
}
/** @brief Set the pstate at which the host should run */
s4u::Mailbox::Mailbox(const char*name, smx_rdv_t inferior) {
- p_inferior = inferior;
- p_name = name;
- mailboxes->insert({name, this});
+ p_inferior = inferior;
+ p_name = name;
+ mailboxes->insert({name, this});
}
const char *s4u::Mailbox::getName() {
- return p_name.c_str();
+ return p_name.c_str();
}
s4u::Mailbox *s4u::Mailbox::byName(const char*name) {
- s4u::Mailbox *res;
- try {
- res = mailboxes->at(name);
- } catch (std::out_of_range& e) {
- // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox
- // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv.
- // Only one simix object will be created, but two S4U objects will be created.
- // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked.
- new Mailbox(name,simcall_rdv_create(name));
- res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself.
- }
- return res;
+ s4u::Mailbox *res;
+ try {
+ res = mailboxes->at(name);
+ } catch (std::out_of_range& e) {
+ // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox
+ // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv.
+ // Only one simix object will be created, but two S4U objects will be created.
+ // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked.
+ new Mailbox(name,simcall_rdv_create(name));
+ res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself.
+ }
+ return res;
}
boost::unordered_map <std::string, Storage *> *Storage::storages = new boost::unordered_map<std::string, Storage*> ();
Storage::Storage(std::string name, smx_storage_t inferior) {
- p_name = name;
- p_inferior = inferior;
+ p_name = name;
+ p_inferior = inferior;
- storages->insert({name, this});
+ storages->insert({name, this});
}
Storage::~Storage() {
- // TODO Auto-generated destructor stub
+ // TODO Auto-generated destructor stub
}
smx_storage_t Storage::inferior() {
- return p_inferior;
+ return p_inferior;
}
Storage &Storage::byName(const char*name) {
- s4u::Storage *res = NULL;
- try {
- res = storages->at(name);
- } catch (std::out_of_range& e) {
- smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name);
- if (inferior == NULL)
- xbt_die("Storage %s does not exist. Please only use the storages that are defined in your platform.", name);
+ s4u::Storage *res = NULL;
+ try {
+ res = storages->at(name);
+ } catch (std::out_of_range& e) {
+ smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name);
+ if (inferior == NULL)
+ xbt_die("Storage %s does not exist. Please only use the storages that are defined in your platform.", name);
- res = new Storage(name,inferior);
- }
- return *res;
+ res = new Storage(name,inferior);
+ }
+ return *res;
}
const char*Storage::name() {
- return p_name.c_str();
+ return p_name.c_str();
}
sg_size_t Storage::size_free() {
- return simcall_storage_get_free_size(p_inferior);
+ return simcall_storage_get_free_size(p_inferior);
}
sg_size_t Storage::size_used() {
- return simcall_storage_get_used_size(p_inferior);
+ return simcall_storage_get_used_size(p_inferior);
}
sg_size_t Storage::size() {
- return SIMIX_storage_get_size(p_inferior);
+ return SIMIX_storage_get_size(p_inferior);
}
} /* namespace s4u */
/* 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.
- */
- yy_size_t 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.
+ */
+ yy_size_t 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 yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t 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;
}
assert(s && e && s <= e);
++s;
while (s < e) {
- if (isspace(*s)) {
- BUFFERPUTC(' ');
- do ++s; while (s < e && isspace(*s));
- } else
- BUFFERPUTC(*s++);
+ if (isspace(*s)) {
+ BUFFERPUTC(' ');
+ do ++s; while (s < e && isspace(*s));
+ } else
+ BUFFERPUTC(*s++);
}
} else {
const char *s = text;
while (*s)
- BUFFERPUTC(*s++);
+ BUFFERPUTC(*s++);
}
BUFFERDONE;
}
/* 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
{
- yy_state_type yy_current_state;
- char *yy_cp, *yy_bp;
- int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
- 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( );
+ }
- {
+ {
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG);
/* COMMENTS and PIs: handled uniformly for efficiency. */
- 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
- {
- 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
+ {
+ 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] )
- {
- yy_size_t 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] )
+ {
+ yy_size_t 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(E_dax__adag):
case YY_STATE_EOF(S_dax__adag):
case YY_STATE_EOF(S_dax__adag_5):
case YY_STATE_EOF(S_dax__adag_3):
case YY_STATE_EOF(S_dax__adag_1):
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_2: case S_dax__job_1: case S_dax__job: 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_2: case S_dax__job_1: case S_dax__job: 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_4: case S_dax__adag: case S_dax__adag_1: case S_dax__adag_3: case S_dax__adag_5: 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_4: case S_dax__adag: case S_dax__adag_1: case S_dax__adag_3: case S_dax__adag_5: 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):
case YY_STATE_EOF(S_dax__child_2):
case YY_STATE_EOF(E_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: case S_dax__child_2: 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: case S_dax__child_2: 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 */
- } /* end of user's declarations */
+ 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 user's declarations */
} /* 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)
{
- char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- char *source = (yytext_ptr);
- 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
- {
- yy_size_t 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_LVALUE;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- yy_size_t 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), 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];
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ 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
+ {
+ yy_size_t 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_LVALUE;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ yy_size_t 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), 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];
- return ret_val;
+ 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)
{
- yy_state_type yy_current_state;
- char *yy_cp;
-
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- 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_state_type yy_current_state;
+ char *yy_cp;
+
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ 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 )
{
- int yy_is_jam;
- char *yy_cp = (yy_c_buf_p);
-
- 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;
+ int yy_is_jam;
+ char *yy_cp = (yy_c_buf_p);
+
+ 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;
-
- *(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 */
- yy_size_t 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;
+ 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 */
+ yy_size_t 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 );
}
/* Initializes or reinitializes a buffer.
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)
{
- yy_size_t num_to_alloc;
+ yy_size_t 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;
+ 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_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;
+ 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 );
+ dax__switch_to_buffer(b );
- return 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, yy_size_t _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- yy_size_t i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ yy_size_t 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 )
{
- int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ 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 )
{
- int n;
- for ( n = 0; s[n]; ++n )
- ;
+ 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);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd, "Parsing DAX files");
extern "C" {
- #undef CLEANUP
- #include "dax_dtd.h"
- #include "dax_dtd.c"
+ #undef CLEANUP
+ #include "dax_dtd.h"
+ #include "dax_dtd.c"
}
bool children_are_marked(SD_task_t task);
const char *sg_host_get_name(sg_host_t host)
{
- return host->name().c_str();
+ return host->name().c_str();
}
void* sg_host_extension_get(sg_host_t host, size_t ext)
});
ROUTING_HOST_LEVEL = simgrid::s4u::Host::extension_create([](void *p) {
- delete static_cast<simgrid::surf::NetCard*>(p);
+ delete static_cast<simgrid::surf::NetCard*>(p);
});
SD_HOST_LEVEL = simgrid::s4u::Host::extension_create(NULL);
// ========== MSG Layer ==============
msg_host_priv_t sg_host_msg(sg_host_t host) {
- return (msg_host_priv_t) host->extension(MSG_HOST_LEVEL);
+ return (msg_host_priv_t) host->extension(MSG_HOST_LEVEL);
}
void sg_host_msg_set(sg_host_t host, msg_host_priv_t smx_host) {
host->extension_set(MSG_HOST_LEVEL, smx_host);
* \brief Get the kill time of a process (or 0 if unset).
*/
double simcall_process_get_kill_time(smx_process_t process) {
- return SIMIX_timer_get_date(process->kill_timer);
+ return SIMIX_timer_get_date(process->kill_timer);
}
/**
smx_cleaned = 1;
XBT_DEBUG("SIMIX_clean called. Simulation's over.");
if (!xbt_dynar_is_empty(simix_global->process_to_run) && SIMIX_get_clock() == 0.0) {
- XBT_CRITICAL(" ");
- XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
- XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
- xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code.");
+ XBT_CRITICAL(" ");
+ XBT_CRITICAL("The time is still 0, and you still have processes ready to run.");
+ XBT_CRITICAL("It seems that you forgot to run the simulation that you setup.");
+ xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code.");
}
/* Kill all processes (but maestro) */
SIMIX_process_killall(simix_global->maestro_process, 1);
if (xbt_swag_size(simix_global->process_list) != 0) {
- TRACE_end();
+ TRACE_end();
XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean.");
SIMIX_display_process_status();
}
/** @brief cancels a timer that was added earlier */
void SIMIX_timer_remove(smx_timer_t timer) {
- xbt_heap_rm_elm(simix_timers, timer, timer->date);
+ xbt_heap_rm_elm(simix_timers, timer, timer->date);
}
/** @brief Returns the date at which the timer will trigger (or 0 if NULL timer) */
double SIMIX_timer_get_date(smx_timer_t timer) {
- return timer?timer->date:0;
+ return timer?timer->date:0;
}
/**
}
smx_synchro_t simcall_HANDLER_execution_start(smx_simcall_t simcall,
- const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
- return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask);
+ const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
+ return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask);
}
smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name,
double flops_amount, double priority, double bound, unsigned long affinity_mask){
if (!MC_is_active() && !MC_record_replay_is_active()) {
synchro->execution.surf_exec =
surf_host_model->executeParallelTask(
- host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
+ host_nb, host_list_cpy, flops_amount, bytes_amount, rate);
synchro->execution.surf_exec->setData(synchro);
}
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *,smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
- void *data, double timeout){
+ void *data, double timeout){
smx_synchro_t comm = simcall_HANDLER_comm_isend(simcall, src, rdv, task_size, rate,
- src_buff, src_buff_size, match_fun, NULL, copy_data_fun,
- data, 0);
+ src_buff, src_buff_size, match_fun, NULL, copy_data_fun,
+ data, 0);
SIMCALL_SET_MC_VALUE(simcall, 0);
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
int (*match_fun)(void *, void *,smx_synchro_t),
void (*clean_fun)(void *), // used to free the synchro in case of problem after a detached send
void (*copy_data_fun)(smx_synchro_t, void*, size_t),// used to copy data if not default one
- void *data, int detached)
+ void *data, int detached)
{
XBT_DEBUG("send from %p", rdv);
void *data, double timeout, double rate)
{
smx_synchro_t comm = SIMIX_comm_irecv(receiver, rdv, dst_buff,
- dst_buff_size, match_fun, copy_data_fun, data, rate);
+ dst_buff_size, match_fun, copy_data_fun, data, rate);
SIMCALL_SET_MC_VALUE(simcall, 0);
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
- void *data, double rate)
+ void *data, double rate)
{
return SIMIX_comm_irecv(receiver, rdv, dst_buff, dst_buff_size,
- match_fun, copy_data_fun, data, rate);
+ match_fun, copy_data_fun, data, rate);
}
smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
other_synchro = this_synchro;
SIMIX_rdv_push(rdv, this_synchro);
}else{
- if(other_synchro->comm.surf_comm && SIMIX_comm_get_remains(other_synchro)==0.0)
+ if(other_synchro->comm.surf_comm && SIMIX_comm_get_remains(other_synchro)==0.0)
{
XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",&(other_synchro->comm));
other_synchro->state = SIMIX_DONE;
sg_host_get_name(sender), sg_host_get_name(receiver));
synchro->comm.surf_comm = surf_network_model_communicate(surf_network_model,
- sender, receiver,
- synchro->comm.task_size, synchro->comm.rate);
+ sender, receiver,
+ synchro->comm.task_size, synchro->comm.rate);
synchro->comm.surf_comm->setData(synchro);
synchro->comm.src_timeout->getState() == SURF_ACTION_DONE)
synchro->state = SIMIX_SRC_TIMEOUT;
else if (synchro->comm.dst_timeout &&
- synchro->comm.dst_timeout->getState() == SURF_ACTION_DONE)
+ synchro->comm.dst_timeout->getState() == SURF_ACTION_DONE)
synchro->state = SIMIX_DST_TIMEOUT;
else if (synchro->comm.src_timeout &&
- synchro->comm.src_timeout->getState() == SURF_ACTION_FAILED)
+ synchro->comm.src_timeout->getState() == SURF_ACTION_FAILED)
synchro->state = SIMIX_SRC_HOST_FAILURE;
else if (synchro->comm.dst_timeout &&
synchro->comm.dst_timeout->getState() == SURF_ACTION_FAILED)
synchro->state = SIMIX_DST_HOST_FAILURE;
else if (synchro->comm.surf_comm &&
- synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
+ synchro->comm.surf_comm->getState() == SURF_ACTION_FAILED) {
XBT_DEBUG("Puta madre. Surf says that the link broke");
synchro->state = SIMIX_LINK_FAILURE;
} else
/* If the mutex is not owned by the issuer, that's not good */
if (issuer != mutex->owner)
- THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.",
- SIMIX_process_get_name(mutex->owner),SIMIX_process_get_PID(mutex->owner));
+ THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.",
+ SIMIX_process_get_name(mutex->owner),SIMIX_process_get_PID(mutex->owner));
if (xbt_swag_size(mutex->sleeping) > 0) {
/*process to wake up */
* \param simcall the simcall
*/
void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond,
- smx_mutex_t mutex, double timeout)
+ smx_mutex_t mutex, double timeout)
{
XBT_IN("(%p)",simcall);
smx_process_t issuer = simcall->issuer;
}
xbt_dynar_free(&dyn_vms);
- return 1;
+ return 1;
}
void SIMIX_vm_start(sg_host_t ind_vm)
int rank = request->src;
if (TRACE_smpi_view_internals()) {
- TRACE_smpi_send(rank, rank, receiver,request->size);
+ TRACE_smpi_send(rank, rank, receiver,request->size);
}
print_request("New send", request);
/* FIXME: detached sends are not traceable (request->action == NULL) */
if (request->action)
- simcall_set_category(request->action, TRACE_internal_smpi_get_category());
+ simcall_set_category(request->action, TRACE_internal_smpi_get_category());
if (async_small_thresh != 0 || request->flags & RMA)
xbt_mutex_release(mut);
if(src != root) {
// FIXME: possibly overkill we we have contiguous/noncontiguous data
// mapping...
- if (!smpi_process_get_replaying())
+ if (!smpi_process_get_replaying())
tmpbufs[index] = xbt_malloc(count * dataext);
- else
- tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
+ else
+ tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
requests[index] =
smpi_irecv_init(tmpbufs[index], count, datatype, src,
system_tag, comm);
int file_descriptor= mkstemp (path);
if (file_descriptor < 0) {
- if (errno==EMFILE) {
- xbt_die("Impossible to create temporary file for memory mapping: %s\n\
+ if (errno==EMFILE) {
+ xbt_die("Impossible to create temporary file for memory mapping: %s\n\
The open() system call failed with the EMFILE error code (too many files). \n\n\
This means that you reached the system limits concerning the amount of files per process. \
This is not a surprise if you are trying to virtualize many processes on top of SMPI. \
If one of these values is less than the amount of MPI processes that you try to run, then you got the explanation of this error. \
Ask the Internet about tutorials on how to increase the files limit such as: https://rtcamp.com/tutorials/linux/increase-open-files-limit/",
strerror(errno));
- }
+ }
xbt_die("Impossible to create temporary file for memory mapping: %s",
- strerror(errno));
+ strerror(errno));
}
status = unlink (path);
int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
- int size, sendsize;
- size = smpi_comm_size(comm);
- sendsize = smpi_datatype_size(sendtype) * sendcount;
+ int size, sendsize;
+ size = smpi_comm_size(comm);
+ sendsize = smpi_datatype_size(sendtype) * sendcount;
if (sendsize < 200 && size > 12) {
return
smpi_coll_tuned_alltoall_bruck(sendbuf, sendcount, sendtype,
{
int retval;
if(old_type->has_subtype){
- //handle this case as a hvector with stride equals to the extent of the datatype
- return smpi_datatype_hvector(count, 1, smpi_datatype_get_extent(old_type), old_type, new_type);
+ //handle this case as a hvector with stride equals to the extent of the datatype
+ return smpi_datatype_hvector(count, 1, smpi_datatype_get_extent(old_type), old_type, new_type);
}
s_smpi_mpi_contiguous_t* subtype = smpi_datatype_contiguous_create( lb,
smpi_datatype_size(old_type));
smpi_datatype_create(new_type,
- count * smpi_datatype_size(old_type),
- lb,lb + count * smpi_datatype_size(old_type),
- 1,subtype, DT_FLAG_CONTIGUOUS);
+ count * smpi_datatype_size(old_type),
+ lb,lb + count * smpi_datatype_size(old_type),
+ 1,subtype, DT_FLAG_CONTIGUOUS);
retval=MPI_SUCCESS;
return retval;
}
smpi_datatype_size(old_type));
smpi_datatype_create(new_type, count * blocklen * smpi_datatype_size(old_type),
- lb,ub,
+ lb,ub,
1,
subtype,
DT_FLAG_VECTOR);
size += blocklens[i];
if(indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type)<lb)
- lb = indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type);
+ lb = indices[i]*smpi_datatype_get_extent(old_type)+smpi_datatype_lb(old_type);
if(indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type)>ub)
- ub = indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type);
+ ub = indices[i]*smpi_datatype_get_extent(old_type)+blocklens[i]*smpi_datatype_ub(old_type);
if ( (i< count -1) && (indices[i]+blocklens[i] != indices[i+1]) )contiguous=0;
}
old_type,
smpi_datatype_size(old_type));
smpi_datatype_create(new_type, size * smpi_datatype_size(old_type),
- lb,
+ lb,
ub
,1, subtype, DT_FLAG_DATA);
}else{
old_type,
smpi_datatype_size(old_type));
smpi_datatype_create(new_type, size * smpi_datatype_size(old_type),
- 0,size * smpi_datatype_size(old_type),
- 1, subtype, DT_FLAG_DATA|DT_FLAG_CONTIGUOUS);
+ 0,size * smpi_datatype_size(old_type),
+ 1, subtype, DT_FLAG_DATA|DT_FLAG_CONTIGUOUS);
}
retval=MPI_SUCCESS;
return retval;
break;
}
rank += ranges[i][2]; /* Stride */
- if (ranges[i][0]<ranges[i][1]){
- if(rank > ranges[i][1])
- break;
- }else{
- if(rank < ranges[i][1])
- break;
- }
+ if (ranges[i][0]<ranges[i][1]){
+ if(rank > ranges[i][1])
+ break;
+ }else{
+ if(rank < ranges[i][1])
+ break;
+ }
}
}
break;
}
rank += ranges[i][2]; /* Stride */
- if (ranges[i][0]<ranges[i][1]){
- if(rank > ranges[i][1])
- break;
- }else{
- if(rank < ranges[i][1])
- break;
- }
+ if (ranges[i][0]<ranges[i][1]){
+ if(rank > ranges[i][1])
+ break;
+ }else{
+ if(rank < ranges[i][1])
+ break;
+ }
}
}
}
break;
}
rank += ranges[i][2]; /* Stride */
- if (ranges[i][0]<ranges[i][1]){
- if(rank > ranges[i][1])
- break;
- }else{
- if(rank < ranges[i][1])
- break;
- }
+ if (ranges[i][0]<ranges[i][1]){
+ if(rank > ranges[i][1])
+ break;
+ }else{
+ if(rank < ranges[i][1])
+ break;
+ }
}
}
if (size == 0) {
//allocate a single buffer for all sends, growing it if needed
void* smpi_get_tmp_sendbuffer(int size){
if (!smpi_process_get_replaying())
- return xbt_malloc(size);
+ return xbt_malloc(size);
if (sendbuffer_size<size){
sendbuffer=xbt_realloc(sendbuffer,size);
sendbuffer_size=size;
//allocate a single buffer for all recv
void* smpi_get_tmp_recvbuffer(int size){
if (!smpi_process_get_replaying())
- return xbt_malloc(size);
+ return xbt_malloc(size);
if (recvbuffer_size<size){
recvbuffer=xbt_realloc(recvbuffer,size);
recvbuffer_size=size;
//Different times in traced application and replayed version may lead to this
//In this case, ignore the extra calls.
if(request){
- int rank = smpi_process_index();
- instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
- extra->type=TRACING_TEST;
- TRACE_smpi_testing_in(rank, extra);
+ int rank = smpi_process_index();
+ instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
+ extra->type=TRACING_TEST;
+ TRACE_smpi_testing_in(rank, extra);
- flag = smpi_mpi_test(&request, &status);
+ flag = smpi_mpi_test(&request, &status);
- XBT_DEBUG("MPI_Test result: %d", flag);
- /* push back request in dynar to be caught by a subsequent wait. if the test
- * did succeed, the request is now NULL.
- */
- xbt_dynar_push_as(get_reqq_self(),MPI_Request, request);
+ XBT_DEBUG("MPI_Test result: %d", flag);
+ /* push back request in dynar to be caught by a subsequent wait. if the test
+ * did succeed, the request is now NULL.
+ */
+ xbt_dynar_push_as(get_reqq_self(),MPI_Request, request);
- TRACE_smpi_testing_out(rank);
+ TRACE_smpi_testing_out(rank);
}
log_timed_action (action, clock);
}
}
PropertyHolder::~PropertyHolder() {
- xbt_dict_free(&p_properties);
+ xbt_dict_free(&p_properties);
}
/** @brief Return the property associated to the provided key (or NULL if not existing) */
const char *PropertyHolder::getProperty(const char*key) {
- if (p_properties == NULL)
- return NULL;
- return (const char*) xbt_dict_get_or_null(p_properties,key);
+ if (p_properties == NULL)
+ return NULL;
+ return (const char*) xbt_dict_get_or_null(p_properties,key);
}
/** @brief Change the value of a given key in the property set */
void PropertyHolder::setProperty(const char*key, const char*value) {
- if (!p_properties)
- p_properties = xbt_dict_new();
- xbt_dict_set(p_properties, key, xbt_strdup(value), &xbt_free_f);
+ if (!p_properties)
+ p_properties = xbt_dict_new();
+ xbt_dict_set(p_properties, key, xbt_strdup(value), &xbt_free_f);
}
/** @brief Return the whole set of properties. Don't mess with it, dude! */
xbt_dict_t PropertyHolder::getProperties() {
- if (!p_properties)
- p_properties = xbt_dict_new();
- return p_properties;
+ if (!p_properties)
+ p_properties = xbt_dict_new();
+ return p_properties;
}
} /* namespace surf */
class PropertyHolder { // DO NOT DERIVE THIS CLASS, or the diamond inheritance mayhem will get you
public:
- PropertyHolder(xbt_dict_t props);
- ~PropertyHolder();
+ PropertyHolder(xbt_dict_t props);
+ ~PropertyHolder();
- const char *getProperty(const char*id);
- void setProperty(const char*id, const char*value);
+ const char *getProperty(const char*id);
+ void setProperty(const char*id, const char*value);
- /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy).
- * But some user API expose this call so removing it is not so easy.
- */
- xbt_dict_t getProperties();
+ /* FIXME: This should not be exposed, as users may do bad things with the dict they got (it's not a copy).
+ * But some user API expose this call so removing it is not so easy.
+ */
+ xbt_dict_t getProperties();
private:
- xbt_dict_t p_properties = NULL;
+ xbt_dict_t p_properties = NULL;
};
} /* namespace surf */
}
Cpu *CpuCas01Model::createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
- int pstate, double speedScale,
+ int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
int initiallyOn,
tmgr_trace_t state_trace)
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
int initiallyOn, tmgr_trace_t stateTrace)
: Cpu(model, host,
- lmm_constraint_new(model->getMaxminSystem(), this, core * speedScale * xbt_dynar_get_as(speedPeak, pstate, double)),
- speedPeak, pstate,
- core, xbt_dynar_get_as(speedPeak, pstate, double), speedScale,
+ lmm_constraint_new(model->getMaxminSystem(), this, core * speedScale * xbt_dynar_get_as(speedPeak, pstate, double)),
+ speedPeak, pstate,
+ core, xbt_dynar_get_as(speedPeak, pstate, double), speedScale,
initiallyOn) {
XBT_DEBUG("CPU create: peak=%f, pstate=%d", m_speedPeak, m_pstate);
/** @brief take into account changes of speed (either load or max) */
void CpuCas01::onSpeedChange() {
- lmm_variable_t var = NULL;
- lmm_element_t elem = NULL;
+ lmm_variable_t var = NULL;
+ lmm_element_t elem = NULL;
lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(),
m_core * m_speedScale * m_speedPeak);
m_speedScale * m_speedPeak);
}
- Cpu::onSpeedChange();
+ Cpu::onSpeedChange();
}
void CpuCas01::updateState(tmgr_trace_iterator_t event_type, double value, double date)
CpuCas01Action::CpuCas01Action(Model *model, double cost, bool failed, double speed, lmm_constraint_t constraint)
: CpuAction(model, cost, failed,
- lmm_variable_new(model->getMaxminSystem(), this,
- 1.0, speed, 1))
+ lmm_variable_new(model->getMaxminSystem(), this,
+ 1.0, speed, 1))
{
if (model->getUpdateMechanism() == UM_LAZY) {
m_indexHeap = -1;
Cpu *getActionCpu(CpuAction *action) {
return static_cast<Cpu*>(lmm_constraint_id(lmm_get_cnst_from_var
- (action->getModel()->getMaxminSystem(),
- action->getVariable(), 0)));
+ (action->getModel()->getMaxminSystem(),
+ action->getVariable(), 0)));
}
simgrid::xbt::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
; it != itend ; it=itNext) {
- ++itNext;
+ ++itNext;
action = static_cast<CpuAction*>(&*it);
if (TRACE_is_enabled()) {
Cpu *x = static_cast<Cpu*> (lmm_constraint_id(lmm_get_cnst_from_var(getMaxminSystem(), action->getVariable(), 0)) );
* Resource *
************/
Cpu::Cpu(Model *model, simgrid::s4u::Host *host,
- xbt_dynar_t speedPeakList, int pstate,
- int core, double speedPeak, double speedScale,
- int initiallyOn)
+ xbt_dynar_t speedPeakList, int pstate,
+ int core, double speedPeak, double speedScale,
+ int initiallyOn)
: Cpu(model, host, NULL/*constraint*/, speedPeakList, pstate, core, speedPeak, speedScale, initiallyOn)
{
}
Cpu::Cpu(Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint,
- xbt_dynar_t speedPeakList, int pstate,
- int core, double speedPeak,
+ xbt_dynar_t speedPeakList, int pstate,
+ int core, double speedPeak,
double speedScale, int initiallyOn)
: Resource(model, host->name().c_str(), constraint, initiallyOn)
, m_core(core)
xbt_assert(model == surf_cpu_model_pm);
if (model->getUpdateMechanism() != UM_UNDEFINED) {
- p_constraintCore = xbt_new(lmm_constraint_t, core);
- p_constraintCoreId = xbt_new(void*, core);
+ p_constraintCore = xbt_new(lmm_constraint_t, core);
+ p_constraintCoreId = xbt_new(void*, core);
int i;
for (i = 0; i < core; i++) {
{
if (p_constraintCoreId){
for (int i = 0; i < m_core; i++) {
- xbt_free(p_constraintCoreId[i]);
+ xbt_free(p_constraintCoreId[i]);
}
xbt_free(p_constraintCore);
}
{
xbt_dynar_t plist = p_speedPeakList;
xbt_assert(pstate_index <= (int)xbt_dynar_length(plist),
- "Invalid parameters for CPU %s (pstate %d > length of pstates %d)", getName(), pstate_index, (int)xbt_dynar_length(plist));
+ "Invalid parameters for CPU %s (pstate %d > length of pstates %d)", getName(), pstate_index, (int)xbt_dynar_length(plist));
double new_peak_speed = xbt_dynar_get_as(plist, pstate_index, double);
m_pstate = pstate_index;
}
void Cpu::onSpeedChange() {
- TRACE_surf_host_set_speed(surf_get_clock(), getName(),
- m_core * m_speedScale * m_speedPeak);
+ TRACE_surf_host_set_speed(surf_get_clock(), getName(),
+ m_core * m_speedScale * m_speedPeak);
}
*/
Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host,
lmm_constraint_t constraint,
- xbt_dynar_t speedPeakList, int pstate,
- int core, double speedPeak, double speedScale,
- int initiallyOn);
+ xbt_dynar_t speedPeakList, int pstate,
+ int core, double speedPeak, double speedScale,
+ int initiallyOn);
/**
* @brief Cpu constructor
*/
Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host,
xbt_dynar_t speedPeakList, int pstate,
- int core, double speedPeak, double speedScale,
- int initiallyOn);
+ int core, double speedPeak, double speedScale,
+ int initiallyOn);
~Cpu();
}
Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host,
- xbt_dynar_t speedPeak,
- int pstate,
+ xbt_dynar_t speedPeak,
+ int pstate,
double speedScale,
tmgr_trace_t speedTrace,
int core,
xbt_assert(xbt_dynar_getfirst_as(speedPeak, double) > 0.0,
"Speed has to be >0.0. Did you forget to specify the mandatory speed attribute?");
CpuTi *cpu = new CpuTi(this, host, speedPeak, pstate, speedScale, speedTrace,
- core, initiallyOn, stateTrace);
+ core, initiallyOn, stateTrace);
return cpu;
}
p_stateEvent = future_evt_set->add_trace(stateTrace, 0.0, this);
if (speedTrace && xbt_dynar_length(speedTrace->event_list) > 1) {
- s_tmgr_event_t val;
+ s_tmgr_event_t val;
// add a fake trace event if periodicity == 0
xbt_dynar_get_cpy(speedTrace->event_list,
xbt_dynar_length(speedTrace->event_list) - 1, &val);
/* put all action running on cpu to failed */
for(ActionTiList::iterator it(p_actionSet->begin()), itend(p_actionSet->end())
; it != itend ; ++it) {
- action = &*it;
+ action = &*it;
if (action->getState() == SURF_ACTION_RUNNING
|| action->getState() == SURF_ACTION_READY
|| action->getState() == SURF_ACTION_NOT_IN_THE_SYSTEM) {
if (duration == NO_MAX_DURATION) {
/* Move to the *end* of the corresponding action set. This convention
is used to speed up update_resource_state */
- action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
+ action->getStateSet()->erase(action->getStateSet()->iterator_to(*action));
action->p_stateSet = static_cast<CpuTiModel*>(getModel())->p_runningActionSetThatDoesNotNeedBeingChecked;
action->getStateSet()->push_back(*action);
}
**********/
CpuTiAction::CpuTiAction(CpuTiModel *model_, double cost, bool failed,
- CpuTi *cpu)
+ CpuTi *cpu)
: CpuAction(model_, cost, failed)
{
p_cpu = cpu;
{
m_refcount--;
if (!m_refcount) {
- if (action_hook.is_linked())
- getStateSet()->erase(getStateSet()->iterator_to(*this));
+ if (action_hook.is_linked())
+ getStateSet()->erase(getStateSet()->iterator_to(*this));
/* remove from action_set */
if (action_ti_hook.is_linked())
p_cpu->p_actionSet->erase(p_cpu->p_actionSet->iterator_to(*this));
public:
CpuTiTgmr(trace_type type, double value)
: m_type(type), m_value(value)
- {};
+ {};
CpuTiTgmr(tmgr_trace_t speedTrace, double value);
~CpuTiTgmr();
var_list = &(sys->variable_set);
XBT_DEBUG("Variable set : %d", xbt_swag_size(var_list));
xbt_swag_foreach(_var, var_list) {
- var = (lmm_variable_t)_var;
+ var = (lmm_variable_t)_var;
int nb = 0;
var->value = 0.0;
XBT_DEBUG("Handling variable %p", var);
cnst_list = &(sys->active_constraint_set);
XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list));
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
xbt_swag_insert(cnst, &(sys->saturated_constraint_set));
}
cnst_list = &(sys->saturated_constraint_set);
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
cnst->remaining = cnst->bound;
cnst->usage = 0.0;
}
elem_list = &(cnst->enabled_element_set);
cnst->usage = 0.0;
xbt_swag_foreach(_elem, elem_list) {
- elem = (lmm_element_t)_elem;
+ elem = (lmm_element_t)_elem;
xbt_assert(elem->variable->weight > 0);
if ((elem->value > 0)
&& xbt_swag_belongs(elem->variable, var_list))
}
Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props,
- xbt_dynar_t storage, Cpu *cpu)
+ xbt_dynar_t storage, Cpu *cpu)
: Resource(model, name)
, PropertyHolder(props)
, p_storage(storage), p_cpu(cpu)
}
Host::Host(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint,
- xbt_dynar_t storage, Cpu *cpu)
+ xbt_dynar_t storage, Cpu *cpu)
: Resource(model, name, constraint)
, PropertyHolder(props)
, p_storage(storage), p_cpu(cpu)
xbt_dynar_t result = xbt_dynar_new(sizeof(void*), NULL);
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
- simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
- if(!strcmp((const char*)storage->p_attach,this->getName())){
- xbt_dynar_push_as(result, void *, (void*)storage->getName());
- }
- }
+ simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+ if(!strcmp((const char*)storage->p_attach,this->getName())){
+ xbt_dynar_push_as(result, void *, (void*)storage->getName());
+ }
+ }
}
return result;
}
}
if(longest_prefix_length>0)
{ /* Mount point found, split fullpath into mount_name and path+filename*/
- path = (char *) xbt_malloc ((strlen(fullpath)-longest_prefix_length+1));
- mount_name = (char *) xbt_malloc ((longest_prefix_length+1));
- strncpy(mount_name, fullpath, longest_prefix_length+1);
- strncpy(path, fullpath+longest_prefix_length, strlen(fullpath)-longest_prefix_length+1);
- path[strlen(fullpath)-longest_prefix_length] = '\0';
- mount_name[longest_prefix_length] = '\0';
+ path = (char *) xbt_malloc ((strlen(fullpath)-longest_prefix_length+1));
+ mount_name = (char *) xbt_malloc ((longest_prefix_length+1));
+ strncpy(mount_name, fullpath, longest_prefix_length+1);
+ strncpy(path, fullpath+longest_prefix_length, strlen(fullpath)-longest_prefix_length+1);
+ path[strlen(fullpath)-longest_prefix_length] = '\0';
+ mount_name[longest_prefix_length] = '\0';
}
else
xbt_die("Can't find mount point for '%s' on '%s'", fullpath, getName());
* @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
*/
class Host :
- public simgrid::surf::Resource,
- public simgrid::surf::PropertyHolder {
+ public simgrid::surf::Resource,
+ public simgrid::surf::PropertyHolder {
public:
static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
* @param cpu The Cpu associated to this Host
*/
Host(HostModel *model, const char *name, xbt_dict_t props,
- xbt_dynar_t storage, Cpu *cpu);
+ xbt_dynar_t storage, Cpu *cpu);
/**
* @brief Host constructor
surf_cpu_model_pm = new CpuL07Model(this,p_maxminSystem);
routing_model_create(surf_network_model->createLink("__loopback__",
- 498000000, NULL,
- 0.000015, NULL,
- 1/*ON*/, NULL,
- SURF_LINK_FATPIPE, NULL));
+ 498000000, NULL,
+ 0.000015, NULL,
+ 1/*ON*/, NULL,
+ SURF_LINK_FATPIPE, NULL));
}
HostL07Model::~HostL07Model() {
}
CpuL07Model::CpuL07Model(HostL07Model *hmodel,lmm_system_t sys)
- : CpuModel()
- , p_hostModel(hmodel)
- {
- p_maxminSystem = sys;
- }
+ : CpuModel()
+ , p_hostModel(hmodel)
+ {
+ p_maxminSystem = sys;
+ }
CpuL07Model::~CpuL07Model() {
- surf_cpu_model_pm = NULL;
- lmm_system_free(p_maxminSystem);
- p_maxminSystem = NULL;
+ surf_cpu_model_pm = NULL;
+ lmm_system_free(p_maxminSystem);
+ p_maxminSystem = NULL;
}
NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
- : NetworkModel()
- , p_hostModel(hmodel)
- {
- p_maxminSystem = sys;
- }
+ : NetworkModel()
+ , p_hostModel(hmodel)
+ {
+ p_maxminSystem = sys;
+ }
NetworkL07Model::~NetworkL07Model()
{
- surf_network_model = NULL;
- p_maxminSystem = NULL; // Avoid multi-free
+ surf_network_model = NULL;
+ p_maxminSystem = NULL; // Avoid multi-free
}
bottleneck_solve);
for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end())
- ; it != itend ; ++it) {
- action = static_cast<L07Action*>(&*it);
+ ; it != itend ; ++it) {
+ action = static_cast<L07Action*>(&*it);
if (action->m_latency > 0) {
if (min < 0) {
min = action->m_latency;
ActionList *actionSet = getRunningActionSet();
for(ActionList::iterator it = actionSet->begin(), itNext = it
- ; it != actionSet->end()
- ; it = itNext) {
- ++itNext;
+ ; it != actionSet->end()
+ ; it = itNext) {
+ ++itNext;
action = static_cast<L07Action*>(&*it);
if (action->m_latency > 0) {
if (action->m_latency > delta) {
}
Action *HostL07Model::executeParallelTask(int host_nb, sg_host_t *host_list,
- double *flops_amount, double *bytes_amount,
- double rate) {
- return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
+ double *flops_amount, double *bytes_amount,
+ double rate) {
+ return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
}
L07Action::L07Action(Model *model, int host_nb,
- sg_host_t*host_list,
- double *flops_amount,
- double *bytes_amount,
- double rate)
- : CpuAction(model, 1, 0)
+ sg_host_t*host_list,
+ double *flops_amount,
+ double *bytes_amount,
+ double rate)
+ : CpuAction(model, 1, 0)
{
unsigned int cpt;
int nb_link = 0;
xbt_dict_t properties)
{
xbt_assert(!Link::byName(name),
- "Link '%s' declared several times in the platform file.", name);
+ "Link '%s' declared several times in the platform file.", name);
Link* link = new LinkL07(this, name, properties,
- bw_initial, bw_trace,
- lat_initial, lat_trace,
- initiallyOn, state_trace,
- policy);
+ bw_initial, bw_trace,
+ lat_initial, lat_trace,
+ initiallyOn, state_trace,
+ policy);
Link::onCreation(link);
return link;
}
************/
CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host,
- xbt_dynar_t speedPeakList, int pstate,
- double speedScale, tmgr_trace_t speedTrace,
- int core, int initiallyOn, tmgr_trace_t state_trace)
+ xbt_dynar_t speedPeakList, int pstate,
+ double speedScale, tmgr_trace_t speedTrace,
+ int core, int initiallyOn, tmgr_trace_t state_trace)
: Cpu(model, host, speedPeakList, pstate,
- core, xbt_dynar_get_as(speedPeakList,pstate,double), speedScale, initiallyOn)
+ core, xbt_dynar_get_as(speedPeakList,pstate,double), speedScale, initiallyOn)
{
p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPeakList,pstate,double) * speedScale);
}
LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- int initiallyOn,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy)
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy)
: Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), future_evt_set, state_trace)
{
m_bwCurrent = bw_initial;
p_latEvent = future_evt_set->add_trace(lat_trace, 0.0, this);
if (policy == SURF_LINK_FATPIPE)
- lmm_constraint_shared(getConstraint());
+ lmm_constraint_shared(getConstraint());
}
Action *CpuL07::execution_start(double size)
/** @brief take into account changes of speed (either load or max) */
void CpuL07::onSpeedChange() {
- lmm_variable_t var = NULL;
- lmm_element_t elem = NULL;
+ lmm_variable_t var = NULL;
+ lmm_element_t elem = NULL;
lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), m_speedPeak * m_speedScale);
while ((var = lmm_get_var_from_cnst
m_speedScale * m_speedPeak);
}
- Cpu::onSpeedChange();
+ Cpu::onSpeedChange();
}
double shareResources(double now) override;
void updateActionsState(double now, double delta) override;
Action *executeParallelTask(int host_nb, sg_host_t *host_list,
- double *flops_amount, double *bytes_amount,
- double rate) override;
+ double *flops_amount, double *bytes_amount,
+ double rate) override;
void addTraces() override;
};
NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys);
~NetworkL07Model();
Link* createLink(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- int initiallyOn,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties) override;
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy,
+ xbt_dict_t properties) override;
Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override;
void addTraces() override {DIE_IMPOSSIBLE;};
class CpuL07 : public Cpu {
public:
CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeakList, int pstate,
- double power_scale, tmgr_trace_t power_trace,
+ double power_scale, tmgr_trace_t power_trace,
int core, int initiallyOn, tmgr_trace_t state_trace);
~CpuL07();
bool isUsed() override;
class LinkL07 : public Link {
public:
LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
- double bw_initial,
+ double bw_initial,
tmgr_trace_t bw_trace,
double lat_initial,
tmgr_trace_t lat_trace,
L07Action(Model *model, int host_nb,
sg_host_t*host_list,
double *flops_amount,
- double *bytes_amount,
+ double *bytes_amount,
double rate);
~L07Action();
double tmp;
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
tmp = 0;
elem_list = &(cnst->enabled_element_set);
xbt_swag_foreach(_elem, elem_list) {
}
xbt_swag_foreach(_var, var_list) {
- var = (lmm_variable_t)_var;
+ var = (lmm_variable_t)_var;
if (!var->weight)
break;
if (var->bound < 0)
double obj = 0.0;
xbt_swag_foreach(_var, var_list) {
- var = (lmm_variable_t)_var;
+ var = (lmm_variable_t)_var;
double sigma_i = 0.0;
int j;
*/
cnst_list = &(sys->active_constraint_set);
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
cnst->lambda = 1.0;
cnst->new_lambda = 2.0;
XBT_DEBUG("#### cnst(%p)->lambda : %e", cnst, cnst->lambda);
var_list = &(sys->variable_set);
i = 0;
xbt_swag_foreach(_var, var_list) {
- var = (lmm_variable_t)_var;
+ var = (lmm_variable_t)_var;
if (!var->weight)
var->value = 0.0;
else {
XBT_CDEBUG(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", cnst);
xbt_swag_foreach(_elem, elem_list) {
- elem = (lmm_element_t)_elem;
+ elem = (lmm_element_t)_elem;
var = elem->variable;
xbt_assert(var->weight > 0);
XBT_CDEBUG(surf_lagrange_dichotomy, "Computing sigma_i for var (%p)",
//Look at enabled_element_set, and jump to disabled_element_set when finished
*elem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->enabled_element_set.offset);
if (!(*elem))
- *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
+ *elem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
} else {
*elem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->disabled_element_set.offset);
}
//Look at enabled_element_set, and jump to disabled_element_set when finished
*nextelem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->enabled_element_set.offset);
if (!(*nextelem))
- *nextelem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
+ *nextelem = (lmm_element_t) xbt_swag_getFirst(&(cnst->disabled_element_set));
} else {
*nextelem = (lmm_element_t) xbt_swag_getNext(*elem, cnst->disabled_element_set.offset);
}
xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
strcat(trace_buf, print_buf);
xbt_swag_foreach(_var, var_list) {
- var = (lmm_variable_t)_var;
+ var = (lmm_variable_t)_var;
sprintf(print_buf, "'%d'(%f) ", var->id_int, var->weight);
trace_buf = (char*)
xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
/* Printing Constraints */
cnst_list = &(sys->active_constraint_set);
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
sum = 0.0;
//Show the enabled variables
elem_list = &(cnst->enabled_element_set);
strlen(trace_buf) + strlen(print_buf) + 1);
strcat(trace_buf, print_buf);
if(cnst->sharing_policy)
- 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);
}
//TODO: Adding disabled elements only for test compatibility, but do we really want them to be printed?
elem_list = &(cnst->disabled_element_set);
strlen(trace_buf) + strlen(print_buf) + 1);
strcat(trace_buf, print_buf);
if(cnst->sharing_policy)
- 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);
XBT_DEBUG("Variables");
/* Printing Result */
xbt_swag_foreach(_var, var_list) {
- var = (lmm_variable_t)_var;
+ var = (lmm_variable_t)_var;
if (var->bound > 0) {
XBT_DEBUG("'%d'(%f) : %f (<=%f)", var->id_int, var->weight, var->value,
var->bound);
XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list));
/* Init: Only modified code portions: reset the value of active variables */
xbt_swag_foreach(_cnst, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
elem_list = &(cnst->enabled_element_set);
//XBT_DEBUG("Variable set : %d", xbt_swag_size(elem_list));
xbt_swag_foreach(_elem, elem_list) {
saturated_constraint_set->data = xbt_new0(int, saturated_constraint_set->size);
xbt_swag_foreach_safe(_cnst, _cnst_next, cnst_list) {
- cnst = (lmm_constraint_t)_cnst;
+ cnst = (lmm_constraint_t)_cnst;
/* INIT: Collect constraints that actually need to be saturated (i.e remaining and usage are strictly positive) into cnst_light_tab. */
cnst->remaining = cnst->bound;
if (!double_positive(cnst->remaining, cnst->bound*sg_maxmin_precision))
int i;
if (min_bound < 0) {
- //If no variable could reach its bound, deal iteratively the constraints usage ( at worst one constraint is saturated at each cycle)
+ //If no variable could reach its bound, deal iteratively the constraints usage ( at worst one constraint is saturated at each cycle)
var->value = min_usage / var->weight;
XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value);
} else {
- //If there exist a variable that can reach its bound, only update it (and other with the same bound) for now.
- if (double_equals(min_bound, var->bound*var->weight, sg_maxmin_precision)){
+ //If there exist a variable that can reach its bound, only update it (and other with the same bound) for now.
+ if (double_equals(min_bound, var->bound*var->weight, sg_maxmin_precision)){
var->value = var->bound;
XBT_DEBUG("Setting %p (%d) value to %f\n", var, var->id_int, var->value);
}
else {
- // Variables which bound is different are not considered for this cycle, but they will be afterwards.
+ // Variables which bound is different are not considered for this cycle, but they will be afterwards.
XBT_DEBUG("Do not consider %p (%d) \n", var, var->id_int);
xbt_swag_remove(var, var_list);
continue;
elem = &var->cnsts[i];
cnst = elem->constraint;
if (cnst->sharing_policy) {
- //Remember: shared constraints require that sum(elem->value * var->value) < cnst->bound
+ //Remember: shared constraints require that sum(elem->value * var->value) < cnst->bound
double_update(&(cnst->remaining), elem->value * var->value, cnst->bound*sg_maxmin_precision);
double_update(&(cnst->usage), elem->value / var->weight, sg_maxmin_precision);
- //If the constraint is saturated, remove it from the set of active constraints (light_tab)
+ //If the constraint is saturated, remove it from the set of active constraints (light_tab)
if(!double_positive(cnst->usage,sg_maxmin_precision) || !double_positive(cnst->remaining,cnst->bound*sg_maxmin_precision)) {
if (cnst->cnst_light) {
int index = (cnst->cnst_light-cnst_light_tab);
XBT_DEBUG("index: %d \t cnst_light_num: %d \t || \t cnst: %p \t cnst->cnst_light: %p \t cnst_light_tab: %p usage: %f remaining: %f bound: %f ",
- index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound);
+ index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound);
cnst_light_tab[index]=cnst_light_tab[cnst_light_num-1];
cnst_light_tab[index].cnst->cnst_light = &cnst_light_tab[index];
cnst_light_num--;
}
make_elem_inactive(elem);
} else {
- //Remember: non-shared constraints only require that max(elem->value * var->value) < cnst->bound
+ //Remember: non-shared constraints only require that max(elem->value * var->value) < cnst->bound
cnst->usage = 0.0;
make_elem_inactive(elem);
elem_list = &(cnst->enabled_element_set);
xbt_swag_foreach(_elem, elem_list) {
- elem = (lmm_element_t)_elem;
- xbt_assert(elem->variable->weight > 0);
- if (elem->variable->value > 0) continue;
- if (elem->value > 0)
- cnst->usage = MAX(cnst->usage, elem->value / elem->variable->weight);
+ elem = (lmm_element_t)_elem;
+ xbt_assert(elem->variable->weight > 0);
+ if (elem->variable->value > 0) continue;
+ if (elem->value > 0)
+ cnst->usage = MAX(cnst->usage, elem->value / elem->variable->weight);
}
- //If the constraint is saturated, remove it from the set of active constraints (light_tab)
+ //If the constraint is saturated, remove it from the set of active constraints (light_tab)
if(!double_positive(cnst->usage,sg_maxmin_precision) || !double_positive(cnst->remaining,cnst->bound*sg_maxmin_precision)) {
if(cnst->cnst_light) {
int index = (cnst->cnst_light-cnst_light_tab);
XBT_DEBUG("index: %d \t cnst_light_num: %d \t || \t cnst: %p \t cnst->cnst_light: %p \t cnst_light_tab: %p usage: %f remaining: %f bound: %f ",
- index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound);
+ index,cnst_light_num, cnst, cnst->cnst_light, cnst_light_tab, cnst->usage, cnst->remaining, cnst->bound);
cnst_light_tab[index]=cnst_light_tab[cnst_light_num-1];
cnst_light_tab[index].cnst->cnst_light = &cnst_light_tab[index];
cnst_light_num--;
pos,
saturated_constraint_set,
&min_usage);
- }
+ }
saturated_variable_set_update( cnst_light_tab,
saturated_constraint_set,
if (elem->variable->staged_weight>0 )
{
- //Found a staged variable
- //TODOLATER: Add random timing function to model reservation protocol fuzziness? Then how to make sure that staged variables will eventually be called?
- if(lmm_can_enable_var(elem->variable)){
- lmm_enable_var(sys,elem->variable);
- concurrency++;
- }
+ //Found a staged variable
+ //TODOLATER: Add random timing function to model reservation protocol fuzziness? Then how to make sure that staged variables will eventually be called?
+ if(lmm_can_enable_var(elem->variable)){
+ lmm_enable_var(sys,elem->variable);
+ concurrency++;
+ }
}
xbt_assert(concurrency<=cnstr->concurrency_limit,"Concurrency overflow!");
* @return Returns whether a change was made
*/
void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
- double weight)
+ double weight)
{
int minslack;
//To be clean, when visited counter has wrapped around, we force these var->visited values so that variables that were in the modified a long (long long) time ago are not wrongly skipped here, which would lead to very nasty bugs (i.e. not readibily reproducible, and requiring a lot of run time before happening).
if (++sys->visited_counter == 1) {
/* the counter wrapped around, reset each variable->visited */
- void *_var;
+ void *_var;
xbt_swag_foreach(_var, &sys->variable_set)
((lmm_variable_t)_var)->visited = 0;
}
lmm_element_t elem = NULL;
xbt_swag_foreach(_elem, elem_list) {
- elem = (lmm_element_t)_elem;
+ elem = (lmm_element_t)_elem;
if ((elem->value > 0)) {
if (cnst->sharing_policy)
usage += elem->value * elem->variable->value;
concurrency=0;
xbt_swag_foreach(_elem, &(cnst->enabled_element_set)) {
- elem = (lmm_element_t)_elem;
- xbt_assert(elem->variable->weight > 0);
- concurrency++;
+ elem = (lmm_element_t)_elem;
+ xbt_assert(elem->variable->weight > 0);
+ concurrency++;
}
xbt_swag_foreach(_elem, &(cnst->disabled_element_set)) {
- elem = (lmm_element_t)_elem;
- //We should have staged variables only if conccurency is reached in some constraint
- xbt_assert(cnst->concurrency_limit<0 || elem->variable->staged_weight==0 || lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,"should not have staged variable!");
+ elem = (lmm_element_t)_elem;
+ //We should have staged variables only if conccurency is reached in some constraint
+ xbt_assert(cnst->concurrency_limit<0 || elem->variable->staged_weight==0 || lmm_cnstrs_min_concurrency_slack(elem->variable) < elem->variable->concurrency_share,"should not have staged variable!");
}
xbt_assert(cnst->concurrency_limit<0 || cnst->concurrency_limit >= concurrency,"concurrency check failed!");
namespace surf {
NetworkCm02Model::NetworkCm02Model()
- :NetworkModel()
+ :NetworkModel()
{
char *optim = xbt_cfg_get_string(_sg_cfg_set, "network/optim");
int select =
}
if (!p_maxminSystem)
- p_maxminSystem = lmm_system_new(m_selectiveUpdate);
+ p_maxminSystem = lmm_system_new(m_selectiveUpdate);
routing_model_create(createLink("__loopback__",
- 498000000, NULL, 0.000015, NULL,
- 1 /*SURF_RESOURCE_ON*/, NULL,
- SURF_LINK_FATPIPE, NULL));
+ 498000000, NULL, 0.000015, NULL,
+ 1 /*SURF_RESOURCE_ON*/, NULL,
+ SURF_LINK_FATPIPE, NULL));
if (p_updateMechanism == UM_LAZY) {
- p_actionHeap = xbt_heap_new(8, NULL);
- xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap);
- p_modifiedSet = new ActionLmmList();
- p_maxminSystem->keep_track = p_modifiedSet;
+ p_actionHeap = xbt_heap_new(8, NULL);
+ xbt_heap_set_update_callback(p_actionHeap, surf_action_lmm_update_index_heap);
+ p_modifiedSet = new ActionLmmList();
+ p_maxminSystem->keep_track = p_modifiedSet;
}
}
name);
Link* link = new NetworkCm02Link(this, name, properties, p_maxminSystem, sg_bandwidth_factor * bw_initial, future_evt_set,
- initiallyOn, state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy);
+ initiallyOn, state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy);
Link::onCreation(link);
return link;
}
for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
; it != itend ; it=itNext) {
- ++itNext;
+ ++itNext;
action = static_cast<NetworkCm02Action*> (&*it);
XBT_DEBUG("Something happened to action %p", action);
src->getName(), dst->getName());
xbt_dynar_foreach(route, i, _link) {
- link = static_cast<NetworkCm02Link*>(_link);
+ link = static_cast<NetworkCm02Link*>(_link);
if (link->isOff()) {
failed = 1;
break;
}
}
if (sg_network_crosstraffic == 1) {
- routing_platf->getRouteAndLatency(dst, src, &back_route, NULL);
+ routing_platf->getRouteAndLatency(dst, src, &back_route, NULL);
xbt_dynar_foreach(back_route, i, _link) {
link = static_cast<NetworkCm02Link*>(_link);
if (link->isOff()) {
}
}
xbt_dynar_foreach(route, i, _link) {
- link = static_cast<NetworkCm02Link*>(_link);
+ link = static_cast<NetworkCm02Link*>(_link);
double bb = bandwidthFactor(size) * link->getBandwidth();
bandwidth_bound =
(bandwidth_bound < 0.0) ? bb : std::min(bandwidth_bound, bb);
}
xbt_dynar_foreach(route, i, _link) {
- link = static_cast<NetworkCm02Link*>(_link);
+ link = static_cast<NetworkCm02Link*>(_link);
lmm_expand(p_maxminSystem, link->getConstraint(), action->getVariable(), 1.0);
}
* Resource *
************/
NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
- lmm_system_t system,
- double constraint_value,
- sg_future_evt_set_t fes,
- int initiallyOn,
- tmgr_trace_t state_trace,
- double metric_peak,
- tmgr_trace_t metric_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- e_surf_link_sharing_policy_t policy)
+ lmm_system_t system,
+ double constraint_value,
+ sg_future_evt_set_t fes,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ double metric_peak,
+ tmgr_trace_t metric_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ e_surf_link_sharing_policy_t policy)
: Link(model, name, props, lmm_constraint_new(system, this, constraint_value), fes, state_trace)
{
if (initiallyOn)
m_latCurrent = lat_initial;
if (lat_trace)
- p_latEvent = fes->add_trace(lat_trace, 0.0, this);
+ p_latEvent = fes->add_trace(lat_trace, 0.0, this);
if (policy == SURF_LINK_FATPIPE)
- lmm_constraint_shared(getConstraint());
+ lmm_constraint_shared(getConstraint());
}
NetworkCm02Model();
~NetworkCm02Model() { }
Link* createLink(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- int initiallyOn,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties) override;
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy,
+ xbt_dict_t properties) override;
void addTraces() override;
void updateActionsStateLazy(double now, double delta) override;
void updateActionsStateFull(double now, double delta) override;
Action *communicate(NetCard *src, NetCard *dst,
- double size, double rate) override;
+ double size, double rate) override;
bool shareResourcesIsIdempotent() override {return true;}
virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction * /*action*/) {};
protected:
class NetworkCm02Link : public Link {
public:
NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
- lmm_system_t system,
- double constraint_value,
- sg_future_evt_set_t fes,
- int initiallyOn,
- tmgr_trace_t state_trace,
- double metric_peak,
- tmgr_trace_t metric_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
+ lmm_system_t system,
+ double constraint_value,
+ sg_future_evt_set_t fes,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ double metric_peak,
+ tmgr_trace_t metric_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
e_surf_link_sharing_policy_t policy);
void updateState(tmgr_trace_iterator_t event_type, double value, double date) override;
void updateBandwidth(double value, double date=surf_get_clock()) override;
ActionList *actionSet = getRunningActionSet();
for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
- ; it != itend ; ++it) {
- action = static_cast<NetworkConstantAction*>(&*it);
+ ; it != itend ; ++it) {
+ action = static_cast<NetworkConstantAction*>(&*it);
if (action->m_latency > 0 && (min < 0 || action->m_latency < min))
min = action->m_latency;
}
for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
; it != itend ; it=itNext) {
++itNext;
- action = static_cast<NetworkConstantAction*>(&*it);
+ action = static_cast<NetworkConstantAction*>(&*it);
if (action->m_latency > 0) {
if (action->m_latency > delta) {
double_update(&(action->m_latency), delta, sg_surf_precision);
}
Action *NetworkConstantModel::communicate(NetCard *src, NetCard *dst,
- double size, double rate)
+ double size, double rate)
{
char *src_name = src->getName();
char *dst_name = dst->getName();
{
m_refcount--;
if (!m_refcount) {
- if (action_hook.is_linked())
- p_stateSet->erase(p_stateSet->iterator_to(*this));
+ if (action_hook.is_linked())
+ p_stateSet->erase(p_stateSet->iterator_to(*this));
delete this;
return 1;
}
: NetworkAction(model_, size, false)
, m_latInit(latency)
{
- m_latency = latency;
- if (m_latency <= 0.0) {
- p_stateSet = getModel()->getDoneActionSet();
- p_stateSet->push_back(*this);
- }
- p_variable = NULL;
+ m_latency = latency;
+ if (m_latency <= 0.0) {
+ p_stateSet = getModel()->getDoneActionSet();
+ p_stateSet->push_back(*this);
+ }
+ p_variable = NULL;
};
int unref() override;
void cancel() override;
if(num_comm_out!=1){
if((*it)->destination->nbActiveCommsDown > 2)//number of comms sent to the receiving node
- my_penalty_out = num_comm_out * Bs * ys;
+ my_penalty_out = num_comm_out * Bs * ys;
else
- my_penalty_out = num_comm_out * Bs;
+ my_penalty_out = num_comm_out * Bs;
}
max_penalty_out = std::max(max_penalty_out,my_penalty_out);
int nb_comms = (*it)->destination->nbActiveCommsDown;//total number of incoming comms
if(nb_comms!=1)
my_penalty_in = ((*it)->destination->ActiveCommsDown)[root] //number of comm sent to dest by root node
- * Be
- * (*it)->destination->ActiveCommsDown.size();//number of different nodes sending to dest
+ * Be
+ * (*it)->destination->ActiveCommsDown.size();//number of different nodes sending to dest
double penalty = std::max(my_penalty_in,max_penalty_out);
to->nbActiveCommsDown--;
for (std::vector<ActiveComm*>::iterator it= from->ActiveCommsUp.begin();
- it != from->ActiveCommsUp.end(); ++it) {
+ it != from->ActiveCommsUp.end(); ++it) {
if((*it)->action==action){
- comm=(*it);
- from->ActiveCommsUp.erase(it);
- break;
+ comm=(*it);
+ from->ActiveCommsUp.erase(it);
+ break;
}
}
action->unref();
return link->getLatency();
}
void* sg_link_data(Link *link) {
- return link->getData();
+ return link->getData();
}
void sg_link_data_set(Link *link,void *data) {
- link->setData(data);
+ link->setData(data);
}
int sg_link_count(void) {
- return Link::linksCount();
+ return Link::linksCount();
}
Link** sg_link_list(void) {
- return Link::linksList();
+ return Link::linksList();
}
void sg_link_exit(void) {
- Link::linksExit();
+ Link::linksExit();
}
}
boost::unordered_map<std::string,Link *> *Link::links = new boost::unordered_map<std::string,Link *>();
Link *Link::byName(const char* name) {
- Link * res = NULL;
- try {
- res = links->at(name);
- } catch (std::out_of_range& e) {}
+ Link * res = NULL;
+ try {
+ res = links->at(name);
+ } catch (std::out_of_range& e) {}
- return res;
+ return res;
}
/** @brief Returns the amount of links in the platform */
int Link::linksCount() {
- return links->size();
+ return links->size();
}
/** @brief Returns a list of all existing links */
Link **Link::linksList() {
- Link **res = xbt_new(Link*, (int)links->size());
- int i=0;
- for (auto kv : *links) {
- res[i++] = kv.second;
- }
- return res;
+ Link **res = xbt_new(Link*, (int)links->size());
+ int i=0;
+ for (auto kv : *links) {
+ res[i++] = kv.second;
+ }
+ return res;
}
/** @brief destructor of the static data */
void Link::linksExit() {
- for (auto kv : *links)
- (kv.second)->destroy();
- delete links;
+ for (auto kv : *links)
+ (kv.second)->destroy();
+ delete links;
}
/*************
link->state_trace, link->policy, link->properties);
xbt_free(link_id);
} else {
- surf_network_model->createLink(link->id,
- link->bandwidth,
- link->bandwidth_trace,
- link->latency,
- link->latency_trace,
- link->initiallyOn,
- link->state_trace, link->policy, link->properties);
+ surf_network_model->createLink(link->id,
+ link->bandwidth,
+ link->bandwidth_trace,
+ link->latency,
+ link->latency_trace,
+ link->initiallyOn,
+ link->state_trace, link->policy, link->properties);
}
}
}
Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props,
- lmm_constraint_t constraint,
- sg_future_evt_set_t fes,
- tmgr_trace_t state_trace)
+ lmm_constraint_t constraint,
+ sg_future_evt_set_t fes,
+ tmgr_trace_t state_trace)
: Resource(model, name, constraint),
PropertyHolder(props)
{
/** @brief use destroy() instead of this destructor */
Link::~Link() {
- xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead.");
+ xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead.");
}
/** @brief Fire the require callbacks and destroy the object
*
*/
void Link::destroy()
{
- if (!currentlyDestroying_) {
- currentlyDestroying_ = true;
- onDestruction(this);
- delete this;
- }
+ if (!currentlyDestroying_) {
+ currentlyDestroying_ = true;
+ onDestruction(this);
+ delete this;
+ }
}
bool Link::isUsed()
/** @brief Destructor */
~NetworkModel() {
- if (p_maxminSystem)
- lmm_system_free(p_maxminSystem);
- if (p_actionHeap)
- xbt_heap_free(p_actionHeap);
- if (p_modifiedSet)
- delete p_modifiedSet;
+ if (p_maxminSystem)
+ lmm_system_free(p_maxminSystem);
+ if (p_actionHeap)
+ xbt_heap_free(p_actionHeap);
+ if (p_modifiedSet)
+ delete p_modifiedSet;
}
/**
* @return The action representing the communication
*/
virtual Action *communicate(NetCard *src, NetCard *dst,
- double size, double rate)=0;
+ double size, double rate)=0;
/** @brief Function pointer to the function to use to solve the lmm_system_t
*
* @details A Link represents the link between two [hosts](\ref Host)
*/
class Link :
- public simgrid::surf::Resource,
- public simgrid::surf::PropertyHolder {
+ public simgrid::surf::Resource,
+ public simgrid::surf::PropertyHolder {
public:
/**
* @brief Link constructor
protected:
~Link();
public:
- void destroy(); // Must be called instead of the destructor
+ void destroy(); // Must be called instead of the destructor
private:
- bool currentlyDestroying_ = false;
+ bool currentlyDestroying_ = false;
public:
/** @brief Callback signal fired when a new Link is created.
}
Link* NetworkNS3Model::createLink(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- int initiallyOn,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties){
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy,
+ xbt_dict_t properties){
if (bw_trace)
XBT_INFO("The NS3 network model doesn't support bandwidth state traces");
if (lat_trace)
}
Action *NetworkNS3Model::communicate(NetCard *src, NetCard *dst,
- double size, double rate)
+ double size, double rate)
{
XBT_DEBUG("Communicate from %s to %s", src->getName(), dst->getName());
NetworkNS3Action *action = new NetworkNS3Action(this, size, 0);
action->setRemains(action->getCost() - ns3_get_socket_sent(data));
if (TRACE_is_enabled() &&
- action->getState() == SURF_ACTION_RUNNING){
- double data_sent = ns3_get_socket_sent(data);
- double data_delta_sent = data_sent - action->m_lastSent;
-
- xbt_dynar_t route = NULL;
-
- routing_platf->getRouteAndLatency (action->p_srcElm, action->p_dstElm, &route, NULL);
- unsigned int i;
- for (i = 0; i < xbt_dynar_length (route); i++){
- NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i));
- TRACE_surf_link_set_utilization (link->getName(),
- action->getCategory(),
- (data_delta_sent)/delta,
- now-delta,
- delta);
- }
- action->m_lastSent = data_sent;
+ action->getState() == SURF_ACTION_RUNNING){
+ double data_sent = ns3_get_socket_sent(data);
+ double data_delta_sent = data_sent - action->m_lastSent;
+
+ xbt_dynar_t route = NULL;
+
+ routing_platf->getRouteAndLatency (action->p_srcElm, action->p_dstElm, &route, NULL);
+ unsigned int i;
+ for (i = 0; i < xbt_dynar_length (route); i++){
+ NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i));
+ TRACE_surf_link_set_utilization (link->getName(),
+ action->getCategory(),
+ (data_delta_sent)/delta,
+ now-delta,
+ delta);
+ }
+ action->m_lastSent = data_sent;
}
if(ns3_get_socket_is_finished(data) == 1){
************/
NetworkNS3Link::NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props,
- double bw_initial, double lat_initial)
+ double bw_initial, double lat_initial)
: Link(model, name, props)
, p_lat(bprintf("%f", lat_initial))
, p_bdw(bprintf("%f", bw_initial))
{
m_refcount--;
if (!m_refcount) {
- if (action_hook.is_linked())
- p_stateSet->erase(p_stateSet->iterator_to(*this));
+ if (action_hook.is_linked())
+ p_stateSet->erase(p_stateSet->iterator_to(*this));
XBT_DEBUG ("Removing action %p", this);
- delete this;
+ delete this;
return 1;
}
return 0;
~NetworkNS3Model();
Link* createLink(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- int initiallyOn,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties);
+ double bw_initial,
+ tmgr_trace_t bw_trace,
+ double lat_initial,
+ tmgr_trace_t lat_trace,
+ int initiallyOn,
+ tmgr_trace_t state_trace,
+ e_surf_link_sharing_policy_t policy,
+ xbt_dict_t properties);
xbt_dynar_t getRoute(NetCard *src, NetCard *dst);
Action *communicate(NetCard *src, NetCard *dst,
- double size, double rate);
+ double size, double rate);
double shareResources(double now);
void updateActionsState(double now, double delta);
void addTraces(){DIE_IMPOSSIBLE;}
class NetworkNS3Link : public Link {
public:
NetworkNS3Link(NetworkNS3Model *model, const char *name, xbt_dict_t props,
- double bw_initial, double lat_initial);
+ double bw_initial, double lat_initial);
~NetworkNS3Link();
void updateState(tmgr_trace_iterator_t event_type, double value, double date);
NetworkSmpiModel::NetworkSmpiModel()
: NetworkCm02Model() {
- m_haveGap=true;
+ m_haveGap=true;
}
NetworkSmpiModel::~NetworkSmpiModel(){
void HostEnergy::update()
{
simgrid::surf::Host* surf_host = host->extension<simgrid::surf::Host>();
- double start_time = this->last_updated;
- double finish_time = surf_get_clock();
- double cpu_load;
- if (surf_host->p_cpu->m_speedPeak == 0)
- // Some users declare a pstate of speed 0 flops (eg to model boot time).
- // We consider that the machine is then fully loaded. That's arbitrary but it avoids a NaN
- cpu_load = 1;
- else
- cpu_load = lmm_constraint_get_usage(surf_host->p_cpu->getConstraint())
+ double start_time = this->last_updated;
+ double finish_time = surf_get_clock();
+ double cpu_load;
+ if (surf_host->p_cpu->m_speedPeak == 0)
+ // Some users declare a pstate of speed 0 flops (eg to model boot time).
+ // We consider that the machine is then fully loaded. That's arbitrary but it avoids a NaN
+ cpu_load = 1;
+ else
+ cpu_load = lmm_constraint_get_usage(surf_host->p_cpu->getConstraint())
/ surf_host->p_cpu->m_speedPeak;
- if (cpu_load > 1) // A machine with a load > 1 consumes as much as a fully loaded machine, not mores
- cpu_load = 1;
+ if (cpu_load > 1) // A machine with a load > 1 consumes as much as a fully loaded machine, not mores
+ cpu_load = 1;
- double previous_energy = this->total_energy;
+ double previous_energy = this->total_energy;
- double instantaneous_consumption;
- if (host->is_off())
- instantaneous_consumption = this->watts_off;
- else
- instantaneous_consumption = this->getCurrentWattsValue(cpu_load);
+ double instantaneous_consumption;
+ if (host->is_off())
+ instantaneous_consumption = this->watts_off;
+ else
+ instantaneous_consumption = this->getCurrentWattsValue(cpu_load);
- double energy_this_step = instantaneous_consumption*(finish_time-start_time);
+ double energy_this_step = instantaneous_consumption*(finish_time-start_time);
- this->total_energy = previous_energy + energy_this_step;
- this->last_updated = finish_time;
+ this->total_energy = previous_energy + energy_this_step;
+ this->last_updated = finish_time;
- XBT_DEBUG("[update_energy of %s] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J",
- surf_host->getName(), start_time, finish_time, surf_host->p_cpu->m_speedPeak, previous_energy, energy_this_step);
+ XBT_DEBUG("[update_energy of %s] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J",
+ surf_host->getName(), start_time, finish_time, surf_host->p_cpu->m_speedPeak, previous_energy, energy_this_step);
}
HostEnergy::HostEnergy(simgrid::s4u::Host *ptr) :
/** @brief Computes the power consumed by the host according to the current pstate and processor load */
double HostEnergy::getCurrentWattsValue(double cpu_load)
{
- xbt_assert(!power_range_watts_list.empty(),
+ xbt_assert(!power_range_watts_list.empty(),
"No power range properties specified for host %s", host->name().c_str());
/* min_power corresponds to the idle power (cpu load = 0) */
double min_power = range.first;
double max_power = range.second;
double power_slope = max_power - min_power;
- double current_power = min_power + cpu_load * power_slope;
+ double current_power = min_power + cpu_load * power_slope;
- XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope);
- XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load);
+ XBT_DEBUG("[get_current_watts] min_power=%f, max_power=%f, slope=%f", min_power, max_power, power_slope);
+ XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load);
- return current_power;
+ return current_power;
}
double HostEnergy::getConsumedEnergy()
{
- if (last_updated < surf_get_clock()) // We need to simcall this as it modifies the environment
- simgrid::simix::kernel(std::bind(&HostEnergy::update, this));
+ if (last_updated < surf_get_clock()) // We need to simcall this as it modifies the environment
+ simgrid::simix::kernel(std::bind(&HostEnergy::update, this));
- return total_energy;
+ return total_energy;
}
void HostEnergy::initWattsRangeList()
{
- if (host->properties() == NULL)
- return;
- char* all_power_values_str =
+ if (host->properties() == NULL)
+ return;
+ char* all_power_values_str =
(char*)xbt_dict_get_or_null(host->properties(), "watt_per_state");
- if (all_power_values_str == NULL)
- return;
-
- xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ",");
- int pstate_nb = xbt_dynar_length(all_power_values);
-
- for (int i=0; i< pstate_nb; i++)
- {
- /* retrieve the power values associated with the current pstate */
- xbt_dynar_t current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":");
- xbt_assert(xbt_dynar_length(current_power_values) > 1,
- "Power properties incorrectly defined - "
+ if (all_power_values_str == NULL)
+ return;
+
+ xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ",");
+ int pstate_nb = xbt_dynar_length(all_power_values);
+
+ for (int i=0; i< pstate_nb; i++)
+ {
+ /* retrieve the power values associated with the current pstate */
+ xbt_dynar_t current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":");
+ xbt_assert(xbt_dynar_length(current_power_values) > 1,
+ "Power properties incorrectly defined - "
"could not retrieve min and max power values for host %s",
- host->name().c_str());
+ host->name().c_str());
- /* min_power corresponds to the idle power (cpu load = 0) */
- /* max_power is the power consumed at 100% cpu load */
+ /* min_power corresponds to the idle power (cpu load = 0) */
+ /* max_power is the power consumed at 100% cpu load */
power_range_watts_list.push_back(power_range(
atof(xbt_dynar_get_as(current_power_values, 0, char*)),
atof(xbt_dynar_get_as(current_power_values, 1, char*))
));
xbt_dynar_free(¤t_power_values);
- }
- xbt_dynar_free(&all_power_values);
+ }
+ xbt_dynar_free(&all_power_values);
}
}
void sg_platf_new_host(sg_platf_host_cbarg_t host)
{
xbt_assert(! sg_host_by_name(host->id),
- "Refusing to create a second host named '%s'.", host->id);
+ "Refusing to create a second host named '%s'.", host->id);
simgrid::surf::NetCard *net = NULL;
simgrid::surf::As* current_routing = routing_get_current();
sg_host_t h = simgrid::s4u::Host::by_name_or_create(host->id);
simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu(
- h,
+ h,
host->speed_peak,
host->pstate,
host->speed_scale,
((storage_type_t) stype)->type_id,
storage->content,
storage->content_type,
- storage->properties);
+ storage->properties);
surf_storage_model->createStorage(storage->id,
((storage_type_t) stype)->type_id,
storage->content,
storage->content_type,
- storage->properties,
+ storage->properties,
storage->attach);
}
void sg_platf_new_storage_type(sg_platf_storage_type_cbarg_t storage_type){
/* 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.
- */
- yy_size_t 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.
+ */
+ yy_size_t 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 yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t 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 595
#define YY_END_OF_BUFFER 596
/* 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[3466] =
{ 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;
}
assert(s && e && s <= e);
++s;
while (s < e) {
- if (isspace(*s)) {
- BUFFERPUTC(' ');
- do ++s; while (s < e && isspace(*s));
- } else
- BUFFERPUTC(*s++);
+ if (isspace(*s)) {
+ BUFFERPUTC(' ');
+ do ++s; while (s < e && isspace(*s));
+ } else
+ BUFFERPUTC(*s++);
}
} else {
const char *s = text;
while (*s)
- BUFFERPUTC(*s++);
+ BUFFERPUTC(*s++);
}
BUFFERDONE;
}
/* 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
{
- yy_state_type yy_current_state;
- char *yy_cp, *yy_bp;
- int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
- 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( );
+ }
- {
+ {
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG);
/* COMMENTS and PIs: handled uniformly for efficiency. */
- 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
- {
- 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 >= 3466 )
- 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] != 12512 );
+ do
+ {
+ 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 >= 3466 )
+ 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] != 12512 );
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] )
- {
- yy_size_t 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] )
+ {
+ yy_size_t 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_1):
case YY_STATE_EOF(S_surfxml_platform_6):
case YY_STATE_EOF(S_surfxml_platform_4):
case YY_STATE_EOF(E_surfxml_platform):
case YY_STATE_EOF(S_surfxml_platform_8):
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_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); 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_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); 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(S_surfxml_include_2):
case YY_STATE_EOF(E_surfxml_include):
case YY_STATE_EOF(S_surfxml_include):
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_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); 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_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); 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(E_surfxml_random);
}
- YY_BREAK
+ YY_BREAK
case 77:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_2: 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: case S_surfxml_platform_2: 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(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_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); 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_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); 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 */
case 111:
/* rule 111 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Full;
- YY_BREAK
+ YY_BREAK
case 112:
/* rule 112 can match eol */
case 113:
/* rule 113 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Floyd;
- YY_BREAK
+ YY_BREAK
case 114:
/* rule 114 can match eol */
case 115:
/* rule 115 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Dijkstra;
- YY_BREAK
+ YY_BREAK
case 116:
/* rule 116 can match eol */
case 117:
/* rule 117 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_DijkstraCache;
- YY_BREAK
+ YY_BREAK
case 118:
/* rule 118 can match eol */
case 119:
/* rule 119 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_None;
- YY_BREAK
+ YY_BREAK
case 120:
/* rule 120 can match eol */
case 121:
/* rule 121 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Vivaldi;
- YY_BREAK
+ YY_BREAK
case 122:
/* rule 122 can match eol */
case 123:
/* rule 123 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster;
- YY_BREAK
+ YY_BREAK
case 124:
/* rule 124 can match eol */
case 125:
/* rule 125 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster___torus;
- YY_BREAK
+ YY_BREAK
case 126:
/* rule 126 can match eol */
case 127:
/* rule 127 can match eol */
YY_RULE_SETUP
A_surfxml_AS_routing = A_surfxml_AS_routing_Cluster___fat___tree;
- YY_BREAK
+ YY_BREAK
case 128:
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 129:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 130:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of AS element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 131:
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 132:
/* rule 132 can match eol */
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 133:
/* rule 133 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</AS>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 134:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</AS>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_AS_8):
case YY_STATE_EOF(E_surfxml_AS):
case YY_STATE_EOF(S_surfxml_AS):
case YY_STATE_EOF(S_surfxml_AS_3):
case YY_STATE_EOF(S_surfxml_AS_1):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</AS>' expected.");
- YY_BREAK
+ YY_BREAK
case 135:
/* rule 135 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <storage_type> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 136:
/* rule 136 can match eol */
YY_RULE_SETUP
surfxml_storage___type_content___type_isset = 0;
ENTER(AL_surfxml_storage___type); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 137:
/* rule 137 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 138:
/* rule 138 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 139:
/* rule 139 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 140:
/* rule 140 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 141:
/* rule 141 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 142:
/* rule 142 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 143:
/* rule 143 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 144:
/* rule 144 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 145:
/* rule 145 can match eol */
YY_RULE_SETUP
if (surfxml_storage___type_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage___type>");} surfxml_storage___type_content___type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage___type_content___type);
- YY_BREAK
+ YY_BREAK
case 146:
/* rule 146 can match eol */
YY_RULE_SETUP
if (surfxml_storage___type_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage___type>");} surfxml_storage___type_content___type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage___type_content___type);
- YY_BREAK
+ YY_BREAK
case 147:
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 148:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 149:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of storage_type element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 150:
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 151:
/* rule 151 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 152:
/* rule 152 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</storage_type>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 153:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</storage_type>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_storage___type_2):
case YY_STATE_EOF(S_surfxml_storage___type):
case YY_STATE_EOF(E_surfxml_storage___type):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage_type>' expected.");
- YY_BREAK
+ YY_BREAK
case 154:
/* rule 154 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <mount> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 155:
/* rule 155 can match eol */
YY_RULE_SETUP
surfxml_mount_name_isset = 0;
ENTER(AL_surfxml_mount); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 156:
/* rule 156 can match eol */
YY_RULE_SETUP
if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in <surfxml_mount>");} surfxml_mount_storageId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_storageId);
- YY_BREAK
+ YY_BREAK
case 157:
/* rule 157 can match eol */
YY_RULE_SETUP
if (surfxml_mount_storageId_isset != 0) {FAIL("Multiple definition of attribute storageId in <surfxml_mount>");} surfxml_mount_storageId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_storageId);
- YY_BREAK
+ YY_BREAK
case 158:
/* rule 158 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 159:
/* rule 159 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 160:
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 161:
YY_RULE_SETUP
{
case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 162:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of mount element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 163:
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 164:
/* rule 164 can match eol */
case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 165:
/* rule 165 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</mount>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 166:
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 167:
/* rule 167 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <mstorage> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 168:
/* rule 168 can match eol */
YY_RULE_SETUP
surfxml_mstorage_name_isset = 0;
ENTER(AL_surfxml_mstorage); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 169:
/* rule 169 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 170:
/* rule 170 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 171:
/* rule 171 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 172:
/* rule 172 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 173:
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 174:
YY_RULE_SETUP
{
case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 175:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of mstorage element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 176:
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 177:
/* rule 177 can match eol */
case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 178:
/* rule 178 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</mstorage>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 179:
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 180:
/* rule 180 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <host> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 181:
/* rule 181 can match eol */
YY_RULE_SETUP
surfxml_host_pstate_isset = 0;
ENTER(AL_surfxml_host); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 182:
/* rule 182 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 183:
/* rule 183 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 184:
/* rule 184 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 185:
/* rule 185 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 186:
/* rule 186 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 187:
/* rule 187 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 188:
/* rule 188 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 189:
/* rule 189 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 190:
/* rule 190 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 191:
/* rule 191 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 192:
/* rule 192 can match eol */
case 193:
/* rule 193 can match eol */
YY_RULE_SETUP
A_surfxml_host_state = A_surfxml_host_state_ON;
- YY_BREAK
+ YY_BREAK
case 194:
/* rule 194 can match eol */
case 195:
/* rule 195 can match eol */
YY_RULE_SETUP
A_surfxml_host_state = A_surfxml_host_state_OFF;
- YY_BREAK
+ YY_BREAK
case 196:
/* rule 196 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 197:
/* rule 197 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 198:
/* rule 198 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 199:
/* rule 199 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 200:
/* rule 200 can match eol */
YY_RULE_SETUP
if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");} surfxml_host_pstate_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_pstate);
- YY_BREAK
+ YY_BREAK
case 201:
/* rule 201 can match eol */
YY_RULE_SETUP
if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");} surfxml_host_pstate_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_pstate);
- YY_BREAK
+ YY_BREAK
case 202:
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 203:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 204:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of host element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 205:
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 206:
/* rule 206 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 207:
/* rule 207 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</host>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 208:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</host>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_host_2):
case YY_STATE_EOF(S_surfxml_host):
case YY_STATE_EOF(E_surfxml_host):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host>' expected.");
- YY_BREAK
+ YY_BREAK
case 209:
/* rule 209 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <storage> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 210:
/* rule 210 can match eol */
YY_RULE_SETUP
surfxml_storage_attach_isset = 0;
ENTER(AL_surfxml_storage); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 211:
/* rule 211 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 212:
/* rule 212 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 213:
/* rule 213 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 214:
/* rule 214 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 215:
/* rule 215 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 216:
/* rule 216 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 217:
/* rule 217 can match eol */
YY_RULE_SETUP
if (surfxml_storage_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage>");} surfxml_storage_content___type_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content___type);
- YY_BREAK
+ YY_BREAK
case 218:
/* rule 218 can match eol */
YY_RULE_SETUP
if (surfxml_storage_content___type_isset != 0) {FAIL("Multiple definition of attribute content_type in <surfxml_storage>");} surfxml_storage_content___type_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content___type);
- YY_BREAK
+ YY_BREAK
case 219:
/* rule 219 can match eol */
YY_RULE_SETUP
if (surfxml_storage_attach_isset != 0) {FAIL("Multiple definition of attribute attach in <surfxml_storage>");} surfxml_storage_attach_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_attach);
- YY_BREAK
+ YY_BREAK
case 220:
/* rule 220 can match eol */
YY_RULE_SETUP
if (surfxml_storage_attach_isset != 0) {FAIL("Multiple definition of attribute attach in <surfxml_storage>");} surfxml_storage_attach_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_attach);
- YY_BREAK
+ YY_BREAK
case 221:
YY_RULE_SETUP
{
if (!AX_surfxml_storage_attach) FAIL("Required attribute `attach' not set for `storage' element.");
LEAVE; STag_surfxml_storage();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage);
}
- YY_BREAK
+ YY_BREAK
case 222:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 223:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of storage element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 224:
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 225:
/* rule 225 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 226:
/* rule 226 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</storage>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 227:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</storage>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_storage_2):
case YY_STATE_EOF(S_surfxml_storage):
case YY_STATE_EOF(E_surfxml_storage):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</storage>' expected.");
- YY_BREAK
+ YY_BREAK
case 228:
/* rule 228 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <gpu> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 229:
/* rule 229 can match eol */
YY_RULE_SETUP
surfxml_gpu_name_isset = 0;
ENTER(AL_surfxml_gpu); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 230:
/* rule 230 can match eol */
YY_RULE_SETUP
if (surfxml_gpu_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_gpu>");} surfxml_gpu_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_gpu_name);
- YY_BREAK
+ YY_BREAK
case 231:
/* rule 231 can match eol */
YY_RULE_SETUP
if (surfxml_gpu_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_gpu>");} surfxml_gpu_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_gpu_name);
- YY_BREAK
+ YY_BREAK
case 232:
YY_RULE_SETUP
{
if (!AX_surfxml_gpu_name) FAIL("Required attribute `name' not set for `gpu' element.");
LEAVE; STag_surfxml_gpu();surfxml_pcdata_ix = 0; ENTER(E_surfxml_gpu);
}
- YY_BREAK
+ YY_BREAK
case 233:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 234:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of gpu element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 235:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `gpu' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_gpu):
FAIL("EOF in attribute list of `gpu' element.");
- YY_BREAK
+ YY_BREAK
case 236:
/* rule 236 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 237:
/* rule 237 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</gpu>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 238:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</gpu>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_gpu):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</gpu>' expected.");
- YY_BREAK
+ YY_BREAK
case 239:
/* rule 239 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <host_link> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 240:
/* rule 240 can match eol */
YY_RULE_SETUP
surfxml_host___link_down_isset = 0;
ENTER(AL_surfxml_host___link); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 241:
/* rule 241 can match eol */
YY_RULE_SETUP
if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");} surfxml_host___link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_id);
- YY_BREAK
+ YY_BREAK
case 242:
/* rule 242 can match eol */
YY_RULE_SETUP
if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");} surfxml_host___link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_id);
- YY_BREAK
+ YY_BREAK
case 243:
/* rule 243 can match eol */
YY_RULE_SETUP
if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");} surfxml_host___link_up_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_up);
- YY_BREAK
+ YY_BREAK
case 244:
/* rule 244 can match eol */
YY_RULE_SETUP
if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");} surfxml_host___link_up_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_up);
- YY_BREAK
+ YY_BREAK
case 245:
/* rule 245 can match eol */
YY_RULE_SETUP
if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");} surfxml_host___link_down_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_down);
- YY_BREAK
+ YY_BREAK
case 246:
/* rule 246 can match eol */
YY_RULE_SETUP
if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");} surfxml_host___link_down_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_down);
- YY_BREAK
+ YY_BREAK
case 247:
YY_RULE_SETUP
{
if (!AX_surfxml_host___link_down) FAIL("Required attribute `down' not set for `host_link' element.");
LEAVE; STag_surfxml_host___link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_host___link);
}
- YY_BREAK
+ YY_BREAK
case 248:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 249:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of host_link element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 250:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `host_link' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_host___link):
FAIL("EOF in attribute list of `host_link' element.");
- YY_BREAK
+ YY_BREAK
case 251:
/* rule 251 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 252:
/* rule 252 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</host_link>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 253:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</host_link>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_host___link):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</host_link>' expected.");
- YY_BREAK
+ YY_BREAK
case 254:
/* rule 254 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <cluster> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 255:
/* rule 255 can match eol */
YY_RULE_SETUP
surfxml_cluster_loopback___lat_isset = 0;
ENTER(AL_surfxml_cluster); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 256:
/* rule 256 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 257:
/* rule 257 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 258:
/* rule 258 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 259:
/* rule 259 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 260:
/* rule 260 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 261:
/* rule 261 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 262:
/* rule 262 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 263:
/* rule 263 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 264:
/* rule 264 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 265:
/* rule 265 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 266:
/* rule 266 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 267:
/* rule 267 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 268:
/* rule 268 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 269:
/* rule 269 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 270:
/* rule 270 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 271:
/* rule 271 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 272:
/* rule 272 can match eol */
case 273:
/* rule 273 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_SHARED;
- YY_BREAK
+ YY_BREAK
case 274:
/* rule 274 can match eol */
case 275:
/* rule 275 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FULLDUPLEX;
- YY_BREAK
+ YY_BREAK
case 276:
/* rule 276 can match eol */
case 277:
/* rule 277 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_sharing___policy = A_surfxml_cluster_sharing___policy_FATPIPE;
- YY_BREAK
+ YY_BREAK
case 278:
/* rule 278 can match eol */
case 279:
/* rule 279 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_topology = A_surfxml_cluster_topology_FLAT;
- YY_BREAK
+ YY_BREAK
case 280:
/* rule 280 can match eol */
case 281:
/* rule 281 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_topology = A_surfxml_cluster_topology_TORUS;
- YY_BREAK
+ YY_BREAK
case 282:
/* rule 282 can match eol */
case 283:
/* rule 283 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_topology = A_surfxml_cluster_topology_FAT___TREE;
- YY_BREAK
+ YY_BREAK
case 284:
/* rule 284 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_topo___parameters_isset != 0) {FAIL("Multiple definition of attribute topo_parameters in <surfxml_cluster>");} surfxml_cluster_topo___parameters_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_topo___parameters);
- YY_BREAK
+ YY_BREAK
case 285:
/* rule 285 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_topo___parameters_isset != 0) {FAIL("Multiple definition of attribute topo_parameters in <surfxml_cluster>");} surfxml_cluster_topo___parameters_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_topo___parameters);
- YY_BREAK
+ YY_BREAK
case 286:
/* rule 286 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 287:
/* rule 287 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 288:
/* rule 288 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 289:
/* rule 289 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 290:
/* rule 290 can match eol */
case 291:
/* rule 291 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_SHARED;
- YY_BREAK
+ YY_BREAK
case 292:
/* rule 292 can match eol */
case 293:
/* rule 293 can match eol */
YY_RULE_SETUP
A_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_FATPIPE;
- YY_BREAK
+ YY_BREAK
case 294:
/* rule 294 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 295:
/* rule 295 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 296:
/* rule 296 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 297:
/* rule 297 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 298:
/* rule 298 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 299:
/* rule 299 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 300:
/* rule 300 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_limiter___link);
- YY_BREAK
+ YY_BREAK
case 301:
/* rule 301 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_limiter___link_isset != 0) {FAIL("Multiple definition of attribute limiter_link in <surfxml_cluster>");} surfxml_cluster_limiter___link_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_limiter___link);
- YY_BREAK
+ YY_BREAK
case 302:
/* rule 302 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___bw);
- YY_BREAK
+ YY_BREAK
case 303:
/* rule 303 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_loopback___bw_isset != 0) {FAIL("Multiple definition of attribute loopback_bw in <surfxml_cluster>");} surfxml_cluster_loopback___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___bw);
- YY_BREAK
+ YY_BREAK
case 304:
/* rule 304 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cluster_loopback___lat);
- YY_BREAK
+ YY_BREAK
case 305:
/* rule 305 can match eol */
YY_RULE_SETUP
if (surfxml_cluster_loopback___lat_isset != 0) {FAIL("Multiple definition of attribute loopback_lat in <surfxml_cluster>");} surfxml_cluster_loopback___lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cluster_loopback___lat);
- YY_BREAK
+ YY_BREAK
case 306:
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(S_surfxml_cluster);
}
- YY_BREAK
+ YY_BREAK
case 307:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 308:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of cluster element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 309:
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 310:
/* rule 310 can match eol */
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 311:
/* rule 311 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</cluster>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 312:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</cluster>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_cluster):
case YY_STATE_EOF(S_surfxml_cluster_2):
case YY_STATE_EOF(E_surfxml_cluster):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cluster>' expected.");
- YY_BREAK
+ YY_BREAK
case 313:
/* rule 313 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <cabinet> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 314:
/* rule 314 can match eol */
YY_RULE_SETUP
surfxml_cabinet_lat_isset = 0;
ENTER(AL_surfxml_cabinet); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 315:
/* rule 315 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cabinet>");} surfxml_cabinet_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_id);
- YY_BREAK
+ YY_BREAK
case 316:
/* rule 316 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_cabinet>");} surfxml_cabinet_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_id);
- YY_BREAK
+ YY_BREAK
case 317:
/* rule 317 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cabinet>");} surfxml_cabinet_prefix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_prefix);
- YY_BREAK
+ YY_BREAK
case 318:
/* rule 318 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_prefix_isset != 0) {FAIL("Multiple definition of attribute prefix in <surfxml_cabinet>");} surfxml_cabinet_prefix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_prefix);
- YY_BREAK
+ YY_BREAK
case 319:
/* rule 319 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cabinet>");} surfxml_cabinet_suffix_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_suffix);
- YY_BREAK
+ YY_BREAK
case 320:
/* rule 320 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_suffix_isset != 0) {FAIL("Multiple definition of attribute suffix in <surfxml_cabinet>");} surfxml_cabinet_suffix_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_suffix);
- YY_BREAK
+ YY_BREAK
case 321:
/* rule 321 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cabinet>");} surfxml_cabinet_radical_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_radical);
- YY_BREAK
+ YY_BREAK
case 322:
/* rule 322 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_radical_isset != 0) {FAIL("Multiple definition of attribute radical in <surfxml_cabinet>");} surfxml_cabinet_radical_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_radical);
- YY_BREAK
+ YY_BREAK
case 323:
/* rule 323 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cabinet>");} surfxml_cabinet_power_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_power);
- YY_BREAK
+ YY_BREAK
case 324:
/* rule 324 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_power_isset != 0) {FAIL("Multiple definition of attribute power in <surfxml_cabinet>");} surfxml_cabinet_power_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_power);
- YY_BREAK
+ YY_BREAK
case 325:
/* rule 325 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cabinet>");} surfxml_cabinet_bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_bw);
- YY_BREAK
+ YY_BREAK
case 326:
/* rule 326 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_bw_isset != 0) {FAIL("Multiple definition of attribute bw in <surfxml_cabinet>");} surfxml_cabinet_bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_bw);
- YY_BREAK
+ YY_BREAK
case 327:
/* rule 327 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cabinet>");} surfxml_cabinet_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_cabinet_lat);
- YY_BREAK
+ YY_BREAK
case 328:
/* rule 328 can match eol */
YY_RULE_SETUP
if (surfxml_cabinet_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_cabinet>");} surfxml_cabinet_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_cabinet_lat);
- YY_BREAK
+ YY_BREAK
case 329:
YY_RULE_SETUP
{
if (!AX_surfxml_cabinet_lat) FAIL("Required attribute `lat' not set for `cabinet' element.");
LEAVE; STag_surfxml_cabinet();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cabinet);
}
- YY_BREAK
+ YY_BREAK
case 330:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 331:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of cabinet element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 332:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `cabinet' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_cabinet):
FAIL("EOF in attribute list of `cabinet' element.");
- YY_BREAK
+ YY_BREAK
case 333:
/* rule 333 can match eol */
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 334:
/* rule 334 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</cabinet>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 335:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</cabinet>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_cabinet):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</cabinet>' expected.");
- YY_BREAK
+ YY_BREAK
case 336:
/* rule 336 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <peer> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 337:
/* rule 337 can match eol */
YY_RULE_SETUP
surfxml_peer_state___file_isset = 0;
ENTER(AL_surfxml_peer); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 338:
/* rule 338 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 339:
/* rule 339 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 340:
/* rule 340 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 341:
/* rule 341 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 342:
/* rule 342 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 343:
/* rule 343 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 344:
/* rule 344 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 345:
/* rule 345 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 346:
/* rule 346 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 347:
/* rule 347 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 348:
/* rule 348 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 349:
/* rule 349 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 350:
/* rule 350 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 351:
/* rule 351 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 352:
/* rule 352 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 353:
/* rule 353 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 354:
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 355:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 356:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of peer element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 357:
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 358:
/* rule 358 can match eol */
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 359:
/* rule 359 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</peer>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 360:
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 361:
/* rule 361 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <router> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 362:
/* rule 362 can match eol */
YY_RULE_SETUP
surfxml_router_coordinates_isset = 0;
ENTER(AL_surfxml_router); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 363:
/* rule 363 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 364:
/* rule 364 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 365:
/* rule 365 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 366:
/* rule 366 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 367:
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 368:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 369:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of router element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 370:
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 371:
/* rule 371 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 372:
/* rule 372 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</router>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 373:
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 374:
/* rule 374 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <backbone> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 375:
/* rule 375 can match eol */
YY_RULE_SETUP
surfxml_backbone_latency_isset = 0;
ENTER(AL_surfxml_backbone); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 376:
/* rule 376 can match eol */
YY_RULE_SETUP
if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_backbone>");} surfxml_backbone_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_id);
- YY_BREAK
+ YY_BREAK
case 377:
/* rule 377 can match eol */
YY_RULE_SETUP
if (surfxml_backbone_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_backbone>");} surfxml_backbone_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_id);
- YY_BREAK
+ YY_BREAK
case 378:
/* rule 378 can match eol */
YY_RULE_SETUP
if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_backbone>");} surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_bandwidth);
- YY_BREAK
+ YY_BREAK
case 379:
/* rule 379 can match eol */
YY_RULE_SETUP
if (surfxml_backbone_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_backbone>");} surfxml_backbone_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_bandwidth);
- YY_BREAK
+ YY_BREAK
case 380:
/* rule 380 can match eol */
YY_RULE_SETUP
if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_backbone>");} surfxml_backbone_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_backbone_latency);
- YY_BREAK
+ YY_BREAK
case 381:
/* rule 381 can match eol */
YY_RULE_SETUP
if (surfxml_backbone_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_backbone>");} surfxml_backbone_latency_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_backbone_latency);
- YY_BREAK
+ YY_BREAK
case 382:
YY_RULE_SETUP
{
if (!AX_surfxml_backbone_latency) FAIL("Required attribute `latency' not set for `backbone' element.");
LEAVE; STag_surfxml_backbone();surfxml_pcdata_ix = 0; ENTER(E_surfxml_backbone);
}
- YY_BREAK
+ YY_BREAK
case 383:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 384:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of backbone element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 385:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `backbone' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_backbone):
FAIL("EOF in attribute list of `backbone' element.");
- YY_BREAK
+ YY_BREAK
case 386:
/* rule 386 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 387:
/* rule 387 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</backbone>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 388:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</backbone>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_backbone):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</backbone>' expected.");
- YY_BREAK
+ YY_BREAK
case 389:
/* rule 389 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <link> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 390:
/* rule 390 can match eol */
YY_RULE_SETUP
surfxml_link_sharing___policy_isset = 0;
ENTER(AL_surfxml_link); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 391:
/* rule 391 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 392:
/* rule 392 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 393:
/* rule 393 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 394:
/* rule 394 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 395:
/* rule 395 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 396:
/* rule 396 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 397:
/* rule 397 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 398:
/* rule 398 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 399:
/* rule 399 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 400:
/* rule 400 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 401:
/* rule 401 can match eol */
case 402:
/* rule 402 can match eol */
YY_RULE_SETUP
A_surfxml_link_state = A_surfxml_link_state_ON;
- YY_BREAK
+ YY_BREAK
case 403:
/* rule 403 can match eol */
case 404:
/* rule 404 can match eol */
YY_RULE_SETUP
A_surfxml_link_state = A_surfxml_link_state_OFF;
- YY_BREAK
+ YY_BREAK
case 405:
/* rule 405 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 406:
/* rule 406 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 407:
/* rule 407 can match eol */
case 408:
/* rule 408 can match eol */
YY_RULE_SETUP
A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED;
- YY_BREAK
+ YY_BREAK
case 409:
/* rule 409 can match eol */
case 410:
/* rule 410 can match eol */
YY_RULE_SETUP
A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FATPIPE;
- YY_BREAK
+ YY_BREAK
case 411:
/* rule 411 can match eol */
case 412:
/* rule 412 can match eol */
YY_RULE_SETUP
A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FULLDUPLEX;
- YY_BREAK
+ YY_BREAK
case 413:
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 414:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 415:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of link element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 416:
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 417:
/* rule 417 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
}
}
- YY_BREAK
+ YY_BREAK
case 418:
/* rule 418 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</link>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 419:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</link>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_link):
case YY_STATE_EOF(S_surfxml_link_2):
case YY_STATE_EOF(E_surfxml_link):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</link>' expected.");
- YY_BREAK
+ YY_BREAK
case 420:
/* rule 420 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <route> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 421:
/* rule 421 can match eol */
YY_RULE_SETUP
surfxml_route_symmetrical_isset = 0;
ENTER(AL_surfxml_route); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 422:
/* rule 422 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 423:
/* rule 423 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 424:
/* rule 424 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 425:
/* rule 425 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 426:
/* rule 426 can match eol */
case 427:
/* rule 427 can match eol */
YY_RULE_SETUP
A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
- YY_BREAK
+ YY_BREAK
case 428:
/* rule 428 can match eol */
case 429:
/* rule 429 can match eol */
YY_RULE_SETUP
A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
- YY_BREAK
+ YY_BREAK
case 430:
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 431:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 432:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of route element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 433:
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 434:
/* rule 434 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 435:
/* rule 435 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</route>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 436:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</route>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_route_2):
case YY_STATE_EOF(E_surfxml_route):
case YY_STATE_EOF(S_surfxml_route):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</route>' expected.");
- YY_BREAK
+ YY_BREAK
case 437:
/* rule 437 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <ASroute> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 438:
/* rule 438 can match eol */
YY_RULE_SETUP
surfxml_ASroute_symmetrical_isset = 0;
ENTER(AL_surfxml_ASroute); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 439:
/* rule 439 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 440:
/* rule 440 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 441:
/* rule 441 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 442:
/* rule 442 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 443:
/* rule 443 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 444:
/* rule 444 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 445:
/* rule 445 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 446:
/* rule 446 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 447:
/* rule 447 can match eol */
case 448:
/* rule 448 can match eol */
YY_RULE_SETUP
A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_YES;
- YY_BREAK
+ YY_BREAK
case 449:
/* rule 449 can match eol */
case 450:
/* rule 450 can match eol */
YY_RULE_SETUP
A_surfxml_ASroute_symmetrical = A_surfxml_ASroute_symmetrical_NO;
- YY_BREAK
+ YY_BREAK
case 451:
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 452:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 453:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of ASroute element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 454:
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 455:
/* rule 455 can match eol */
case S_surfxml_AS: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 456:
/* rule 456 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</ASroute>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 457:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</ASroute>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_ASroute_2):
case YY_STATE_EOF(S_surfxml_ASroute):
case YY_STATE_EOF(E_surfxml_ASroute):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</ASroute>' expected.");
- YY_BREAK
+ YY_BREAK
case 458:
/* rule 458 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <link_ctn> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 459:
/* rule 459 can match eol */
YY_RULE_SETUP
surfxml_link___ctn_direction_isset = 0;
ENTER(AL_surfxml_link___ctn); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 460:
/* rule 460 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 461:
/* rule 461 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 462:
/* rule 462 can match eol */
case 463:
/* rule 463 can match eol */
YY_RULE_SETUP
A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_UP;
- YY_BREAK
+ YY_BREAK
case 464:
/* rule 464 can match eol */
case 465:
/* rule 465 can match eol */
YY_RULE_SETUP
A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_DOWN;
- YY_BREAK
+ YY_BREAK
case 466:
/* rule 466 can match eol */
case 467:
/* rule 467 can match eol */
YY_RULE_SETUP
A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_NONE;
- YY_BREAK
+ YY_BREAK
case 468:
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 469:
YY_RULE_SETUP
{
case S_surfxml_route: case S_surfxml_route_1: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 470:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of link_ctn element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 471:
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 472:
/* rule 472 can match eol */
case S_surfxml_route: case S_surfxml_route_1: case S_surfxml_route_2: SET(S_surfxml_route_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 473:
/* rule 473 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</link_ctn>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 474:
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 475:
/* rule 475 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <bypassRoute> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 476:
/* rule 476 can match eol */
YY_RULE_SETUP
surfxml_bypassRoute_dst_isset = 0;
ENTER(AL_surfxml_bypassRoute); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 477:
/* rule 477 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 478:
/* rule 478 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 479:
/* rule 479 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 480:
/* rule 480 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 481:
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 482:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 483:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of bypassRoute element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 484:
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 485:
/* rule 485 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 486:
/* rule 486 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</bypassRoute>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 487:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</bypassRoute>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_bypassRoute_2):
case YY_STATE_EOF(E_surfxml_bypassRoute):
case YY_STATE_EOF(S_surfxml_bypassRoute):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassRoute>' expected.");
- YY_BREAK
+ YY_BREAK
case 488:
/* rule 488 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <bypassASroute> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 489:
/* rule 489 can match eol */
YY_RULE_SETUP
surfxml_bypassASroute_gw___dst_isset = 0;
ENTER(AL_surfxml_bypassASroute); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 490:
/* rule 490 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 491:
/* rule 491 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 492:
/* rule 492 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 493:
/* rule 493 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 494:
/* rule 494 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 495:
/* rule 495 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 496:
/* rule 496 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 497:
/* rule 497 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 498:
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 499:
YY_RULE_SETUP
{
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 500:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of bypassASroute element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 501:
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 502:
/* rule 502 can match eol */
case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 503:
/* rule 503 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</bypassASroute>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 504:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</bypassASroute>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_bypassASroute):
case YY_STATE_EOF(S_surfxml_bypassASroute_2):
case YY_STATE_EOF(S_surfxml_bypassASroute):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</bypassASroute>' expected.");
- YY_BREAK
+ YY_BREAK
case 505:
/* rule 505 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <process> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 506:
/* rule 506 can match eol */
YY_RULE_SETUP
surfxml_process_on___failure_isset = 0;
ENTER(AL_surfxml_process); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 507:
/* rule 507 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 508:
/* rule 508 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 509:
/* rule 509 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 510:
/* rule 510 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 511:
/* rule 511 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 512:
/* rule 512 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 513:
/* rule 513 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 514:
/* rule 514 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 515:
/* rule 515 can match eol */
case 516:
/* rule 516 can match eol */
YY_RULE_SETUP
A_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE;
- YY_BREAK
+ YY_BREAK
case 517:
/* rule 517 can match eol */
case 518:
/* rule 518 can match eol */
YY_RULE_SETUP
A_surfxml_process_on___failure = A_surfxml_process_on___failure_RESTART;
- YY_BREAK
+ YY_BREAK
case 519:
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 520:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 521:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of process element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 522:
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 523:
/* rule 523 can match eol */
case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_4: case S_surfxml_platform_6: case S_surfxml_platform_7: case S_surfxml_platform_8: SET(S_surfxml_platform_8); break;
}
}
- YY_BREAK
+ YY_BREAK
case 524:
/* rule 524 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</process>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 525:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</process>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(S_surfxml_process):
case YY_STATE_EOF(E_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 526:
/* rule 526 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <argument> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 527:
/* rule 527 can match eol */
YY_RULE_SETUP
surfxml_argument_value_isset = 0;
ENTER(AL_surfxml_argument); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 528:
/* rule 528 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 529:
/* rule 529 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 530:
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 531:
YY_RULE_SETUP
{
case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 532:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of argument element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 533:
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 534:
/* rule 534 can match eol */
case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 535:
/* rule 535 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</argument>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 536:
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 537:
/* rule 537 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <config> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 538:
/* rule 538 can match eol */
YY_RULE_SETUP
surfxml_config_id_isset = 0;
ENTER(AL_surfxml_config); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 539:
/* rule 539 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 540:
/* rule 540 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 541:
YY_RULE_SETUP
{
LEAVE; STag_surfxml_config();surfxml_pcdata_ix = 0; ENTER(S_surfxml_config);
}
- YY_BREAK
+ YY_BREAK
case 542:
YY_RULE_SETUP
{
case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 543:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of config element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 544:
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 545:
/* rule 545 can match eol */
case S_surfxml_platform: case S_surfxml_platform_2: case S_surfxml_platform_3: SET(S_surfxml_platform_3); break;
}
}
- YY_BREAK
+ YY_BREAK
case 546:
/* rule 546 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</config>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 547:
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 548 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <prop> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 549:
/* rule 549 can match eol */
YY_RULE_SETUP
surfxml_prop_value_isset = 0;
ENTER(AL_surfxml_prop); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 550:
/* rule 550 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 551:
/* rule 551 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 552:
/* rule 552 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 553:
/* rule 553 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 554:
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 555:
YY_RULE_SETUP
{
case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 556:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of prop element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 557:
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 558:
/* rule 558 can match eol */
case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 559:
/* rule 559 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</prop>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 560:
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
/* <!-- <!ATTLIST model_prop key CDATA #REQUIRED> -->
* <!-- <!ATTLIST model_prop key CDATA #REQUIRED> --> */
/* rule 561 can match eol */
YY_RULE_SETUP
FAIL("Starting tag <model_prop> is not allowed here.");
- YY_BREAK
+ YY_BREAK
case 562:
/* rule 562 can match eol */
YY_RULE_SETUP
surfxml_model___prop_value_isset = 0;
ENTER(AL_surfxml_model___prop); pushbuffer(0);
}
- YY_BREAK
+ YY_BREAK
case 563:
/* rule 563 can match eol */
YY_RULE_SETUP
if (surfxml_model___prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_model___prop>");} surfxml_model___prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_model___prop_id);
- YY_BREAK
+ YY_BREAK
case 564:
/* rule 564 can match eol */
YY_RULE_SETUP
if (surfxml_model___prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_model___prop>");} surfxml_model___prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_model___prop_id);
- YY_BREAK
+ YY_BREAK
case 565:
/* rule 565 can match eol */
YY_RULE_SETUP
if (surfxml_model___prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_model___prop>");} surfxml_model___prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_model___prop_value);
- YY_BREAK
+ YY_BREAK
case 566:
/* rule 566 can match eol */
YY_RULE_SETUP
if (surfxml_model___prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_model___prop>");} surfxml_model___prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_model___prop_value);
- YY_BREAK
+ YY_BREAK
case 567:
YY_RULE_SETUP
{
if (!AX_surfxml_model___prop_value) FAIL("Required attribute `value' not set for `model_prop' element.");
LEAVE; STag_surfxml_model___prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_model___prop);
}
- YY_BREAK
+ YY_BREAK
case 568:
YY_RULE_SETUP
{
case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 569:
YY_RULE_SETUP
FAIL("Unexpected character `%c' in attribute list of model_prop element.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 570:
YY_RULE_SETUP
FAIL("Bad attribute `%s' in `model_prop' element start tag.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(AL_surfxml_model___prop):
FAIL("EOF in attribute list of `model_prop' element.");
- YY_BREAK
+ YY_BREAK
case 571:
/* rule 571 can match eol */
case S_surfxml_storage___type: case S_surfxml_storage___type_1: case S_surfxml_storage___type_2: SET(S_surfxml_storage___type_2); break;
}
}
- YY_BREAK
+ YY_BREAK
case 572:
/* rule 572 can match eol */
YY_RULE_SETUP
FAIL("Unexpected end-tag `%s': `</model_prop>' expected.",surf_parse_text);
- YY_BREAK
+ YY_BREAK
case 573:
YY_RULE_SETUP
FAIL("Unexpected character `%c': `</model_prop>' expected.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(E_surfxml_model___prop):
if(!ETag_surfxml_include_state()) FAIL("Premature EOF: `</model_prop>' expected.");
- YY_BREAK
+ YY_BREAK
/* EPILOG: after the root element. */
case 574:
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 575:
YY_RULE_SETUP
BUFFERPUTC('&');
- YY_BREAK
+ YY_BREAK
case 576:
YY_RULE_SETUP
BUFFERPUTC('<');
- YY_BREAK
+ YY_BREAK
case 577:
YY_RULE_SETUP
BUFFERPUTC('>');
- YY_BREAK
+ YY_BREAK
case 578:
YY_RULE_SETUP
BUFFERPUTC('\'');
- YY_BREAK
+ YY_BREAK
case 579:
YY_RULE_SETUP
BUFFERPUTC('"');
- YY_BREAK
+ YY_BREAK
/* Character entities. */
case 580:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)atoi(surf_parse_text+2));
- YY_BREAK
+ YY_BREAK
case 581:
YY_RULE_SETUP
BUFFERPUTC((unsigned char)strtol(surf_parse_text+3,NULL,16));
- YY_BREAK
+ YY_BREAK
case 582:
/* rule 582 can match eol */
/* rule 585 can match eol */
YY_RULE_SETUP
BUFFERPUTC('\n');
- YY_BREAK
+ YY_BREAK
case 586:
YY_RULE_SETUP
ENTER(CDATA);
- YY_BREAK
+ YY_BREAK
case 587:
YY_RULE_SETUP
FAIL("Unexpected `]""]>' in character data.");
- YY_BREAK
+ YY_BREAK
case 588:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE1):
FAIL("EOF in literal (\"'\" expected).");
- YY_BREAK
+ YY_BREAK
case 589:
YY_RULE_SETUP
BUFFERDONE; LEAVE;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(VALUE2):
FAIL("EOF in literal (`\"' expected).");
- YY_BREAK
+ YY_BREAK
case 590:
/* rule 590 can match eol */
YY_RULE_SETUP
BUFFERPUTC(surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 591:
YY_RULE_SETUP
FAIL("Spurious `%c' in character data.",surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 592:
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 593:
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 594 can match eol */
YY_RULE_SETUP
FAIL("Syntax error on character `%c'.", surf_parse_text[0]);
- YY_BREAK
+ YY_BREAK
case 595:
YY_RULE_SETUP
ECHO;
- YY_BREAK
+ YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(S_surfxml_AS_2):
case YY_STATE_EOF(S_surfxml_AS_5):
case YY_STATE_EOF(S_surfxml_storage_1):
case YY_STATE_EOF(S_surfxml_storage___type_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 */
- } /* end of user's declarations */
+ 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 user's declarations */
} /* 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)
{
- char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- char *source = (yytext_ptr);
- 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
- {
- yy_size_t 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_LVALUE;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- yy_size_t 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), 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];
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ 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
+ {
+ yy_size_t 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_LVALUE;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ yy_size_t 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), 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];
- return ret_val;
+ 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)
{
- yy_state_type yy_current_state;
- char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- 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 >= 3466 )
- 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 )
+ {
+ 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 >= 3466 )
+ 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 )
{
- int yy_is_jam;
- char *yy_cp = (yy_c_buf_p);
-
- 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 >= 3466 )
- 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 == 3465);
-
- return yy_is_jam ? 0 : yy_current_state;
+ int yy_is_jam;
+ char *yy_cp = (yy_c_buf_p);
+
+ 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 >= 3466 )
+ 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 == 3465);
+
+ 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 */
- yy_size_t 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 */
+ yy_size_t 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 );
}
/* Initializes or reinitializes a buffer.
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)
{
- yy_size_t num_to_alloc;
+ yy_size_t 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, yy_size_t _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- yy_size_t i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ yy_size_t 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 )
{
- int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ 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 )
{
- int n;
- for ( n = 0; s[n]; ++n )
- ;
+ 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);
*********/
StorageModel::StorageModel()
- : Model()
+ : Model()
{
p_storageList = NULL;
}
* @details A Storage represent a storage unit (e.g.: hard drive, usb key)
*/
class Storage : public simgrid::surf::Resource,
- public simgrid::surf::PropertyHolder {
+ public simgrid::surf::PropertyHolder {
public:
/**
* @brief Storage constructor
double bwrite, double bconnection, const char* type_id, char *content_name,
char *content_type, sg_size_t size, char *attach)
: Storage(model, name, properties,
- maxminSystem, bread, bwrite, bconnection, type_id, content_name, content_type, size, attach) {
+ maxminSystem, bread, bwrite, bconnection, type_id, content_name, content_type, size, attach) {
XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size);
}
StorageAction *write_action;
unsigned int i;
xbt_dynar_foreach(p_writeActions, i, _write_action) {
- write_action = static_cast<StorageAction*>(_write_action);
+ write_action = static_cast<StorageAction*>(_write_action);
if ((write_action->p_file) == fd) {
xbt_dynar_cursor_rm(p_writeActions, &i);
write_action->unref();
StorageN11Action::StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type)
: StorageAction(model, cost, failed,
- lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3),
- storage, type) {
+ lmm_variable_new(model->getMaxminSystem(), this, 1.0, -1.0 , 3),
+ storage, type) {
XBT_IN("(%s,%g", storage->getName(), cost);
// Must be less than the max bandwidth for all actions
{
m_refcount--;
if (!m_refcount) {
- if (action_hook.is_linked())
- p_stateSet->erase(p_stateSet->iterator_to(*this));
+ if (action_hook.is_linked())
+ p_stateSet->erase(p_stateSet->iterator_to(*this));
if (getVariable())
lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
xbt_free(getCategory());
StorageN11Model();
~StorageN11Model();
Storage *createStorage(const char* id, const char* type_id,
- const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
+ const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
void addTraces(){DIE_IMPOSSIBLE;}
double shareResources(double now);
void updateActionsState(double now, double delta);
class StorageN11 : public Storage {
public:
StorageN11(StorageModel *model, const char* name, xbt_dict_t properties,
- lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
- const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
+ lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
+ const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
StorageAction *open(const char* mount, const char* path);
StorageAction *close(surf_file_t fd);
XBT_DEBUG("Looking for next event in physical models");
double next_event_phy = surf_host_model->shareResources(NOW);
if ((surf_min < 0.0 || next_event_phy < surf_min) && next_event_phy >= 0.0) {
- surf_min = next_event_phy;
+ surf_min = next_event_phy;
}
if (surf_vm_model != NULL) {
- XBT_DEBUG("Looking for next event in virtual models");
- double next_event_virt = surf_vm_model->shareResources(NOW);
- if ((surf_min < 0.0 || next_event_virt < surf_min) && next_event_virt >= 0.0)
- surf_min = next_event_virt;
+ XBT_DEBUG("Looking for next event in virtual models");
+ double next_event_virt = surf_vm_model->shareResources(NOW);
+ if ((surf_min < 0.0 || next_event_virt < surf_min) && next_event_virt >= 0.0)
+ surf_min = next_event_virt;
}
XBT_DEBUG("Min for resources (remember that NS3 don't update that value): %f", surf_min);
// Inform the models of the date change
xbt_dynar_foreach(all_existing_models, iter, model) {
- model->updateActionsState(NOW, surf_min);
+ model->updateActionsState(NOW, surf_min);
}
TRACE_paje_dump_buffer (0);
surf_action_t surf_model_extract_done_action_set(surf_model_t model){
if (model->getDoneActionSet()->empty())
- return NULL;
+ return NULL;
surf_action_t res = &model->getDoneActionSet()->front();
model->getDoneActionSet()->pop_front();
return res;
surf_action_t surf_model_extract_failed_action_set(surf_model_t model){
if (model->getFailedActionSet()->empty())
- return NULL;
+ return NULL;
surf_action_t res = &model->getFailedActionSet()->front();
model->getFailedActionSet()->pop_front();
return res;
}
surf_action_t surf_host_sleep(sg_host_t host, double duration){
- return host->pimpl_cpu->sleep(duration);
+ return host->pimpl_cpu->sleep(duration);
}
void sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch) {
if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) {
fprintf(stderr,
- "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
- "and then linked against SimGrid %d.%d.%d. Please fix this.\n",
+ "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
+ "and then linked against SimGrid %d.%d.%d. Please fix this.\n",
SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH,
- lib_version_major,lib_version_minor,lib_version_patch);
+ lib_version_major,lib_version_minor,lib_version_patch);
abort();
}
if (lib_version_patch != SIMGRID_VERSION_PATCH) {
fprintf(stderr,
- "Warning: Your program was compiled with SimGrid version %d.%d.%d, "
- "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n",
+ "Warning: Your program was compiled with SimGrid version %d.%d.%d, "
+ "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n",
SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH,
- lib_version_major,lib_version_minor,lib_version_patch);
+ lib_version_major,lib_version_minor,lib_version_patch);
}
}
for (++it; it != itend; ++it) {
- action = &*it;
+ action = &*it;
value = lmm_variable_getvalue(action->getVariable());
if (value > 0) {
if (action->getRemains() > 0)
void Model::updateActionsState(double now, double delta)
{
if (p_updateMechanism == UM_FULL)
- updateActionsStateFull(now, delta);
+ updateActionsStateFull(now, delta);
else if (p_updateMechanism == UM_LAZY)
- updateActionsStateLazy(now, delta);
+ updateActionsStateLazy(now, delta);
else
- xbt_die("Invalid cpu update mechanism!");
+ xbt_die("Invalid cpu update mechanism!");
}
void Model::updateActionsStateLazy(double /*now*/, double /*delta*/)
// If dynar is is greater than netcard id and if the host_link is already defined
if((int)xbt_dynar_length(current_routing->p_linkUpDownList) > info->getId() &&
xbt_dynar_get_as(current_routing->p_linkUpDownList, info->getId(), void*))
- surf_parse_error("Host_link for '%s' is already defined!",netcard->id);
+ surf_parse_error("Host_link for '%s' is already defined!",netcard->id);
XBT_DEBUG("Push Host_link for host '%s' to position %d", info->getName(), info->getId());
xbt_dynar_set_as(current_routing->p_linkUpDownList, info->getId(), s_surf_parsing_link_up_down_t, link_up_down);
if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
current_routing->p_hierarchy = SURF_ROUTING_BASE;
xbt_assert(!sg_host_by_name(host->id),
- "Reading a host, processing unit \"%s\" already exists", host->id);
+ "Reading a host, processing unit \"%s\" already exists", host->id);
simgrid::surf::NetCard *netcard =
new simgrid::surf::NetCardImpl(xbt_strdup(host->id),
- -1,
- SURF_NETWORK_ELEMENT_HOST,
- current_routing);
+ -1,
+ SURF_NETWORK_ELEMENT_HOST,
+ current_routing);
netcard->setId(current_routing->parsePU(netcard));
sg_host_t h = sg_host_by_name_or_create(host->id);
h->pimpl_netcard = netcard;
memset(&host, 0, sizeof(host));
host.id = host_id;
if ((cluster->properties != NULL) && (!xbt_dict_is_empty(cluster->properties))) {
- xbt_dict_cursor_t cursor=NULL;
- char *key,*data;
- host.properties = xbt_dict_new();
+ xbt_dict_cursor_t cursor=NULL;
+ char *key,*data;
+ host.properties = xbt_dict_new();
- xbt_dict_foreach(cluster->properties,cursor,key,data) {
- xbt_dict_set(host.properties, key, xbt_strdup(data),free);
- }
+ xbt_dict_foreach(cluster->properties,cursor,key,data) {
+ xbt_dict_set(host.properties, key, xbt_strdup(data),free);
+ }
}
if (cluster->availability_trace && strcmp(cluster->availability_trace, "")) {
xbt_dict_set(patterns, "radical", bprintf("%d", i), NULL);
}
else {
static_cast<AsCluster*>(current_routing)->create_links_for_node(cluster, i, rankId, rankId*
- static_cast<AsCluster*>(current_routing)->p_nb_links_per_node
+ static_cast<AsCluster*>(current_routing)->p_nb_links_per_node
+ static_cast<AsCluster*>(current_routing)->p_has_loopback
+ static_cast<AsCluster*>(current_routing)->p_has_limiter );
}
simgrid::surf::NetCard *host_elm;
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
- simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
- host_elm = sg_netcard_by_name_or_null(storage->p_attach);
- if(!host_elm)
- surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
+ simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+ host_elm = sg_netcard_by_name_or_null(storage->p_attach);
+ if(!host_elm)
+ surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
}
}
}
RoutingPlatf::~RoutingPlatf()
{
- xbt_dynar_free(&p_lastRoute);
- finalize_rec(p_root);
+ xbt_dynar_free(&p_lastRoute);
+ finalize_rec(p_root);
}
}
/* Create the topology graph */
if(!p_routeGraph)
- p_routeGraph = xbt_graph_new_graph(1, NULL);
+ p_routeGraph = xbt_graph_new_graph(1, NULL);
if(!p_graphNodeMap)
p_graphNodeMap = xbt_dict_new_homogeneous(&graph_node_map_elem_free);
AsDijkstra();
AsDijkstra(bool cached);
~AsDijkstra();
- xbt_node_t routeGraphNewNode(int id, int graph_id);
- graph_node_map_element_t nodeMapSearch(int id);
- void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route);
+ xbt_node_t routeGraphNewNode(int id, int graph_id);
+ graph_node_map_element_t nodeMapSearch(int id);
+ void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route);
/**
* For each vertex (node) already in the graph,
* make sure it also has a loopback link; this loopback
* After this function returns, any node in the graph
* will have a loopback attached to it.
*/
- void addLoopback();
- void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override;
- xbt_dynar_t getOneLinkRoutes() override;
- void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype
- void parseASroute(sg_platf_route_cbarg_t route) override;
- void parseRoute(sg_platf_route_cbarg_t route) override;
- void end();
+ void addLoopback();
+ void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) override;
+ xbt_dynar_t getOneLinkRoutes() override;
+ void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); // FIXME: this function is dangerously not overriding because of diverging prototype
+ void parseASroute(sg_platf_route_cbarg_t route) override;
+ void parseRoute(sg_platf_route_cbarg_t route) override;
+ void end();
xbt_graph_t p_routeGraph = nullptr; /* xbt_graph */
xbt_dict_t p_graphNodeMap = nullptr; /* map */
int table_size;
table_size = (int)xbt_dynar_length(p_indexNetworkElm);
if (p_linkTable == NULL) // Dealing with a parse error in the file?
- return;
+ return;
/* Delete link_table */
for (i = 0; i < table_size; i++)
- for (j = 0; j < table_size; j++) {
- generic_free_route(TO_FLOYD_LINK(i, j));
- }
+ for (j = 0; j < table_size; j++) {
+ generic_free_route(TO_FLOYD_LINK(i, j));
+ }
xbt_free(p_linkTable);
/* Delete bypass dict */
xbt_dict_free(&p_bypassRoutes);
route->gw_src->getName(), src, route->gw_dst->getName());
TO_FLOYD_LINK(dst_net_elm->getId(), src_net_elm->getId()) =
- newExtendedRoute(p_hierarchy, route, 0);
+ newExtendedRoute(p_hierarchy, route, 0);
TO_FLOYD_PRED(dst_net_elm->getId(), src_net_elm->getId()) = dst_net_elm->getId();
TO_FLOYD_COST(dst_net_elm->getId(), src_net_elm->getId()) =
((TO_FLOYD_LINK(dst_net_elm->getId(), src_net_elm->getId()))->link_list)->used; /* count of links, old model assume 1 */
void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
Onelink *onelink;
if (p_hierarchy == SURF_ROUTING_BASE) {
- NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t);
+ NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t);
tmp_src->setId(src);
- NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t);
- tmp_dst->setId(dst);
+ NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t);
+ tmp_dst->setId(dst);
onelink = new Onelink(link, tmp_src, tmp_dst);
} else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
onelink = new Onelink(link, route->gw_src, route->gw_dst);
XBT_DEBUG("Load ASroute from \"%s\" to \"%s\"", src, dst);
if (!route->gw_src ||
route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL)
- surf_parse_error("The src_gateway \"%s\" does not exist!",
+ surf_parse_error("The src_gateway \"%s\" does not exist!",
route->gw_src ? route->gw_src->getName() : "(null)");
if (!route->gw_dst ||
route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL)
- surf_parse_error("The dst_gateway \"%s\" does not exist!",
+ surf_parse_error("The dst_gateway \"%s\" does not exist!",
route->gw_dst ? route->gw_dst->getName() : "(null)");
XBT_DEBUG("ASroute goes from \"%s\" to \"%s\"",
route->gw_src->getName(), route->gw_dst->getName());
sg_platf_route_cbarg_t new_e_route = NULL;
if (e_route_bypass) {
- Link* link;
+ Link* link;
unsigned int cpt = 0;
new_e_route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
new_e_route->gw_src = e_route_bypass->gw_src;
void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*edges*/)
{
- XBT_INFO("No routing no graph");
+ XBT_INFO("No routing no graph");
}
sg_platf_route_cbarg_t AsNone::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) {
s_surf_parsing_link_up_down_t info;
XBT_DEBUG("vivaldi_get_route_and_latency from '%s'[%d] '%s'[%d]",
- src->getName(), src->getId(), dst->getName(), dst->getId());
+ src->getName(), src->getId(), dst->getName(), dst->getId());
if(src->getRcType() == SURF_NETWORK_ELEMENT_AS) {
char *src_name = ROUTER_PEER(src->getName());
XBT_DEBUG("Buffer: %s", buf);
host.speed_peak = xbt_dynar_new(sizeof(double), NULL);
if (strchr(buf, ',') == NULL){
- double speed = parse_cpu_speed(A_surfxml_host_power);
- xbt_dynar_push_as(host.speed_peak,double, speed);
+ double speed = parse_cpu_speed(A_surfxml_host_power);
+ xbt_dynar_push_as(host.speed_peak,double, speed);
}
else {
- xbt_dynar_t pstate_list = xbt_str_split(buf, ",");
- unsigned int i;
- for (i = 0; i < xbt_dynar_length(pstate_list); i++) {
- double speed;
- char* speed_str;
-
- xbt_dynar_get_cpy(pstate_list, i, &speed_str);
- xbt_str_trim(speed_str, NULL);
- speed = parse_cpu_speed(speed_str);
- xbt_dynar_push_as(host.speed_peak, double, speed);
- XBT_DEBUG("Speed value: %f", speed);
- }
- xbt_dynar_free(&pstate_list);
+ xbt_dynar_t pstate_list = xbt_str_split(buf, ",");
+ unsigned int i;
+ for (i = 0; i < xbt_dynar_length(pstate_list); i++) {
+ double speed;
+ char* speed_str;
+
+ xbt_dynar_get_cpy(pstate_list, i, &speed_str);
+ xbt_str_trim(speed_str, NULL);
+ speed = parse_cpu_speed(speed_str);
+ xbt_dynar_push_as(host.speed_peak, double, speed);
+ XBT_DEBUG("Speed value: %f", speed);
+ }
+ xbt_dynar_free(&pstate_list);
}
XBT_DEBUG("pstate: %s", A_surfxml_host_pstate);
static int after_config_done;
void parse_after_config() {
if (!after_config_done) {
- TRACE_start();
+ TRACE_start();
/* Register classical callbacks */
storage_register_callbacks();
* @param host The host
*/
VirtualMachine(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props,
- simgrid::s4u::Host *host);
+ simgrid::s4u::Host *host);
/** @brief Destructor */
~VirtualMachine();
XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
this, typeid(surf_cpu_model_pm ).name(), min_by_cpu,
- typeid(surf_network_model).name(), min_by_net,
+ typeid(surf_network_model).name(), min_by_net,
typeid(surf_storage_model).name(), min_by_sto);
double ret = std::max(std::max(min_by_cpu, min_by_net), min_by_sto);
if (min_by_cpu >= 0.0 && min_by_cpu < ret)
- ret = min_by_cpu;
+ ret = min_by_cpu;
if (min_by_net >= 0.0 && min_by_net < ret)
- ret = min_by_net;
+ ret = min_by_net;
if (min_by_sto >= 0.0 && min_by_sto < ret)
- ret = min_by_sto;
+ ret = min_by_sto;
return ret;
}
/* 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_parser_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_automaton_parser_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_parser_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_parser_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.
- */
- yy_size_t 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.
+ */
+ yy_size_t 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_parser_restart()), so that the user can continue scanning by
- * just pointing xbt_automaton_parser_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_parser_restart()), so that the user can continue scanning by
+ * just pointing xbt_automaton_parser_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_parser_text is formed. */
static char yy_hold_char;
-static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t xbt_automaton_parser_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_parser_wrap()'s to do buffer switches
* instead of setting up a fresh xbt_automaton_parser_in. A bit of a hack ...
#define yy_new_buffer xbt_automaton_parser__create_buffer
#define yy_set_interactive(is_interactive) \
- { \
- if ( ! YY_CURRENT_BUFFER ){ \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
xbt_automaton_parser_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_automaton_parser__create_buffer(xbt_automaton_parser_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_parser_ensure_buffer_stack (); \
- YY_CURRENT_BUFFER_LVALUE = \
+ YY_CURRENT_BUFFER_LVALUE = \
xbt_automaton_parser__create_buffer(xbt_automaton_parser_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_parser_text.
*/
#define YY_DO_BEFORE_ACTION \
- (yytext_ptr) = yy_bp; \
- xbt_automaton_parser_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_parser_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_parser_in )) != EOF && c != '\n'; ++n ) \
- buf[n] = (char) c; \
- if ( c == '\n' ) \
- buf[n++] = (char) c; \
- if ( c == EOF && ferror( xbt_automaton_parser_in ) ) \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- result = n; \
- } \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, xbt_automaton_parser_in))==0 && ferror(xbt_automaton_parser_in)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(xbt_automaton_parser_in); \
- } \
- }\
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( xbt_automaton_parser_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( xbt_automaton_parser_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, xbt_automaton_parser_in))==0 && ferror(xbt_automaton_parser_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(xbt_automaton_parser_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;
- 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_parser_in )
- xbt_automaton_parser_in = stdin;
+ if ( ! xbt_automaton_parser_in )
+ xbt_automaton_parser_in = stdin;
- if ( ! xbt_automaton_parser_out )
- xbt_automaton_parser_out = stdout;
+ if ( ! xbt_automaton_parser_out )
+ xbt_automaton_parser_out = stdout;
- if ( ! YY_CURRENT_BUFFER ) {
- xbt_automaton_parser_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
- xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE );
- }
+ if ( ! YY_CURRENT_BUFFER ) {
+ xbt_automaton_parser_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE );
+ }
- xbt_automaton_parser__load_buffer_state( );
- }
+ xbt_automaton_parser__load_buffer_state( );
+ }
- {
+ {
#line 45 "parserPromela.lex"
#line 766 "automaton_lexer.yy.c"
- 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_parser_text. */
- *yy_cp = (yy_hold_char);
+ /* Support of xbt_automaton_parser_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 47 "parserPromela.lex"
{ return (NEVER); }
- YY_BREAK
+ YY_BREAK
case 2:
YY_RULE_SETUP
#line 48 "parserPromela.lex"
{ return (IF); }
- YY_BREAK
+ YY_BREAK
case 3:
YY_RULE_SETUP
#line 49 "parserPromela.lex"
{ return (FI); }
- YY_BREAK
+ YY_BREAK
case 4:
YY_RULE_SETUP
#line 50 "parserPromela.lex"
{ return (IMPLIES); }
- YY_BREAK
+ YY_BREAK
case 5:
YY_RULE_SETUP
#line 51 "parserPromela.lex"
{ return (GOTO); }
- YY_BREAK
+ YY_BREAK
case 6:
YY_RULE_SETUP
#line 52 "parserPromela.lex"
{ return (AND); }
- YY_BREAK
+ YY_BREAK
case 7:
YY_RULE_SETUP
#line 53 "parserPromela.lex"
{ return (OR); }
- YY_BREAK
+ YY_BREAK
case 8:
YY_RULE_SETUP
#line 54 "parserPromela.lex"
{ return (NOT); }
- YY_BREAK
+ YY_BREAK
case 9:
YY_RULE_SETUP
#line 55 "parserPromela.lex"
{ return (LEFT_PAR); }
- YY_BREAK
+ YY_BREAK
case 10:
YY_RULE_SETUP
#line 56 "parserPromela.lex"
{ return (RIGHT_PAR); }
- YY_BREAK
+ YY_BREAK
case 11:
YY_RULE_SETUP
#line 57 "parserPromela.lex"
{ return (CASE); }
- YY_BREAK
+ YY_BREAK
case 12:
YY_RULE_SETUP
#line 58 "parserPromela.lex"
{ return (COLON); }
- YY_BREAK
+ YY_BREAK
case 13:
YY_RULE_SETUP
#line 59 "parserPromela.lex"
{ return (SEMI_COLON); }
- YY_BREAK
+ YY_BREAK
case 14:
YY_RULE_SETUP
#line 60 "parserPromela.lex"
{ return (CASE_TRUE); }
- YY_BREAK
+ YY_BREAK
case 15:
YY_RULE_SETUP
#line 61 "parserPromela.lex"
{ return (LEFT_BRACE); }
- YY_BREAK
+ YY_BREAK
case 16:
YY_RULE_SETUP
#line 62 "parserPromela.lex"
{ return (RIGHT_BRACE); }
- YY_BREAK
+ YY_BREAK
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 65 "parserPromela.lex"
{ }
- YY_BREAK
+ YY_BREAK
case 18:
YY_RULE_SETUP
#line 67 "parserPromela.lex"
{ }
- YY_BREAK
+ YY_BREAK
case 19:
YY_RULE_SETUP
#line 70 "parserPromela.lex"
{ sscanf(xbt_automaton_parser_text,"%lf",&yylval.real);
return (LITT_REEL); }
- YY_BREAK
+ YY_BREAK
case 20:
YY_RULE_SETUP
#line 73 "parserPromela.lex"
{ sscanf(xbt_automaton_parser_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_parser_text)+1);
sscanf(xbt_automaton_parser_text,"%s",yylval.string);
return (LITT_CHAINE); }
- YY_BREAK
+ YY_BREAK
case 22:
YY_RULE_SETUP
#line 80 "parserPromela.lex"
{ yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1);
sscanf(xbt_automaton_parser_text,"%s",yylval.string);
- return (ID); }
- YY_BREAK
+ return (ID); }
+ YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
#line 84 "parserPromela.lex"
{ }
- YY_BREAK
+ YY_BREAK
case 24:
YY_RULE_SETUP
#line 86 "parserPromela.lex"
{ }
- YY_BREAK
+ YY_BREAK
case 25:
YY_RULE_SETUP
#line 88 "parserPromela.lex"
ECHO;
- YY_BREAK
+ YY_BREAK
#line 957 "automaton_lexer.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_parser_in at a new source and called
- * xbt_automaton_parser_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_parser_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_parser_wrap( ) )
- {
- /* Note: because we've taken care in
- * yy_get_next_buffer() to have set up
- * xbt_automaton_parser_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 user's declarations */
+ 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_parser_in at a new source and called
+ * xbt_automaton_parser_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_parser_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_parser_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * xbt_automaton_parser_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 user's declarations */
} /* end of xbt_automaton_parser_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
- {
- yy_size_t 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_LVALUE;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- yy_size_t 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_parser_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), 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_parser_restart(xbt_automaton_parser_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_parser_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
+ {
+ yy_size_t 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_LVALUE;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ yy_size_t 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_parser_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), 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_parser_restart(xbt_automaton_parser_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_parser_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_parser_text */
- *yy_cp = (yy_hold_char);
+ /* undo effects of setting up xbt_automaton_parser_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 yy_size_t 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 yy_size_t 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 */
- yy_size_t 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_parser_restart(xbt_automaton_parser_in );
-
- /*FALLTHROUGH*/
-
- case EOB_ACT_END_OF_FILE:
- {
- if ( xbt_automaton_parser_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 */
+ yy_size_t 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_parser_restart(xbt_automaton_parser_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( xbt_automaton_parser_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_parser_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_parser_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_parser_restart (FILE * input_file )
{
- if ( ! YY_CURRENT_BUFFER ){
+ if ( ! YY_CURRENT_BUFFER ){
xbt_automaton_parser_ensure_buffer_stack ();
- YY_CURRENT_BUFFER_LVALUE =
+ YY_CURRENT_BUFFER_LVALUE =
xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE );
- }
+ }
- xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER,input_file );
- xbt_automaton_parser__load_buffer_state( );
+ xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER,input_file );
+ xbt_automaton_parser__load_buffer_state( );
}
/** Switch to a different input buffer.
void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
- /* TODO. We should be able to replace this entire function body
- * with
- * xbt_automaton_parser_pop_buffer_state();
- * xbt_automaton_parser_push_buffer_state(new_buffer);
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * xbt_automaton_parser_pop_buffer_state();
+ * xbt_automaton_parser_push_buffer_state(new_buffer);
*/
- xbt_automaton_parser_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_parser__load_buffer_state( );
-
- /* We don't actually know whether we did this switch during
- * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag
- * is looked at is after xbt_automaton_parser_wrap() is called, so it's safe
- * to go ahead and always set it.
- */
- (yy_did_buffer_switch_on_eof) = 1;
+ xbt_automaton_parser_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_parser__load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag
+ * is looked at is after xbt_automaton_parser_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_parser__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_parser_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_parser_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_parser__create_buffer (FILE * file, int size )
{
- YY_BUFFER_STATE b;
+ YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" );
+ b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__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_parser_alloc(b->yy_buf_size + 2 );
- if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__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_parser_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" );
- b->yy_is_our_buffer = 1;
+ b->yy_is_our_buffer = 1;
- xbt_automaton_parser__init_buffer(b,file );
+ xbt_automaton_parser__init_buffer(b,file );
- return b;
+ return b;
}
/** Destroy the buffer.
void xbt_automaton_parser__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_parser_free((void *) b->yy_ch_buf );
+ if ( b->yy_is_our_buffer )
+ xbt_automaton_parser_free((void *) b->yy_ch_buf );
- xbt_automaton_parser_free((void *) b );
+ xbt_automaton_parser_free((void *) b );
}
/* Initializes or reinitializes a buffer.
static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b, FILE * file )
{
- int oerrno = errno;
+ int oerrno = errno;
- xbt_automaton_parser__flush_buffer(b );
+ xbt_automaton_parser__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_parser__init_buffer was _probably_
* called from xbt_automaton_parser_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_parser__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_parser__load_buffer_state( );
+ if ( b == YY_CURRENT_BUFFER )
+ xbt_automaton_parser__load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
*/
void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
- if (new_buffer == NULL)
- return;
-
- xbt_automaton_parser_ensure_buffer_stack();
-
- /* This block is copied from xbt_automaton_parser__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_parser__switch_to_buffer. */
- xbt_automaton_parser__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
+ if (new_buffer == NULL)
+ return;
+
+ xbt_automaton_parser_ensure_buffer_stack();
+
+ /* This block is copied from xbt_automaton_parser__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_parser__switch_to_buffer. */
+ xbt_automaton_parser__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
*/
void xbt_automaton_parser_pop_buffer_state (void)
{
- if (!YY_CURRENT_BUFFER)
- return;
-
- xbt_automaton_parser__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_parser__load_buffer_state( );
- (yy_did_buffer_switch_on_eof) = 1;
- }
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ xbt_automaton_parser__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_parser__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
}
/* Allocates the stack if it does not exist.
*/
static void xbt_automaton_parser_ensure_buffer_stack (void)
{
- yy_size_t num_to_alloc;
+ yy_size_t 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_parser_alloc
- (num_to_alloc * sizeof(struct yy_buffer_state*)
- );
- if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_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_parser_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_parser_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_parser_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+ if ( ! (yy_buffer_stack) )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_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_parser_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_parser_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_parser__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_parser_alloc(sizeof( struct yy_buffer_state ) );
- if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__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_parser__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_parser_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__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_parser__switch_to_buffer(b );
+
+ return b;
}
/** Setup the input buffer state to scan a string. The next call to xbt_automaton_parser_lex() will
YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr )
{
- return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) );
+ return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parser_lex() will
*/
YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- yy_size_t i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ yy_size_t i;
- /* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) xbt_automaton_parser_alloc(n );
- if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_bytes()" );
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) xbt_automaton_parser_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__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_parser__scan_buffer(buf,n );
- if ( ! b )
- YY_FATAL_ERROR( "bad buffer in xbt_automaton_parser__scan_bytes()" );
+ b = xbt_automaton_parser__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in xbt_automaton_parser__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_parser_text. */ \
+ do \
+ { \
+ /* Undo effects of setting up xbt_automaton_parser_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \
- (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \
- (yy_hold_char) = *(yy_c_buf_p); \
- *(yy_c_buf_p) = '\0'; \
- xbt_automaton_parser_leng = yyless_macro_arg; \
- } \
- while ( 0 )
+ xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ xbt_automaton_parser_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_parser__delete_buffer(YY_CURRENT_BUFFER );
- YY_CURRENT_BUFFER_LVALUE = NULL;
- xbt_automaton_parser_pop_buffer_state();
- }
+ while(YY_CURRENT_BUFFER){
+ xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ xbt_automaton_parser_pop_buffer_state();
+ }
- /* Destroy the stack itself. */
- xbt_automaton_parser_free((yy_buffer_stack) );
- (yy_buffer_stack) = NULL;
+ /* Destroy the stack itself. */
+ xbt_automaton_parser_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_parser_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_parser_alloc (yy_size_t size )
{
- return (void *) malloc( size );
+ return (void *) malloc( size );
}
void *xbt_automaton_parser_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_parser_free (void * ptr )
{
- free( (char *) ptr ); /* see xbt_automaton_parser_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see xbt_automaton_parser_realloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
unw_context_t uc;
unw_getcontext (&uc);
- unw_init_local (&c, &uc);
+ unw_init_local (&c, &uc);
unw_word_t ip;
variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_boolean);
for (i = 0; xbt_cfgelm_boolean_values[i].true_val != NULL; i++) {
- if (strcmp(val, xbt_cfgelm_boolean_values[i].true_val) == 0){
- bval = 1;
- break;
- }
- if (strcmp(val, xbt_cfgelm_boolean_values[i].false_val) == 0){
- bval = 0;
- break;
- }
+ if (strcmp(val, xbt_cfgelm_boolean_values[i].true_val) == 0){
+ bval = 1;
+ break;
+ }
+ if (strcmp(val, xbt_cfgelm_boolean_values[i].false_val) == 0){
+ bval = 0;
+ break;
+ }
}
if (xbt_cfgelm_boolean_values[i].true_val == NULL) {
xbt_die("Value of option '%s' not valid. Should be a boolean (yes,no,on,off,true,false,0,1)", val);
xbt_free(thrower);
if (xbt_initialized==0 || smx_cleaned) {
- fprintf(stderr, "Ouch. SimGrid is not initialized yet, or already closing. No backtrace available.\n");
- return; /* Not started yet or already closing. Trying to generate a backtrace would probably fail */
+ fprintf(stderr, "Ouch. SimGrid is not initialized yet, or already closing. No backtrace available.\n");
+ return; /* Not started yet or already closing. Trying to generate a backtrace would probably fail */
}
if (!e->bt_strings)
/* 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.
- */
- yy_size_t 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.
+ */
+ yy_size_t 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 yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t 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;
}
assert(s && e && s <= e);
++s;
while (s < e) {
- if (isspace(*s)) {
- BUFFERPUTC(' ');
- do ++s; while (s < e && isspace(*s));
- } else
- BUFFERPUTC(*s++);
+ if (isspace(*s)) {
+ BUFFERPUTC(' ');
+ do ++s; while (s < e && isspace(*s));
+ } else
+ BUFFERPUTC(*s++);
}
} else {
const char *s = text;
while (*s)
- BUFFERPUTC(*s++);
+ BUFFERPUTC(*s++);
}
BUFFERDONE;
}
/* 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
{
- yy_state_type yy_current_state;
- char *yy_cp, *yy_bp;
- int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
- 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( );
+ }
- {
+ {
/* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
SET(PROLOG);
/* COMMENTS and PIs: handled uniformly for efficiency. */
- 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
- {
- 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
+ {
+ 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] )
- {
- yy_size_t 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] )
+ {
+ yy_size_t 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_graph);
- YY_BREAK
+ YY_BREAK
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
SET(ROOT_graphxml_edge);
- YY_BREAK
+ YY_BREAK
case 15:
/* rule 15 can match eol */
YY_RULE_SETUP
SET(ROOT_graphxml_node);
- 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):
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_1):
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 S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph_1: case S_graphxml_graph: case S_graphxml_graph_3: SET(S_graphxml_graph_5); 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 S_graphxml_graph_5: case S_graphxml_graph_4: case S_graphxml_graph_1: case S_graphxml_graph: case S_graphxml_graph_3: SET(S_graphxml_graph_5); 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 */
- } /* end of user's declarations */
+ 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 user's declarations */
} /* 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)
{
- char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- char *source = (yytext_ptr);
- 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
- {
- yy_size_t 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_LVALUE;
-
- int yy_c_buf_p_offset =
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
-
- if ( b->yy_is_our_buffer )
- {
- yy_size_t 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), 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];
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = (yytext_ptr);
+ 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
+ {
+ yy_size_t 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_LVALUE;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ yy_size_t 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), 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)
{
- yy_state_type yy_current_state;
- char *yy_cp;
-
- yy_current_state = (yy_start);
-
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
- {
- 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_state_type yy_current_state;
+ char *yy_cp;
+
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ 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 )
{
- int yy_is_jam;
- char *yy_cp = (yy_c_buf_p);
-
- 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;
+ int yy_is_jam;
+ char *yy_cp = (yy_c_buf_p);
+
+ 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;
-
- *(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 */
- yy_size_t 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;
+ 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 */
+ yy_size_t 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 );
}
/* Initializes or reinitializes a buffer.
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)
{
- yy_size_t num_to_alloc;
+ yy_size_t 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;
-
- 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;
+ 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;
}
/** 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, yy_size_t _yybytes_len )
{
- YY_BUFFER_STATE b;
- char *buf;
- yy_size_t n;
- yy_size_t i;
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ yy_size_t 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 )
{
- int i;
- for ( i = 0; i < n; ++i )
- s1[i] = s2[i];
+ 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 )
{
- int n;
- for ( n = 0; s[n]; ++n )
- ;
+ 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);
* @param key the key associated to this object
*/
void xbt_heap_rm_elm(xbt_heap_t H, void *content, double key) {
- int i=0;
- while (i < H->count && (KEY(H, i) != key || CONTENT(H, i) != content))
- i++;
- if (i == H->count)
- return;
- xbt_heap_remove(H,i);
+ int i=0;
+ while (i < H->count && (KEY(H, i) != key || CONTENT(H, i) != content))
+ i++;
+ if (i == H->count)
+ return;
+ xbt_heap_remove(H,i);
}
/**
XBT_DEBUG("Replace %p by %p element under key '%s:%d'",
elts[level], obj, key, level);
if (lib->free_f[level])
- lib->free_f[level](elts[level]);
+ lib->free_f[level](elts[level]);
}
elts[level] = obj;
}
if(i<XBT_LOG_STATIC_THRESHOLD){
fprintf(stderr,
- "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
- "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
- "while -DNLOG forbids any logging, at any level.",
+ "Priority '%s' (in setting '%s') is above allowed priority '%s'.\n\n"
+ "Compiling SimGrid with -DNDEBUG forbids the levels 'trace' and 'debug'\n"
+ "while -DNLOG forbids any logging, at any level.",
eq + 1, name, xbt_log_priority_names[XBT_LOG_STATIC_THRESHOLD]);
exit(1);
}else if (i < xbt_log_priority_infinite) {
if (!strncmp(neweq, "file:", 5)) {
set->appender = xbt_log_appender_file_new(neweq + 5);
}else if (!strncmp(neweq, "rollfile:", 9)) {
- set->appender = xbt_log_appender2_file_new(neweq + 9,1);
+ set->appender = xbt_log_appender2_file_new(neweq + 9,1);
}else if (!strncmp(neweq, "splitfile:", 10)) {
- set->appender = xbt_log_appender2_file_new(neweq + 10,0);
+ set->appender = xbt_log_appender2_file_new(neweq + 10,0);
} else {
THROWF(arg_error, 0, "Unknown appender log type: '%s'", neweq);
}
*/
char *xbt_dirname(const char *path) {
#if _MSC_VER
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
- errno_t err;
- err = _splitpath_s(path, drive, _MAX_DRIVE, dir, _MAX_DIR, NULL,0, NULL,0);
- return bprintf("%s%s",drive,dir);
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ errno_t err;
+ err = _splitpath_s(path, drive, _MAX_DRIVE, dir, _MAX_DIR, NULL,0, NULL,0);
+ return bprintf("%s%s",drive,dir);
#else
- return dirname(xbt_strdup(path));
+ return dirname(xbt_strdup(path));
#endif
}
/** @brief Returns the file component of a path (reimplementation of POSIX basename)
*/
char *xbt_basename(const char *path) {
#if _MSC_VER
- char file[1024];
- char ext[1024];
- errno_t err;
- err = _splitpath_s(path, NULL,0, NULL,0, file,1024, ext,1024);
- return bprintf("%s.%s",file,ext);
+ char file[1024];
+ char ext[1024];
+ errno_t err;
+ err = _splitpath_s(path, NULL,0, NULL,0, file,1024, ext,1024);
+ return bprintf("%s.%s",file,ext);
#else
- return basename(xbt_strdup(path));
+ return basename(xbt_strdup(path));
#endif
}
int _xbt_replay_action_init(void)
{
if (xbt_action_funs)
- return 0;
+ return 0;
is_replay_active = 1;
xbt_action_funs = xbt_dict_new_homogeneous(NULL);
xbt_action_queues = xbt_dict_new_homogeneous(NULL);
{
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
const char *platform_file = argv[1];
const char *application_file = argv[2];
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n",
- argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
platform_file = argv[1];
application_file = argv[2];
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
platform_file = argv[1];
application_file = argv[2];
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
platform_file = argv[1];
application_file = argv[2];
MSG_init(&argc, argv);
xbt_assert(argc == 3, "Usage: %s platform_file deployment_file\n"
- "\n Example: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+ "\n Example: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
platform_file = argv[1];
application_file = argv[2];
if (xbt_dict_length(props) > 0){
XBT_INFO("\tProperties of mounted storage: %s", MSG_storage_get_name(storage));
xbt_dict_foreach(props, cursor, key, data)
- XBT_INFO("\t\t'%s' -> '%s'", key, data);
+ XBT_INFO("\t\t'%s' -> '%s'", key, data);
}else{
- XBT_INFO("\tNo property attached.");
+ XBT_INFO("\tNo property attached.");
}
}
int host(int argc, char *argv[])
{
- char name[2048];
- sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID());
- msg_file_t file = MSG_file_open(name, NULL);
- //MSG_file_read(file, MSG_file_get_size(file));
- MSG_file_write(file, 500000);
+ char name[2048];
+ sprintf(name,"%s%i", FILENAME1,MSG_process_self_PID());
+ msg_file_t file = MSG_file_open(name, NULL);
+ //MSG_file_read(file, MSG_file_get_size(file));
+ MSG_file_write(file, 500000);
- XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file));
- MSG_file_close(file);
+ XBT_INFO("Size of %s: %llu", MSG_file_get_name(file), MSG_file_get_size(file));
+ MSG_file_close(file);
- return 1;
+ return 1;
}
MSG_function_register("host", host);
storage_info(MSG_host_by_name(xbt_strdup("host")));
for(i = 0 ; i<10; i++){
- MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host")));
+ MSG_process_create(xbt_strdup("host"), host, NULL, MSG_host_by_name(xbt_strdup("host")));
}
if (xbt_dict_length(props) > 0){
XBT_INFO("\tProperties of mounted storage: %s", MSG_storage_get_name(storage));
xbt_dict_foreach(props, cursor, key, data)
- XBT_INFO("\t\t'%s' -> '%s'", key, data);
+ XBT_INFO("\t\t'%s' -> '%s'", key, data);
}else{
- XBT_INFO("\tNo property attached.");
+ XBT_INFO("\tNo property attached.");
}
}
MSG_task_execute(task);
end = MSG_get_clock();
XBT_INFO("Task \"%s\" done in %f (amount %f)"
- , MSG_task_get_name(task)
- , end - start
- , MSG_task_get_flops_amount(task));
+ , MSG_task_get_name(task)
+ , end - start
+ , MSG_task_get_flops_amount(task));
MSG_task_destroy(task);
task = NULL;
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
platform_file = argv[1];
application_file = argv[2];
"SimDag test basic_link_test");
static int cmp_link(const void*a, const void*b) {
- const char *nameA = sg_link_name(*(SD_link_t*)a);
- const char *nameB = sg_link_name(*(SD_link_t*)b);
+ const char *nameA = sg_link_name(*(SD_link_t*)a);
+ const char *nameB = sg_link_name(*(SD_link_t*)b);
return strcmp( nameA, nameB );
}
MPI_Comm_rank( comm, &rank );
sendbuf = (int *) malloc( size * sizeof(int) );
for (i=0; i<size; i++)
- sendbuf[i] = rank + i;
+ sendbuf[i] = rank + i;
recvcounts = (int *)malloc( size * sizeof(int) );
recvbuf = (int *)malloc( size * sizeof(int) );
for (i=0; i<size; i++)
sumval = size * rank + ((size - 1) * size)/2;
/* recvbuf should be size * (rank + i) */
if (recvbuf[0] != sumval) {
- err++;
- fprintf( stdout, "Did not get expected value for reduce scatter\n" );
- fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval );
+ err++;
+ fprintf( stdout, "Did not get expected value for reduce scatter\n" );
+ fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval );
}
MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
if (rank == 0 && toterr == 0) {
- printf( " No Errors\n" );
+ printf( " No Errors\n" );
}
free(sendbuf);
free(recvcounts);
return 0; // SUCCESS
} else {
if (error)
- printf("Error while checking for dlsym: %s\n",error);
+ printf("Error while checking for dlsym: %s\n",error);
else
- printf("dlsym did not return any error, but failed to find malloc()\n");
+ printf("dlsym did not return any error, but failed to find malloc()\n");
return 1; // FAILED
}
}