Differences From Artifact [d5523eb723]:

To Artifact [342382370f]:


9
10
11
12
13
14
15





16
17
18
19
20
21
22
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+
+
+







# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.29  1998/04/12 12:35:32  peterg
## Named and unnamed SS handled in a uniform manner - in particular, the
## attributes are passed through
## wrote_component function used.
##
## Revision 1.28  1998/04/06 08:41:48  peterg
## Fixed bug due to adding (and then removing) 0 and 1 as port types
##
## Revision 1.27  1998/04/04 10:54:58  peterg
## Remove a debugging print statement
##
## Revision 1.26  1998/04/04 07:29:26  peterg
298
299
300
301
302
303
304
305
306
307
308
309
310

311
312
313
314
315
316
317
318
319
320
321
322
323
324

325
326

327
328
329
330
331
332
333
334







335
336
337
338
339
340
341
303
304
305
306
307
308
309

310
311
312
313

314
315
316
317
318
319
320
321
322
323
324
325
326
327

328


329








330
331
332
333
334
335
336
337
338
339
340
341
342
343







-




-
+













-
+
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+







    };

    named_component = (match(str,delimiter) > 0);
    if (named_component) {
      split(str,a,delimiter);
      type = a[1];
      name = a[2];

# Check  if name is in label file and if used already
      found = 0; name_used = 0;
      for (i=1; i<=i_label; i++) {
	lname = label[i,1];
	if ( exact_match(name,lname) ) {
	if ( lname==name ) {
	  found = 1;
	  if (name in used) {
	    name_used = 1;
	    CR = label[i,2];
	    args = label[i,3];
	  }
	  else {
	    used[name] = 1
	      }
	  break
	    }
      }

	if (!found) {
if (!found) {
	  if (isa_plain_component) {
	    printf(warning_f, name)
printf(warning_f, name);
	  }
	  i_label++;
	  CR = default_cr;
	  args = "";
	  label[i_label,1] = name; 
	  label[i_label,2] = CR;
	  label[i_label,3] = args
	    }
i_label++;
CR = default_cr;
args = "";
label[i_label,1] = name; 
label[i_label,2] = CR;
label[i_label,3] = args
}

# Give it a new entry if already used
#  -- also tell user as it is an error now(?)
      if (name_used) {
	printf(warning_u, name);
	i_label++;
	i_name++;
627
628
629
630
631
632
633
634
635



636
637
638
639
640
641
642
643
644





645
646
647
648
649

629
630
631
632
633
634
635


636
637
638
639
640
641
642
643

644


645
646
647
648
649
650
651
652
653
654
655







-
-
+
+
+





-

-
-
+
+
+
+
+





+
    printf("%s %s\n", a[1], a[2]) >> b_file;
  }
  printf("];\n\n") >> b_file;

  printf("port_name = [\n") >> b_file;
  for (i = 1; i <= i_port; i++) {
    split(ports[i],a, " ");
    # Remove the []
    name = substr(a[3],2,length(a[3])-2);
    # Dont Remove the []
    # name = substr(a[3],2,length(a[3])-2);
    name = a[3];
    printf("'%s'\n", name) >> b_file;
  }
  printf("];\n\n") >> b_file;

# Print the (external) port list
#  printf("n_ports = %1.0f;\n", i_port_component) >> b_file;
  printf("port_list = [\n") >> b_file;
  for (i = 1; i <= i_port_component; i++) 
    printf("'%s'\n", port_labels[i]) >> b_file;
  for (i = 1; i <= i_label; i++) {
    name = label[i,1];
    if (match(name,port_regexp))
      printf("'%s'\n", name) >> b_file;
  }
  printf("];\n\n") >> b_file;
  
}




MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]