mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2025-04-21 12:27:27 +03:00
cameo: various scanner and parser fixes
- README, lang.y: changed depth parameter of "z" command to position (sign changes) - lang.l: defer FILENAME after "gerber" and "gnuplot", so that we don't mis-read the number - lang.l, lang.y: return the reference point after "align" as new token REF, not as NUMEBER, so that we can catch syntax errors that would cause scanner and parser to become unsynchronized - lang.l: accept negative numbers - lang.l: added support for comments beginning with #
This commit is contained in:
10
cameo/lang.y
10
cameo/lang.y
@@ -118,7 +118,7 @@ static void align(int ref, double x, double y)
|
||||
%token TOK_GERBER TOK_GNUPLOT TOK_WRITE
|
||||
%token TOK_DOG
|
||||
|
||||
%token <num> NUMBER
|
||||
%token <num> NUMBER REF
|
||||
%token <str> STRING
|
||||
|
||||
%type <str> opt_filename
|
||||
@@ -130,11 +130,11 @@ all:
|
||||
;
|
||||
|
||||
command:
|
||||
TOK_ALIGN NUMBER NUMBER NUMBER
|
||||
TOK_ALIGN REF NUMBER NUMBER
|
||||
{
|
||||
align((int) $2, $3, $4);
|
||||
}
|
||||
| TOK_ALIGN NUMBER NUMBER NUMBER NUMBER NUMBER
|
||||
| TOK_ALIGN REF NUMBER NUMBER NUMBER NUMBER
|
||||
{
|
||||
int ref = $2;
|
||||
double x, y;
|
||||
@@ -179,11 +179,11 @@ command:
|
||||
}
|
||||
| TOK_Z NUMBER
|
||||
{
|
||||
zo -= $2;
|
||||
zo += $2;
|
||||
}
|
||||
| TOK_Z NUMBER NUMBER
|
||||
{
|
||||
zo -= $2+$3;
|
||||
zo += $3-$2;
|
||||
}
|
||||
| TOK_GERBER NUMBER opt_filename
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user