Revision 1509 trunk/src/nh99/tpl2cpp.lex

tpl2cpp.lex (revision 1509)
129 129
  int filename_size;
130 130
%}
131 131

  
132
filename \"[^\"]*\"

133
filenamesingle \'[^\']*\'

132
filename \"[^\"]*\"
133
filenamesingle \'[^\']*\'
134 134

  
135 135
name [a-z_A-Z]+(->)?[a-z_A-Z0-9]*
136 136

  
......
692 692
    BEGIN IN_MATRIX_DEF;
693 693
    fprintf(fdat,"%s","  data_matrix ");
694 694
                     }
695
<DEFINE_DATA>init_table {

695
<DEFINE_DATA>init_table {
696 696
    likelihood_found=1;
697
    BEGIN IN_TABLE_DEF;

698
    fprintf(fdat,"%s","  data_matrix ");

699
                     }

697
    BEGIN IN_TABLE_DEF;
698
    fprintf(fdat,"%s","  data_matrix ");
699
                     }
700 700

  
701 701
<DEFINE_DATA>init_3darray {
702 702
    likelihood_found=1;
......
1621 1621
                            }
1622 1622

  
1623 1623

  
1624
<INIT_BOUNDED_NUMBER_DEF>({name}\({float_num_exp},{float_num_exp},{num_exp}\)) {
1624
<INIT_BOUNDED_NUMBER_DEF>({name}\({float_num_exp},{float_num_exp},{num_exp}\)) |
1625
<INIT_BOUNDED_NUMBER_DEF>({name}\({name}\)) {
1625 1626

  
1627

  
1626 1628
    before_part(tmp_string,yytext,'(');  // get x in x(1,4)
1627 1629
    fprintf(fdat,"%s",tmp_string);
1628 1630
    fprintf(fall,"  %s",tmp_string);
......
2294 2296
    }
2295 2297
                            }
2296 2298

  
2297
<IN_TABLE_DEF>{name}\({filename}\) {

2298

  
2299
    before_part(tmp_string,yytext,'(');  // get A in A("mat.tab")

2300
 
2301
    fprintf(fdat,"%s",tmp_string);

2302
    fprintf(fdat,"%s",";\n");

2303
 
2304
    fprintf(fall,"  %s",tmp_string);

2305
    fprintf(fall,".allocate(0,-1,0,-1,\"%s\");\n",tmp_string);

2306
    after_part(tmp_string1,yytext,'\"');

2307
    fprintf(fall,"  dmatrix %s_tmp((adstring)%s;\n",tmp_string,tmp_string1);

2308
    fprintf(fall,"  %s = %s_tmp;\n",tmp_string,tmp_string);

2309
    if (needs_initialization)

2310
    {

2311
      needs_initialization=0;

2312
    }

2313
    if (!params_defined)

2314
    {

2299
<IN_TABLE_DEF>{name}\({filename}\) {
2300

  
2301
    before_part(tmp_string,yytext,'(');  // get A in A("mat.tab")
2302
 
2303
    fprintf(fdat,"%s",tmp_string);
2304
    fprintf(fdat,"%s",";\n");
2305
 
2306
    fprintf(fall,"  %s",tmp_string);
2307
    fprintf(fall,".allocate(0,-1,0,-1,\"%s\");\n",tmp_string);
2308
    after_part(tmp_string1,yytext,'\"');
2309
    fprintf(fall,"  dmatrix %s_tmp((adstring)%s;\n",tmp_string,tmp_string1);
2310
    fprintf(fall,"  %s = %s_tmp;\n",tmp_string,tmp_string);
2311
    if (needs_initialization)
2312
    {
2313
      needs_initialization=0;
2314
    }
2315
    if (!params_defined)
2316
    {
2315 2317
      if(likelihood_found) {
2316 2318
        if(likelihood_counter<MAX_LIKE_CHECK) sprintf(likelihood_checker[likelihood_counter++],"%s",tmp_string);
2317 2319
        likelihood_found=0;
2318 2320
      }
2319
      BEGIN DEFINE_DATA;
2320
    }
2321
    else
2322
    {
2323
      BEGIN DEFINE_PARAMETERS;
2324
    }
2325
                            }
2326

  
2327
<IN_TABLE_DEF>{name}\({filenamesingle}\) {
2328
    fprintf(stderr,"%s %d %s","Error in line",nline,"while reading (use double instead of single quotes)\n");
2329
    exit(1);
2330
                            }
2331

  
2332
<IN_TABLE_DEF>{name} {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff