I'm trying to find a definitive G Code syntax specification, NOT the individual G Codes meaning, specification for this i everywhere, i mean detailed syntax specification, for the purpose of writing a parser.
I have no problem writing a parser, i'm just looking for syntax specs, eg. i know you don't always have to give full xyz coordinates for some Gcodes, and in that case the machine will use last value of a missing coordinate, but i can't seem to find any definitive rule about when it can happen. Also some instruction can be tucked in a single line, and some can't, and again, no definitive rules seem to exist.
Long story:
So i have a diy cnc machine, had it for a while, recently upgraded it to a stable enough state, where i can mill some PCB's. The thing is, it's really tricky to do double sided ones, because mechanical ways of indexing both sides aren't accurate enough.
So there are a few projects aiming at utilising usb camera, with which you aim at known points and then the app calculates and applies a transformation to the gcode, so it compensates for the misalignment.
But the problem is, i want to do this by means other than a camera, and also those projects are unfinished or abandoned.
So i thought, i could make a simple parser for gfcode, but any "specification" i find, only talks about meaning of particular instructions, never about syntax.