1 /* Copyright (c) 2009 Da SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "simdag/simdag.h"
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_daxparse, sd,"Parsing DAX files");
17 static YY_BUFFER_STATE input_buffer;
19 static xbt_dynar_t result;
21 static void SD_task_free(void*t){
25 xbt_dynar_t SD_daxload(const char*filename) {
26 FILE* in_file = fopen(filename,"r");
27 xbt_assert1(in_file, "Unable to open \"%s\"\n", filename);
29 dax__create_buffer(in_file, 10);
30 dax__switch_to_buffer(input_buffer);
33 result = xbt_dynar_new(sizeof(SD_task_t),SD_task_free);
34 xbt_assert2(!dax_lex(),"Parse error in %s: %s",filename,dax__parse_err_msg());
35 dax__delete_buffer(input_buffer);
40 void STag_dax__adag(void) {
44 sscanf(A_dax__adag_version, "%lg", &version);
46 xbt_assert1((version == 2.1), "Expected version 2.1, got %f. Fix the parser or your file",version);
48 void STag_dax__job(void) {
51 void STag_dax__child(void) {
54 void STag_dax__parent(void) {
55 INFO0("See <parent>");
57 void STag_dax__uses(void) {
60 void ETag_dax__adag(void) {
63 void ETag_dax__job(void) {
66 void ETag_dax__child(void) {
67 INFO0("See </child>");
69 void ETag_dax__parent(void) {
70 INFO0("See </parent>");
72 void ETag_dax__uses(void) {