CAD CAM EDM DRO - Yahoo Group Archive

re: parsing and variables

Posted by ballendo@y...
on 2001-01-06 14:21:13 UTC
Jon E wrote:
>Right! How will you keep named variables from being confused with
>the command words, that use many of the alphabetic characters?

Jon,

First let me say that I'm for numbered vars! I want to 'parse' this
file as quickly as possible, so I can use the time saved to a better
job somewhere else; like trajectory planning... Pre-processing the
file to change the named vars INTO numbers would be okay, as long as
I didn't HAVE to pre-process (in other words, I know the native
format)

Having said all that, The way you keep the named vars separate from
the command words is simply to take more time 'parsing'!

For those who don't know the terminology, to 'parse' means: Taking an
input string of characters and 're-arranging' them according to what
the program needs. This allows the input of the program to be more
varied, while achieving the same results. For example, g01,g1,G01,and
G1 will EACH 'parse' to the SAME THING, AS FAR AS THE PROGRAM IS
CONCERNED. The 'parser' could read any one of the four of these
variations on the G1 command, and simply put an "X"(or anything else
the programmer decides) in the correct "box" for use by the CNC
control program later...

Back to Jons' question. At SOME POINT, the named variable will no
longer satisfy the syntax of a command word (commands are RESERVED,
and CAN'T be used for variable naming) and the parser will say, "must
be a named variable!" Next...

Hope this helps.

Ballendo

Discussion Thread

ballendo@y... 2001-01-06 14:21:13 UTC re: parsing and variables