> Now, of course, old lex/yacc hands will point out that this kind of > communication is dangerous, since the parser looks ahead,
The parser looks ahead to scan tokens, which means you need to recognize all the tokens in the parser, not half in the parser and half in the lexer. It will reduce rules in order, though. So you'd have to parse the units command and store the value in the footprint you're working on (not a global) so that further parsing of that footprint has its default. You'd have to do the units scaling in the parser also. > (*) Or, instead of adding keywords, you could say that a rule on one > of the numbers in the "element" line, say the mark, was the default > for the footprint. But that seems excessively obscure. One of my tools does that - "no units" means "use previously seen units", from whatever you used last. So you could use "mm" on the first coordinate of an ElementLine and skip it on the rest of the line. _______________________________________________ geda-user mailing list geda-user@moria.seul.org http://www.seul.org/cgi-bin/mailman/listinfo/geda-user