Bugs item #3172530, was opened at 2011-02-04 04:22 Message generated for change (Comment added) made by thepurlieu You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=409538&aid=3172530&group_id=33921
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Gerber Parser Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Ben Rampling (benrampling) Assigned to: Stefan Petersen (spetm) Summary: Operator precedence not implemented in aperture macros Initial Comment: Section 4.2.2 of the RS-274X specification says the following about the aperture macro arithmetic operators: "The standard arithmetic precedence rules apply." gerbv does not implement precedence and simply evaluates left to right. I have created a 10 line test case, attached. The attached sample should show a 2 inch OD, 1.9 inch ID annulus (a thin circle). GC-Prevue does implement precedence, and correctly displays the attached sample. gerbv incorrectly displays a 2 inch OD, 0.1 inch ID annulus (a disc with a small hole). The following expression in the example is responsible: 1.8 + 1 x 0 + 0.1 It should be evaluated as: ((1.8 + (1 x 0)) + 0.1) Presumably gerbv is doing: ((1.8 + 1) x 0) + 0.1 A simplified version of the shunting yard algorithm can be used to parse these expressions correctly, while only using three variables (two to hold expression stack numbers, and one to hold the single operator stack entry; it isn't necessary to use actual stacks, just three normal variables). ---------------------------------------------------------------------- >Comment By: Julian Lamb (thepurlieu) Date: 2011-02-04 09:34 Message: Ben, Hmmm...thanks for tracking this down. I was unaware of the precedence requirement. I'll forward this to Stefan, who did the macro parsing logic, and hopefully we can get a fix for this without *too* much reworking. Patches are also welcome too... :) Cheers, Julian ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=409538&aid=3172530&group_id=33921 ------------------------------------------------------------------------------ The modern datacenter depends on network connectivity to access resources and provide services. The best practices for maximizing a physical server's connectivity to a physical network are well understood - see how these rules translate into the virtual world? http://p.sf.net/sfu/oracle-sfdevnlfb _______________________________________________ Gerbv-devel mailing list Gerbv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gerbv-devel