On Sat, Jan 21, 2012 at 12:44:14PM -0600, Jon Elson wrote: > G-code is extremely easy to parse. Every numeric value is preceded by a > letter telling what it is.
It depends what variant. There may be some this simple, for instance variants that papertape-reading NC machines used are probably close. But for a modern gcode or for the linuxcnc gcode in particular, this is not the slightest bit true, and it is a disservice for those in the know to say it, since inexperienced people hearing it will try to write regexp-based gcode parsers or other foolishness, and then will encounter something like g20#1=0 g#1x#1y#1f100 o100 repeat[100] g91g1x.01#1=[#1+.01] g90ysin[#1*360] o100 endrepeat m2 where without trying too hard, the only line following that rule is the last one. > In EMC, there are some special cases like comments and > variables, introduced by ( and #. Yes, and many many other special cases. ------------------------------------------------------------------------------ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users