mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-05 10:08:26 +02:00
4f142c1250
Plus a bit of code simplification.
53 lines
998 B
Plaintext
53 lines
998 B
Plaintext
FN=DNP { ignore }
|
|
|
|
FN=X(*) { $=$1 }
|
|
|
|
/* iteration demo */
|
|
FOO=abcde
|
|
BAR=x /* BAR= wouldn't be syntactically correct. We need a non-empty value */
|
|
FOO=(*)(?) {
|
|
BAR=$BAR$2
|
|
FOO=$1
|
|
continue
|
|
}
|
|
BAR=x(*) { $=$1 } /* remove the "x" */
|
|
|
|
REF=R[0-9]* {
|
|
T=R
|
|
VAL=(#R) { R=$1 }
|
|
TOL <= 5%
|
|
FN=*% { TOL<=$$ }
|
|
break REF
|
|
// end break continue ignore
|
|
}
|
|
|
|
/*
|
|
pattern:
|
|
() | like in RE
|
|
* ? like in glob
|
|
(#U) expect a numeric value of unit U (use substring to get canonical value)
|
|
|
|
subst: $1 ... $field
|
|
|
|
substring:
|
|
$1, $2, ...
|
|
variable:
|
|
$foo, ...
|
|
with curly braces:
|
|
${foo}, ...
|
|
input variable (in pattern):
|
|
$$
|
|
|
|
the input variable ($) can also be used as LHS for matches, assignments, and
|
|
as break/continue target.
|
|
|
|
Caveat:
|
|
|
|
Wrong: FN=* { X=$FN } there is no variable called FN
|
|
Right: FN=* { X=$$ } yields the Fn field selected by FN
|
|
|
|
Wrong: VAL=(#R) { R=$VAL } yields literal value
|
|
Wrong: VAL=(#R) { R=$$ } yields literal value
|
|
Right: VAL=(#R) { R=$1 } yield canonicalized value
|
|
*/
|