Index: 10_forge.html =================================================================== --- 10_forge.html (nonexistent) +++ 10_forge.html (revision 2745) @@ -0,0 +1,69 @@ + + +

10. cschem implementation - forge

+ +

{imp10:0} +The purpose of the forge plugin is to provide an easy to implement yet generic +way for describing attribute transformations in attributes, e.g. in a +library symbol. + +

{imp10:1} +The forge plugin works from the array attribute forge, which is +taken as an ordered list of atomic steps to execute on attributes. For +portability of daya, the forge plugin needs to implement exactly the +operations described below. + +

{imp10:2} +Each entry of the array is one operation. An operation is split into tokens +separated by "::". For example sub::^dip::DIP::footprint is a valid +operation that uses regexp to replace leading "dip" to DIP in the footprint +attribute. + +

{imp10:3} +Operations work with the current values of attributes at the time +of plugin execution during compilation of the abstract model. If destination +attribute doesn't exist, it is created. + +

{imp10:4} +If referenced source attribute of an operation does not exist, the operation +is silently skipped. + + + +

{imp10:5} +Below is the summary of all operations available. + +

+
{des2:36} core attributes of a component +
operations and arguments in-place array? short description +
sub::pat::str::attr yes map substituties one match of regex pattern pat with str in attr +
gsub::pat::str::attr yes map substituties all matches of regex pattern pat with str in attr +
suba::pat::ref::attr yes map substituties one match of regex pattern pat with the value of the ref attribute in attr +
gsuba::pat::ref::attr yes map substituties all matches of regex pattern pat with the value of the ref attribute in attr +
delete::attr yes atomic deletes (removes) the attribute +
scalar::attr yes* atomic create attr as scalar if it does not exist; throw an error if it exists as an array +
array::attr yes* atomic create attr as array if it does not exist; throw an error if it exists as a scalar +
copy::dstattr::srcattr no atomic copies the value of srcattr to the destination attribute dstattr (overwriting or creating it) +
append::dstattr::srcattr no darr appends the value of the souce attribute srcattr to the value of the destination attribute dstattr +
prepend::dstattr::srcattr no darr prepends the value of the souce attribute srcattr to the value of the destination attribute dstattr +
+ +

{imp10:6} +In-place operations modify existing attributes in place. They are no-op for +non-existing attributes. + +

{imp10:7} +If addressed attribute of the operation is an array, the operation will +behave according to the "array?" column: +

+ + + + + + +