Parser2HooksBase Reference¶
parser2hooks_base
¶
Parser hooks interface class, for Gerber AST parser, version 2.
TokenHooksBase
¶
Bases: Generic[TokenT]
Class for creating token visit hooks.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
post_hooks_init
¶
pre_parser_visit_token
¶
Called before parser visits a token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
TokenT
|
The token that will be visited. |
required |
context |
Parser2Context
|
The context object containing information about the parser state. |
required |
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
on_parser_visit_token
¶
Called when parser visits a token.
This hook should perform all changes on context implicated by token type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
TokenT
|
The token that is being visited. |
required |
context |
Parser2Context
|
The context object containing information about the parser state. |
required |
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
post_parser_visit_token
¶
Called after parser visits a token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
TokenT
|
The token that was visited. |
required |
context |
Parser2Context
|
The context object containing information about the parser state. |
required |
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
Parser2HooksBase
¶
Collection of overridable hooks for Gerber AST parser, version 2.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
|
MacroBeginTokenHooks
¶
Bases: TokenHooksBase[MacroBeginT]
Hooks for visiting macro definition begin token (AM).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode1CircleTokenHooks
¶
Bases: TokenHooksBase[Code1CircleTokenT]
Hooks for visiting macro primitive code 0 circle.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode2VectorLineTokenHooks
¶
Bases: TokenHooksBase[Code2VectorLineTokenT]
Hooks for visiting macro primitive code 2 vector line.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode4OutlineTokenHooks
¶
Bases: TokenHooksBase[Code4OutlineTokenT]
Hooks for visiting macro primitive code 4 outline.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode5PolygonTokenHooks
¶
Bases: TokenHooksBase[Code5PolygonTokenT]
Hooks for visiting macro primitive code 5 polygon.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode6MoireTokenHooks
¶
Bases: TokenHooksBase[Code6MoireTokenT]
Hooks for visiting macro primitive code 6 moire.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode7ThermalTokenHooks
¶
Bases: TokenHooksBase[Code7ThermalTokenT]
Hooks for visiting macro primitive code 7 thermal.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode20VectorLineTokenHooks
¶
Bases: TokenHooksBase[Code20VectorLineTokenT]
Hooks for visiting macro primitive code 20 vector line.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode21CenterLineTokenHooks
¶
Bases: TokenHooksBase[Code21CenterLineTokenT]
Hooks for visiting macro primitive code 21 center line.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroCode22LowerLeftLineTokenHooks
¶
Bases: TokenHooksBase[Code22LowerLeftLineTokenT]
Hooks for visiting macro primitive code 22 lower left line.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroVariableAssignment
¶
Bases: TokenHooksBase[MacroVariableAssignmentT]
Hooks for visiting macro variable assignment token.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroDefinitionTokenHooks
¶
Bases: TokenHooksBase[MacroDefinitionT]
Hooks for visiting macro definition token (AM).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
MacroEvalHooks
¶
Hooks called when evaluating macro aperture.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
BeginBlockApertureTokenHooks
¶
Bases: TokenHooksBase[BlockApertureBeginT]
Hooks for visiting begin block aperture token (AB).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
EndBlockApertureTokenHooks
¶
Bases: TokenHooksBase[BlockApertureEndT]
Hooks for visiting end block aperture token (AB).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DefineApertureCircleTokenHooks
¶
Bases: TokenHooksBase[DefineCircleT]
Hooks for visiting circle aperture definition token (ADD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DefineApertureRectangleTokenHooks
¶
Bases: TokenHooksBase[DefineRectangleT]
Hooks for visiting rectangle aperture definition token (ADD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DefineApertureObroundTokenHooks
¶
Bases: TokenHooksBase[DefineObroundT]
Hooks for visiting obround aperture definition token (ADD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DefineAperturePolygonTokenHooks
¶
Bases: TokenHooksBase[DefinePolygonT]
Hooks for visiting polygon aperture definition token (ADD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DefineApertureMacroTokenHooks
¶
Bases: TokenHooksBase[DefineMacroT]
Hooks for visiting macro aperture definition token (ADD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DefineApertureTokenHooks
¶
Bases: TokenHooksBase[DefineAnyT]
Hooks for visiting any aperture definition token (ADD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
AxisSelectTokenHooksTokenHooks
¶
Bases: TokenHooksBase[AxisSelectT]
Hooks for visiting axis select token (AS).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
CommandDrawTokenHooks
¶
Bases: TokenHooksBase[D01DrawT]
Hooks for visiting draw token (D01).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
CommandMoveTokenHooks
¶
Bases: TokenHooksBase[D02MoveT]
Hooks for visiting move token (D02).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
CommandFlashTokenHooks
¶
Bases: TokenHooksBase[D03FlashT]
Hooks for visiting flash token (D03).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SelectApertureTokenHooks
¶
Bases: TokenHooksBase[DNNSelectApertureT]
Hooks for visiting select aperture token (DNN).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
CoordinateFormatTokenHooks
¶
Bases: TokenHooksBase[CoordinateFormatT]
Hooks for visiting coordinate format token (FS).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetLinearTokenHooks
¶
Bases: TokenHooksBase[SetLinearT]
Hooks for visiting set linear token (G01).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetClockwiseCircularTokenHooks
¶
Bases: TokenHooksBase[SetClockwiseCircularT]
Hooks for visiting set clockwise circular token (G02).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetCounterClockwiseCircularTokenHooks
¶
Bases: TokenHooksBase[SetCounterclockwiseCircularT]
Hooks for visiting set counter clockwise circular token (G03).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
CommentTokenHooks
¶
Bases: TokenHooksBase[CommentT]
Hooks for visiting comment token (G04).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
BeginRegionTokenHooks
¶
Bases: TokenHooksBase[BeginRegionT]
Hooks for visiting begin region token (G36).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
EndRegionTokenHooks
¶
Bases: TokenHooksBase[EndRegionT]
Hooks for visiting end region token (G37).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
PrepareSelectApertureTokenHooks
¶
Bases: TokenHooksBase[G54SelectApertureT]
Hooks for visiting prepare select aperture token (G54).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetUnitInchTokenHooks
¶
Bases: TokenHooksBase[SetUnitInchT]
Hooks for visiting set unit inch token (G70).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetUnitMillimetersTokenHooks
¶
Bases: TokenHooksBase[SetUnitMillimetersT]
Hooks for visiting set unit millimeters token (G71).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetSingleQuadrantModeTokenHooks
¶
Bases: TokenHooksBase[SetSingleQuadrantModeT]
Hooks for visiting set single-quadrant mode token (G74).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetMultiQuadrantModeTokenHooks
¶
Bases: TokenHooksBase[SetMultiQuadrantModeT]
Hooks for visiting set multi-quadrant mode token (G75).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetCoordinateAbsoluteTokenHooks
¶
Bases: TokenHooksBase[SetAbsoluteNotationT]
Hooks for visiting set coordinate absolute token (G90).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
SetCoordinateIncrementalTokenHooks
¶
Bases: TokenHooksBase[SetIncrementalNotationT]
Hooks for visiting set coordinate incremental token (G91).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
ImageNameTokenHooks
¶
Bases: TokenHooksBase[ImageNameT]
Hooks for visiting image name token (IN).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
InvalidTokenHooks
¶
Bases: TokenHooksBase[InvalidTokenT]
Hooks for visiting invalid token.
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
ImagePolarityTokenHooks
¶
Bases: TokenHooksBase[ImagePolarityT]
Hooks for visiting image polarity token (IP).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
LoadMirroringTokenHooks
¶
Bases: TokenHooksBase[LoadMirroringT]
Hooks for visiting load mirroring token (LM).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
LoadNameTokenHooks
¶
Bases: TokenHooksBase[LoadNameT]
Hooks for visiting load name token (LN).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
LoadPolarityTokenHooks
¶
Bases: TokenHooksBase[LoadPolarityT]
Hooks for visiting load polarity token (LP).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
LoadRotationTokenHooks
¶
Bases: TokenHooksBase[LoadRotationT]
Hooks for visiting load rotation token (LR).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
LoadScalingTokenHooks
¶
Bases: TokenHooksBase[LoadScalingT]
Hooks for visiting load scaling token (LS).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
ProgramStopTokenHooks
¶
Bases: TokenHooksBase[M00ProgramStopT]
Hooks for visiting program stop token (M00).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
OptionalStopTokenHooks
¶
Bases: TokenHooksBase[M01OptionalStopT]
Hooks for visiting optional stop token (M01).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
EndOfFileTokenHooks
¶
Bases: TokenHooksBase[M02EndOfFileT]
Hooks for visiting end of file token (M02).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
UnitModeTokenHooks
¶
Bases: TokenHooksBase[UnitModeT]
Hooks for visiting unit mode token (MO).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
ImageOffsetTokenHooks
¶
Bases: TokenHooksBase[ImageOffsetT]
Hooks for visiting image offset token (OF).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
StepRepeatBeginTokenHooks
¶
Bases: TokenHooksBase[StepRepeatBeginT]
Hooks for visiting step and repeat begin token (SR).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
StepRepeatEndTokenHooks
¶
Bases: TokenHooksBase[StepRepeatEndT]
Hooks for visiting step and repeat end token (SR).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
ApertureAttributeHooks
¶
Bases: TokenHooksBase[ApertureAttributeT]
Hooks for visiting aperture attribute token (TA).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
DeleteAttributeHooks
¶
Bases: TokenHooksBase[DeleteAttributeT]
Hooks for visiting delete attribute token (TD).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
FileAttributeHooks
¶
Bases: TokenHooksBase[FileAttributeT]
Hooks for visiting file attribute token (TF).
Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
ObjectAttributeHooks
¶
Bases: TokenHooksBase[ObjectAttributeT]
Hooks for visiting object attribute token (TO).