1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2025-04-21 12:27:27 +03:00

cameo: cleaned up and documented the tool compensation

- README, lang.l, lang.y: renamed the "tool" command to "offset"
- README: documented "offset"
- ops.h, ops.c (tool_comp_paths), cameo.c (main), lang.y: added
  parameter to tool_comp_paths to treat all paths as internal
- lang.l, lang.y: added option "inside" to the "offset" command
- lang.y: "offset" can now take multiple options in any order
This commit is contained in:
Werner Almesberger
2010-12-14 23:37:31 -03:00
parent 68d5eff7cd
commit 3ae3d6cdd3
6 changed files with 55 additions and 18 deletions

View File

@@ -113,19 +113,24 @@ static void align(int ref, double x, double y)
%union {
double num;
char *str;
enum {
OO_DOG = 1 << 0,
OO_INSIDE = 1 << 1,
} oopt;
};
%token TOK_ALIGN TOK_ARRAY TOK_CLEAR TOK_RESET TOK_TOOL
%token TOK_ALIGN TOK_ARRAY TOK_CLEAR TOK_RESET TOK_OFFSET
%token TOK_TRANSLATE TOK_Z
%token TOK_GERBER TOK_GNUPLOT TOK_WRITE
%token TOK_DOG
%token TOK_DOG TOK_INSIDE
%token <num> NUM_EXP_MIL NUM_EXP_MM NUM_IMP_MIL NUM_IMP_MM REF
%token <str> STRING
%type <str> opt_filename
%type <num> dimen number
%type <oopt> offset_options offset_option
%%
@@ -172,13 +177,10 @@ command:
{
xo = yo = 0;
}
| TOK_TOOL
| TOK_OFFSET offset_options
{
tool_comp_paths(paths, 0);
}
| TOK_TOOL TOK_DOG
{
tool_comp_paths(paths, 1);
tool_comp_paths(paths,
!!($2 & OO_DOG), !!($2 & OO_INSIDE));
}
| TOK_TRANSLATE dimen dimen
{
@@ -251,3 +253,25 @@ number:
$$ = $1;
}
;
offset_options:
{
$$ = 0;
}
| offset_option offset_options
{
$$ = $1 | $2;
}
;
offset_option:
TOK_DOG
{
$$ = OO_DOG;
}
| TOK_INSIDE
{
$$ = OO_INSIDE;
}
;