Werner Almesberger
c9bd26a34d
b2/Makefile: generate dependencies also for YACC- and LEX-generated files
...
We need explicit rules to compile lex.yy.c and y.tab.c for the relaxed
CFLAGS. However, this means that the implicit rule was not used and
therefore no dependencies were generated.
2012-05-22 16:09:22 -03:00
Werner Almesberger
4f142c1250
b2/: for consistency, make "break/continue $" equivalent to "break/continue"
...
Plus a bit of code simplification.
2012-05-22 15:57:55 -03:00
Werner Almesberger
694d48b56a
b2/: make the match name after "break" and "continue" optional
...
If the name is omitted, we jump back / out of the current block.
2012-05-22 15:47:02 -03:00
Werner Almesberger
107280b6d5
b2/: rename "again" to "continue"
2012-05-22 15:44:31 -03:00
Werner Almesberger
bb809b0d6c
b2/: make "again" include the match; make "break" pop the stack
2012-05-22 15:29:27 -03:00
Werner Almesberger
2ce2da5c30
b2/subst.c (resolve_jump): use pointer comparison instead of strcmp
...
Both come from "unique".
2012-05-22 14:27:39 -03:00
Werner Almesberger
21702781bc
b2/: use re_nsub instead of maintaining our own equivalent
...
We still need to count parentheses in prepare_re for the current index
into "units", but the rest can ue re_nsub.
2012-05-22 13:51:57 -03:00
Werner Almesberger
148d5e85ac
b2/: regexec puts first substring into pmatch[1] and not pmatch[0]
...
Also clean up the hard-coded number of matches.
2012-05-22 13:49:49 -03:00
Werner Almesberger
3d2eca34ff
b2/: meta-variable $ for "previously matched variable"
...
We need this for iterative processing of FN.
2012-05-22 13:01:39 -03:00
Werner Almesberger
2946b830f1
b2/subst.c (prepare_re): fail on bad (#unit) syntax instead of ignoring
2012-05-22 12:07:41 -03:00
Werner Almesberger
d2171eba47
b2/: add "ignore" keyword for substitution rules
...
This allows us to decide in the project-specific rules how to indicate
DNP/NC/DNS/... parts. In the original BOOM, F1 == NC was hard-coded.
2012-05-21 23:17:33 -03:00
Werner Almesberger
2014e6053e
b2/eval.c (decode_mult): also support "G" prefix
...
Not that we'd need giga-anything anytime soon, but since all the rest
also recognizes G, we support it here for consistency.
2012-05-21 22:35:55 -03:00
Werner Almesberger
2c5850ebe6
b2/: correct some whitespace anomalies
2012-05-21 21:25:29 -03:00
Werner Almesberger
256a096220
b2/boom.c: add parametric part selection (with option -Q)
2012-05-21 21:23:31 -03:00
Werner Almesberger
bcf4696dd9
b2/db.c: add (somewhat crude) parametric part selection
2012-05-21 21:23:31 -03:00
Werner Almesberger
4a3e517935
b2/: move basic handling of variables from subex to param
2012-05-21 19:46:42 -03:00
Werner Almesberger
c1b6b2a5e4
b2/: use (general) "struct param" to replace (specialized) "struct var"
2012-05-21 19:26:36 -03:00
Werner Almesberger
061e8f5872
b2/: rename "name" field in struct value to more generic "s", for better sharing
2012-05-21 14:44:33 -03:00
Werner Almesberger
fdac542592
b2/: add relop to struct param, in preparation of merge with struct var
2012-05-21 14:35:51 -03:00
Werner Almesberger
3ad6c2c44b
b2/: move all error handling from subex to subst
...
This makes checking of variables more strict: a variable can only
be used in the right -hand side of an assignment if it has been
assigned by an unconditional predecessor or if it has been matched
by a parent.
Things that wouldn't work anymore:
REF=X* {
FN=*V { X=Y }
Z=$X /* we can't be sure X=Y was taken */
}
FN=*R {
X=$REF /* no previous use of REF */
}
2012-05-21 00:20:07 -03:00
Werner Almesberger
6fd5313917
b2/: assigments to can express inequalities
2012-05-20 23:16:51 -03:00
Werner Almesberger
a34702cd8d
b2/: move relational operators to relop.[ch] (for sharing)
...
This also fixes a bug in dump_one_field, which switched > and >=
2012-05-20 23:04:41 -03:00
Werner Almesberger
99e5777448
b2/: finish unit handling and move most of its processing to the match side
...
The ${foo#unit} syntax didn't really make sense because it created
a large number of potential error conditions on the assignment side
and didn't help with finding compatible fields.
With all this moved to the match side, an invalid syntax simply causes
a mismatch.
2012-05-20 22:02:50 -03:00
Werner Almesberger
adecef8d4a
b2/: use glob syntax instead of RE syntax for substitutions
2012-05-20 21:05:17 -03:00
Werner Almesberger
9681d44ca4
b2/subst.c: use vstring for modified regexp
2012-05-20 20:57:18 -03:00
Werner Almesberger
4e39ca2e31
b2/: move variable-length strings to vstring.[ch], for sharing
2012-05-20 20:54:07 -03:00
Werner Almesberger
8e6357f4fa
b2/boom.c: add substitution query mode (option -q)
2012-05-20 20:33:15 -03:00
Werner Almesberger
04d858e047
b2/: export field hierarchy and substitution rules from lang.y
2012-05-20 20:33:14 -03:00
Werner Almesberger
fd14c5200a
b2/: add processing of substitution rules
2012-05-20 20:33:14 -03:00
Werner Almesberger
9fd1dc56e7
b2/: add parsing of substitution rules (WIP)
2012-05-20 20:33:14 -03:00
Werner Almesberger
702343cabc
b2/: connect stock to provider
2012-05-01 15:21:32 -03:00
Werner Almesberger
5d7f4fc662
b2/lang.l: print file name in diagnostics
2012-05-01 15:07:38 -03:00
Werner Almesberger
9a06757420
b2/: move file opening from boom.c to lang.l and combine setup code
2012-05-01 15:04:24 -03:00
Werner Almesberger
82d532e4a2
b2/: add provider database (WIP)
2012-05-01 14:57:12 -03:00
Werner Almesberger
c3a68453d0
b2/: add currency database
2012-04-30 22:49:33 -03:00
Werner Almesberger
24a32525e2
b2/: add dumping of stock information
...
Also use part_add without first calling part_lookup, since the latter is
implicit.
2012-04-30 20:40:11 -03:00
Werner Almesberger
450769e031
b2/: add options to set file type on the command line
2012-04-30 20:19:55 -03:00
Werner Almesberger
e99a9f4705
b2/: add parsing of part inventories (WIP)
...
Also simplify representation of packaging variants.
2012-04-30 20:19:55 -03:00
Werner Almesberger
1394c6b61c
b2/: make top-level hierarchy item an action, not just a rule
...
This allows the definition of optional global fields. For now, we (ab)use
this for FP (footprint).
2012-04-28 23:30:50 -03:00
Werner Almesberger
6c49fdd789
b2/: dump part records (for debugging only)
2012-04-28 23:26:22 -03:00
Werner Almesberger
edcc61a6f4
b2/: normalize relative values to 1, not 100
2012-04-28 23:26:00 -03:00
Werner Almesberger
e7b2e65795
b2/db.c (part_add): fix jumbled initialization mess
2012-04-28 22:55:34 -03:00
Werner Almesberger
c92ba6f21a
b2/Makefile: target "try" to run the example setup
2012-04-28 22:52:09 -03:00
Werner Almesberger
331fbdda6a
b2/: add parameter conversion
2012-04-28 22:50:15 -03:00
Werner Almesberger
b172117a1c
b2/bitset.h: fix logic of bitset_empty
2012-04-28 22:49:40 -03:00
Werner Almesberger
eabe0dc910
b2/: new diagnostic function yywarnf
2012-04-28 22:38:06 -03:00
Werner Almesberger
8aa94edd2f
b2/: moved declarations of diagnostic functions from util.h to lang.h
2012-04-28 22:12:33 -03:00
Werner Almesberger
433b03a59d
b2/: allow ...% to be recognized as a single WORD (for values)
2012-04-28 11:57:47 -03:00
Werner Almesberger
98f2fc8337
b2/lang.l: reset lineno for new file and count newlines in comment
2012-04-28 11:51:47 -03:00
Werner Almesberger
90e541cd7a
b2/: add parsing of part characteristics (WIP)
2012-04-28 11:46:42 -03:00