Bugs item #3172530, was opened at 2011-02-04 17:22
Message generated for change (Tracker Item Submitted) made by benrampling
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).

----------------------------------------------------------------------

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

Reply via email to