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: 59259429abde332ce3bd9c1667d75947e9c93a4da7112bcf7b7d51c05f6893c1
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: e919e8d1a2 user: geraint@users.sourceforge.net tags: origin/master, trunk
23:05:56
Fixed port aliasing. check-in: 59259429ab user: geraint@users.sourceforge.net tags: origin/master, trunk
16:58:21
Updated package description: describes library rather than MTT itself. check-in: 6c69f0f28f 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 ]