Overview
Comment:Fixed port aliasing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: bfb061b2a6338ccf76b686b4a607ad309ee4c6960347cbcac76df68ed54434b5
User & Date: geraint@users.sourceforge.net on 2004-08-18 23:05:56
Other Links: branch diff | manifest | tags
Context
2004-08-18
23:19:04
Replaced deprecated is_struct and struct_contains with isstruct and isfield. check-in: d1f78065d7 user: geraint@users.sourceforge.net tags: origin/master, trunk
23:05:56
Fixed port aliasing. check-in: bfb061b2a6 user: geraint@users.sourceforge.net tags: origin/master, trunk
16:58:21
Updated package description: describes library rather than MTT itself. check-in: 208ba60f8b user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/ibg2abg.m from [402c2b15c2] to [7ebb891e47].

199
200
201
202
203
204
205
206

207
208
209
210
211
212
213

214
215
216
217
218
219
220
221
222
223
224
225
  ####################

  if (struct_contains(objects, "comp"))
    for [comp, comp_name] = objects.comp
      if ((! strcmp(comp.type, "zero")) & (! strcmp(comp.type, "one")))
	alias = eval(sprintf("%s_alias", comp.type));
	if (is_struct(alias))
	  for [bond, bond_name] = comp

	    if (struct_contains(alias, "bond.label"))
	      old_name = bond.label;
	      new_name = eval(sprintf("alias.%s", old_name));
	      bond.label = new_name;
	      mtt_info(sprintf("Aliasing [%s] on %s (%s) to [%s]",
			       old_name, comp_name, comp.type, new_name),
		       infofile);

	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	endif
	eval(sprintf("objects.%s = comp;", comp_name));
      endif
    endfor
  endif

  disp("-- finished expanding aliases --")
  objects








|
>
|
|
|
|
|
|
|
>




|







199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
  ####################

  if (struct_contains(objects, "comp"))
    for [comp, comp_name] = objects.comp
      if ((! strcmp(comp.type, "zero")) & (! strcmp(comp.type, "one")))
	alias = eval(sprintf("%s_alias", comp.type));
	if (is_struct(alias))
	  for [bond, bond_name] = comp;
	    if (isstruct(bond))
	      if (struct_contains(alias, bond.label))
		old_name = bond.label;
		new_name = eval(sprintf("alias.%s", old_name));
		bond.label = new_name;
		mtt_info(sprintf("Aliasing [%s] on %s (%s) to [%s]",
				 old_name, comp_name, comp.type, new_name),
			 infofile);
	      endif
	    endif
	    eval(sprintf("comp.%s = bond;", bond_name));
	  endfor
	endif
	eval(sprintf("objects.comp.%s = comp;", comp_name));
      endif
    endfor
  endif

  disp("-- finished expanding aliases --")
  objects


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