Skip to content

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
class TokenHooksBase(Generic[TokenT]):
    """Class for creating token visit hooks."""

    def __init__(self, hooks: Parser2HooksBase) -> None:
        self.hooks = hooks

    def post_hooks_init(self) -> None:
        """Called after all hooks are assigned."""

    def pre_parser_visit_token(
        self,
        token: TokenT,
        context: Parser2Context,
    ) -> None:
        """Called before parser visits a token.

        Parameters
        ----------
        token: TokenT
            The token that will be visited.
        context : Parser2Context
            The context object containing information about the parser state.

        """

    def on_parser_visit_token(
        self,
        token: TokenT,
        context: Parser2Context,
    ) -> None:
        """Called when parser visits a token.

        This hook should perform all changes on context implicated by token type.

        Parameters
        ----------
        token: TokenT
            The token that is being visited.
        context : Parser2Context
            The context object containing information about the parser state.

        """

    def post_parser_visit_token(
        self,
        token: TokenT,
        context: Parser2Context,
    ) -> None:
        """Called after parser visits a token.

        Parameters
        ----------
        token: TokenT
            The token that was visited.
        context : Parser2Context
            The context object containing information about the parser state.

        """

post_hooks_init

post_hooks_init() -> None

Called after all hooks are assigned.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def post_hooks_init(self) -> None:
    """Called after all hooks are assigned."""

pre_parser_visit_token

pre_parser_visit_token(
    token: TokenT, context: Parser2Context
) -> None

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
def pre_parser_visit_token(
    self,
    token: TokenT,
    context: Parser2Context,
) -> None:
    """Called before parser visits a token.

    Parameters
    ----------
    token: TokenT
        The token that will be visited.
    context : Parser2Context
        The context object containing information about the parser state.

    """

on_parser_visit_token

on_parser_visit_token(
    token: TokenT, context: Parser2Context
) -> None

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
def on_parser_visit_token(
    self,
    token: TokenT,
    context: Parser2Context,
) -> None:
    """Called when parser visits a token.

    This hook should perform all changes on context implicated by token type.

    Parameters
    ----------
    token: TokenT
        The token that is being visited.
    context : Parser2Context
        The context object containing information about the parser state.

    """

post_parser_visit_token

post_parser_visit_token(
    token: TokenT, context: Parser2Context
) -> None

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
def post_parser_visit_token(
    self,
    token: TokenT,
    context: Parser2Context,
) -> None:
    """Called after parser visits a token.

    Parameters
    ----------
    token: TokenT
        The token that was visited.
    context : Parser2Context
        The context object containing information about the parser state.

    """

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
class Parser2HooksBase:
    """Collection of overridable hooks for Gerber AST parser, version 2."""

    def __init__(self) -> None:  # noqa: PLR0915
        super().__init__()
        self.macro_begin = self.MacroBeginTokenHooks(self)
        self.macro_code_1_circle = self.MacroCode1CircleTokenHooks(self)
        self.macro_code_2_vector_line = self.MacroCode2VectorLineTokenHooks(self)
        self.macro_code_4_outline = self.MacroCode4OutlineTokenHooks(self)
        self.macro_code_5_polygon = self.MacroCode5PolygonTokenHooks(self)
        self.macro_code_6_moire = self.MacroCode6MoireTokenHooks(self)
        self.macro_code_7_thermal = self.MacroCode7ThermalTokenHooks(self)
        self.macro_code_20_vector_line = self.MacroCode20VectorLineTokenHooks(self)
        self.macro_code_21_center_line = self.MacroCode21CenterLineTokenHooks(self)
        self.macro_code_22_lower_left_line = self.MacroCode22LowerLeftLineTokenHooks(
            self,
        )
        self.macro_variable_assignment = self.MacroVariableAssignment(self)
        self.macro_definition = self.MacroDefinitionTokenHooks(self)
        self.macro_eval = self.MacroEvalHooks()

        self.end_block_aperture = self.EndBlockApertureTokenHooks(self)
        self.begin_block_aperture = self.BeginBlockApertureTokenHooks(self)

        self.define_circle_aperture = self.DefineApertureCircleTokenHooks(self)
        self.define_rectangle_aperture = self.DefineApertureRectangleTokenHooks(self)
        self.define_obround_aperture = self.DefineApertureObroundTokenHooks(self)
        self.define_polygon_aperture = self.DefineAperturePolygonTokenHooks(self)
        self.define_macro_aperture = self.DefineApertureMacroTokenHooks(self)
        self.define_aperture = self.DefineApertureTokenHooks(self)

        self.axis_select = self.AxisSelectTokenHooksTokenHooks(self)

        self.command_draw = self.CommandDrawTokenHooks(self)
        self.command_move = self.CommandMoveTokenHooks(self)
        self.command_flash = self.CommandFlashTokenHooks(self)

        self.select_aperture = self.SelectApertureTokenHooks(self)
        self.coordinate_format = self.CoordinateFormatTokenHooks(self)

        self.set_linear = self.SetLinearTokenHooks(self)
        self.set_clockwise_circular = self.SetClockwiseCircularTokenHooks(self)
        self.set_counter_clockwise_circular = (
            self.SetCounterClockwiseCircularTokenHooks(self)
        )

        self.comment = self.CommentTokenHooks(self)
        self.begin_region = self.BeginRegionTokenHooks(self)
        self.end_region = self.EndRegionTokenHooks(self)
        self.prepare_select_aperture = self.PrepareSelectApertureTokenHooks(self)
        self.set_unit_inch = self.SetUnitInchTokenHooks(self)
        self.set_unit_millimeters = self.SetUnitMillimetersTokenHooks(self)

        self.set_single_quadrant_mode = self.SetSingleQuadrantModeTokenHooks(self)
        self.set_multi_quadrant_mode = self.SetMultiQuadrantModeTokenHooks(self)

        self.set_coordinate_absolute = self.SetCoordinateAbsoluteTokenHooks(self)
        self.set_coordinate_incremental = self.SetCoordinateIncrementalTokenHooks(self)

        self.image_name = self.ImageNameTokenHooks(self)
        self.invalid_token = self.InvalidTokenHooks(self)
        self.image_polarity = self.ImagePolarityTokenHooks(self)
        self.load_name = self.LoadNameTokenHooks(self)

        self.load_mirroring = self.LoadMirroringTokenHooks(self)
        self.load_polarity = self.LoadPolarityTokenHooks(self)
        self.load_rotation = self.LoadRotationTokenHooks(self)
        self.load_scaling = self.LoadScalingTokenHooks(self)

        self.program_stop = self.ProgramStopTokenHooks(self)
        self.optional_stop = self.OptionalStopTokenHooks(self)
        self.end_of_file = self.EndOfFileTokenHooks(self)
        self.unit_mode = self.UnitModeTokenHooks(self)
        self.image_offset = self.ImageOffsetTokenHooks(self)

        self.step_repeat_begin = self.StepRepeatBeginTokenHooks(self)
        self.step_repeat_end = self.StepRepeatEndTokenHooks(self)

        self.aperture_attribute = self.ApertureAttributeHooks(self)
        self.delete_attribute = self.DeleteAttributeHooks(self)
        self.file_attribute = self.FileAttributeHooks(self)
        self.object_attribute = self.ObjectAttributeHooks(self)

        self._call_post_hooks_init()

    def _call_post_hooks_init(self) -> None:  # noqa: PLR0915
        self.macro_begin.post_hooks_init()
        self.macro_code_1_circle.post_hooks_init()
        self.macro_code_2_vector_line.post_hooks_init()
        self.macro_code_4_outline.post_hooks_init()
        self.macro_code_5_polygon.post_hooks_init()
        self.macro_code_6_moire.post_hooks_init()
        self.macro_code_7_thermal.post_hooks_init()
        self.macro_code_20_vector_line.post_hooks_init()
        self.macro_code_21_center_line.post_hooks_init()
        self.macro_code_22_lower_left_line.post_hooks_init()
        self.macro_variable_assignment.post_hooks_init()
        self.macro_definition.post_hooks_init()

        self.end_block_aperture.post_hooks_init()
        self.begin_block_aperture.post_hooks_init()

        self.define_circle_aperture.post_hooks_init()
        self.define_rectangle_aperture.post_hooks_init()
        self.define_obround_aperture.post_hooks_init()
        self.define_polygon_aperture.post_hooks_init()
        self.define_macro_aperture.post_hooks_init()
        self.define_aperture.post_hooks_init()

        self.axis_select.post_hooks_init()

        self.command_draw.post_hooks_init()
        self.command_move.post_hooks_init()
        self.command_flash.post_hooks_init()

        self.select_aperture.post_hooks_init()
        self.coordinate_format.post_hooks_init()

        self.set_linear.post_hooks_init()
        self.set_clockwise_circular.post_hooks_init()
        self.set_counter_clockwise_circular.post_hooks_init()

        self.comment.post_hooks_init()
        self.begin_region.post_hooks_init()
        self.end_region.post_hooks_init()
        self.prepare_select_aperture.post_hooks_init()

        self.set_unit_inch.post_hooks_init()
        self.set_unit_millimeters.post_hooks_init()

        self.set_single_quadrant_mode.post_hooks_init()
        self.set_multi_quadrant_mode.post_hooks_init()

        self.set_coordinate_absolute.post_hooks_init()
        self.set_coordinate_incremental.post_hooks_init()

        self.image_name.post_hooks_init()
        self.invalid_token.post_hooks_init()
        self.image_polarity.post_hooks_init()
        self.load_name.post_hooks_init()

        self.load_mirroring.post_hooks_init()
        self.load_polarity.post_hooks_init()
        self.load_rotation.post_hooks_init()
        self.load_scaling.post_hooks_init()

        self.program_stop.post_hooks_init()
        self.optional_stop.post_hooks_init()
        self.end_of_file.post_hooks_init()
        self.unit_mode.post_hooks_init()
        self.image_offset.post_hooks_init()

        self.step_repeat_begin.post_hooks_init()
        self.step_repeat_end.post_hooks_init()

        self.aperture_attribute.post_hooks_init()
        self.delete_attribute.post_hooks_init()
        self.file_attribute.post_hooks_init()
        self.object_attribute.post_hooks_init()

    def on_parser_init(self, parser: Parser2) -> None:
        """Called after parser initialization."""

    def pre_parse(self, context: Parser2Context) -> None:
        """Called before parsing starts."""

    def post_parse(self, context: Parser2Context) -> None:
        """Called after parsing finishes."""

    def on_parser_error(self, context: Parser2Context, error: Parser2Error) -> None:
        """Called when parsing error is thrown."""

    def on_other_error(self, context: Parser2Context, error: Exception) -> None:
        """Called when other error is thrown."""

    def pre_parser_visit_any_token(self, context: Parser2Context) -> None:
        """Called before parser visits any token."""

    def post_parser_visit_any_token(self, context: Parser2Context) -> None:
        """Called after parser visits any token."""

    class MacroBeginTokenHooks(TokenHooksBase[MacroBeginT]):
        """Hooks for visiting macro definition begin token (AM)."""

    class MacroCode1CircleTokenHooks(TokenHooksBase[Code1CircleTokenT]):
        """Hooks for visiting macro primitive code 0 circle."""

    class MacroCode2VectorLineTokenHooks(TokenHooksBase[Code2VectorLineTokenT]):
        """Hooks for visiting macro primitive code 2 vector line."""

    class MacroCode4OutlineTokenHooks(TokenHooksBase[Code4OutlineTokenT]):
        """Hooks for visiting macro primitive code 4 outline."""

    class MacroCode5PolygonTokenHooks(TokenHooksBase[Code5PolygonTokenT]):
        """Hooks for visiting macro primitive code 5 polygon."""

    class MacroCode6MoireTokenHooks(TokenHooksBase[Code6MoireTokenT]):
        """Hooks for visiting macro primitive code 6 moire."""

    class MacroCode7ThermalTokenHooks(TokenHooksBase[Code7ThermalTokenT]):
        """Hooks for visiting macro primitive code 7 thermal."""

    class MacroCode20VectorLineTokenHooks(TokenHooksBase[Code20VectorLineTokenT]):
        """Hooks for visiting macro primitive code 20 vector line."""

    class MacroCode21CenterLineTokenHooks(TokenHooksBase[Code21CenterLineTokenT]):
        """Hooks for visiting macro primitive code 21 center line."""

    class MacroCode22LowerLeftLineTokenHooks(TokenHooksBase[Code22LowerLeftLineTokenT]):
        """Hooks for visiting macro primitive code 22 lower left line."""

    class MacroVariableAssignment(TokenHooksBase[MacroVariableAssignmentT]):
        """Hooks for visiting macro variable assignment token."""

    class MacroDefinitionTokenHooks(TokenHooksBase[MacroDefinitionT]):
        """Hooks for visiting macro definition token (AM)."""

    class MacroEvalHooks:
        """Hooks called when evaluating macro aperture."""

        def on_code_1_circle(
            self,
            context: Parser2Context,
            primitive: Code1Circle2,
        ) -> None:
            """Evaluate code 1 circle primitive."""

        def on_code_2_vector_line(
            self,
            context: Parser2Context,
            primitive: Code2VectorLine2,
        ) -> None:
            """Evaluate code 2 vector line primitive."""

        def on_code_4_outline(
            self,
            context: Parser2Context,
            primitive: Code4Outline2,
        ) -> None:
            """Evaluate code 4 outline primitive."""

        def on_code_5_polygon(
            self,
            context: Parser2Context,
            primitive: Code5Polygon2,
        ) -> None:
            """Evaluate code 5 polygon primitive."""

        def on_code_6_moire(
            self,
            context: Parser2Context,
            primitive: Code6Moire2,
        ) -> None:
            """Evaluate code 6 moire primitive."""

        def on_code_7_thermal(
            self,
            context: Parser2Context,
            primitive: Code7Thermal2,
        ) -> None:
            """Evaluate code 7 thermal primitive."""

        def on_code_20_vector_line(
            self,
            context: Parser2Context,
            primitive: Code20VectorLine2,
        ) -> None:
            """Evaluate code 20 vector line primitive."""

        def on_code_21_center_line(
            self,
            context: Parser2Context,
            primitive: Code21CenterLine2,
        ) -> None:
            """Evaluate code 21 center line primitive."""

        def on_code_22_lower_left_line(
            self,
            context: Parser2Context,
            primitive: Code22LowerLeftLine2,
        ) -> None:
            """Evaluate code 22 lower left line primitive."""

        def on_assignment(
            self,
            context: Parser2Context,
            assignment: Assignment2,
        ) -> None:
            """Evaluate macro variable assignment statement."""

    class BeginBlockApertureTokenHooks(TokenHooksBase[BlockApertureBeginT]):
        """Hooks for visiting begin block aperture token (AB)."""

    class EndBlockApertureTokenHooks(TokenHooksBase[BlockApertureEndT]):
        """Hooks for visiting end block aperture token (AB)."""

    class DefineApertureCircleTokenHooks(TokenHooksBase[DefineCircleT]):
        """Hooks for visiting circle aperture definition token (ADD)."""

    class DefineApertureRectangleTokenHooks(TokenHooksBase[DefineRectangleT]):
        """Hooks for visiting rectangle aperture definition token (ADD)."""

    class DefineApertureObroundTokenHooks(TokenHooksBase[DefineObroundT]):
        """Hooks for visiting obround aperture definition token (ADD)."""

    class DefineAperturePolygonTokenHooks(TokenHooksBase[DefinePolygonT]):
        """Hooks for visiting polygon aperture definition token (ADD)."""

    class DefineApertureMacroTokenHooks(TokenHooksBase[DefineMacroT]):
        """Hooks for visiting macro aperture definition token (ADD)."""

    class DefineApertureTokenHooks(TokenHooksBase[DefineAnyT]):
        """Hooks for visiting any aperture definition token (ADD)."""

    class AxisSelectTokenHooksTokenHooks(TokenHooksBase[AxisSelectT]):
        """Hooks for visiting axis select token (AS)."""

    class CommandDrawTokenHooks(TokenHooksBase[D01DrawT]):
        """Hooks for visiting draw token (D01)."""

    class CommandMoveTokenHooks(TokenHooksBase[D02MoveT]):
        """Hooks for visiting move token (D02)."""

    class CommandFlashTokenHooks(TokenHooksBase[D03FlashT]):
        """Hooks for visiting flash token (D03)."""

    class SelectApertureTokenHooks(TokenHooksBase[DNNSelectApertureT]):
        """Hooks for visiting select aperture token (DNN)."""

    class CoordinateFormatTokenHooks(TokenHooksBase[CoordinateFormatT]):
        """Hooks for visiting coordinate format token (FS)."""

    class SetLinearTokenHooks(TokenHooksBase[SetLinearT]):
        """Hooks for visiting set linear token (G01)."""

    class SetClockwiseCircularTokenHooks(TokenHooksBase[SetClockwiseCircularT]):
        """Hooks for visiting set clockwise circular token (G02)."""

    class SetCounterClockwiseCircularTokenHooks(
        TokenHooksBase[SetCounterclockwiseCircularT],
    ):
        """Hooks for visiting set counter clockwise circular token (G03)."""

    class CommentTokenHooks(TokenHooksBase[CommentT]):
        """Hooks for visiting comment token (G04)."""

    class BeginRegionTokenHooks(TokenHooksBase[BeginRegionT]):
        """Hooks for visiting begin region token (G36)."""

    class EndRegionTokenHooks(TokenHooksBase[EndRegionT]):
        """Hooks for visiting end region token (G37)."""

    class PrepareSelectApertureTokenHooks(TokenHooksBase[G54SelectApertureT]):
        """Hooks for visiting prepare select aperture token (G54)."""

    class SetUnitInchTokenHooks(TokenHooksBase[SetUnitInchT]):
        """Hooks for visiting set unit inch token (G70)."""

    class SetUnitMillimetersTokenHooks(TokenHooksBase[SetUnitMillimetersT]):
        """Hooks for visiting set unit millimeters token (G71)."""

    class SetSingleQuadrantModeTokenHooks(TokenHooksBase[SetSingleQuadrantModeT]):
        """Hooks for visiting set single-quadrant mode token (G74)."""

    class SetMultiQuadrantModeTokenHooks(TokenHooksBase[SetMultiQuadrantModeT]):
        """Hooks for visiting set multi-quadrant mode token (G75)."""

    class SetCoordinateAbsoluteTokenHooks(TokenHooksBase[SetAbsoluteNotationT]):
        """Hooks for visiting set coordinate absolute token (G90)."""

    class SetCoordinateIncrementalTokenHooks(TokenHooksBase[SetIncrementalNotationT]):
        """Hooks for visiting set coordinate incremental token (G91)."""

    class ImageNameTokenHooks(TokenHooksBase[ImageNameT]):
        """Hooks for visiting image name token (IN)."""

    class InvalidTokenHooks(TokenHooksBase[InvalidTokenT]):
        """Hooks for visiting invalid token."""

    class ImagePolarityTokenHooks(TokenHooksBase[ImagePolarityT]):
        """Hooks for visiting image polarity token (IP)."""

    class LoadMirroringTokenHooks(TokenHooksBase[LoadMirroringT]):
        """Hooks for visiting load mirroring token (LM)."""

    class LoadNameTokenHooks(TokenHooksBase[LoadNameT]):
        """Hooks for visiting load name token (LN)."""

    class LoadPolarityTokenHooks(TokenHooksBase[LoadPolarityT]):
        """Hooks for visiting load polarity token (LP)."""

    class LoadRotationTokenHooks(TokenHooksBase[LoadRotationT]):
        """Hooks for visiting load rotation token (LR)."""

    class LoadScalingTokenHooks(TokenHooksBase[LoadScalingT]):
        """Hooks for visiting load scaling token (LS)."""

    class ProgramStopTokenHooks(TokenHooksBase[M00ProgramStopT]):
        """Hooks for visiting program stop token (M00)."""

    class OptionalStopTokenHooks(TokenHooksBase[M01OptionalStopT]):
        """Hooks for visiting optional stop token (M01)."""

    class EndOfFileTokenHooks(TokenHooksBase[M02EndOfFileT]):
        """Hooks for visiting end of file token (M02)."""

    class UnitModeTokenHooks(TokenHooksBase[UnitModeT]):
        """Hooks for visiting unit mode token (MO)."""

    class ImageOffsetTokenHooks(TokenHooksBase[ImageOffsetT]):
        """Hooks for visiting image offset token (OF)."""

    class StepRepeatBeginTokenHooks(TokenHooksBase[StepRepeatBeginT]):
        """Hooks for visiting step and repeat begin token (SR)."""

    class StepRepeatEndTokenHooks(TokenHooksBase[StepRepeatEndT]):
        """Hooks for visiting step and repeat end token (SR)."""

    class ApertureAttributeHooks(TokenHooksBase[ApertureAttributeT]):
        """Hooks for visiting aperture attribute token (TA)."""

    class DeleteAttributeHooks(TokenHooksBase[DeleteAttributeT]):
        """Hooks for visiting delete attribute token (TD)."""

    class FileAttributeHooks(TokenHooksBase[FileAttributeT]):
        """Hooks for visiting file attribute token (TF)."""

    class ObjectAttributeHooks(TokenHooksBase[ObjectAttributeT]):
        """Hooks for visiting object attribute token (TO)."""

MacroBeginTokenHooks

Bases: TokenHooksBase[MacroBeginT]

Hooks for visiting macro definition begin token (AM).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroBeginTokenHooks(TokenHooksBase[MacroBeginT]):
    """Hooks for visiting macro definition begin token (AM)."""

MacroCode1CircleTokenHooks

Bases: TokenHooksBase[Code1CircleTokenT]

Hooks for visiting macro primitive code 0 circle.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode1CircleTokenHooks(TokenHooksBase[Code1CircleTokenT]):
    """Hooks for visiting macro primitive code 0 circle."""

MacroCode2VectorLineTokenHooks

Bases: TokenHooksBase[Code2VectorLineTokenT]

Hooks for visiting macro primitive code 2 vector line.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode2VectorLineTokenHooks(TokenHooksBase[Code2VectorLineTokenT]):
    """Hooks for visiting macro primitive code 2 vector line."""

MacroCode4OutlineTokenHooks

Bases: TokenHooksBase[Code4OutlineTokenT]

Hooks for visiting macro primitive code 4 outline.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode4OutlineTokenHooks(TokenHooksBase[Code4OutlineTokenT]):
    """Hooks for visiting macro primitive code 4 outline."""

MacroCode5PolygonTokenHooks

Bases: TokenHooksBase[Code5PolygonTokenT]

Hooks for visiting macro primitive code 5 polygon.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode5PolygonTokenHooks(TokenHooksBase[Code5PolygonTokenT]):
    """Hooks for visiting macro primitive code 5 polygon."""

MacroCode6MoireTokenHooks

Bases: TokenHooksBase[Code6MoireTokenT]

Hooks for visiting macro primitive code 6 moire.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode6MoireTokenHooks(TokenHooksBase[Code6MoireTokenT]):
    """Hooks for visiting macro primitive code 6 moire."""

MacroCode7ThermalTokenHooks

Bases: TokenHooksBase[Code7ThermalTokenT]

Hooks for visiting macro primitive code 7 thermal.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode7ThermalTokenHooks(TokenHooksBase[Code7ThermalTokenT]):
    """Hooks for visiting macro primitive code 7 thermal."""

MacroCode20VectorLineTokenHooks

Bases: TokenHooksBase[Code20VectorLineTokenT]

Hooks for visiting macro primitive code 20 vector line.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode20VectorLineTokenHooks(TokenHooksBase[Code20VectorLineTokenT]):
    """Hooks for visiting macro primitive code 20 vector line."""

MacroCode21CenterLineTokenHooks

Bases: TokenHooksBase[Code21CenterLineTokenT]

Hooks for visiting macro primitive code 21 center line.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode21CenterLineTokenHooks(TokenHooksBase[Code21CenterLineTokenT]):
    """Hooks for visiting macro primitive code 21 center line."""

MacroCode22LowerLeftLineTokenHooks

Bases: TokenHooksBase[Code22LowerLeftLineTokenT]

Hooks for visiting macro primitive code 22 lower left line.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroCode22LowerLeftLineTokenHooks(TokenHooksBase[Code22LowerLeftLineTokenT]):
    """Hooks for visiting macro primitive code 22 lower left line."""

MacroVariableAssignment

Bases: TokenHooksBase[MacroVariableAssignmentT]

Hooks for visiting macro variable assignment token.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroVariableAssignment(TokenHooksBase[MacroVariableAssignmentT]):
    """Hooks for visiting macro variable assignment token."""

MacroDefinitionTokenHooks

Bases: TokenHooksBase[MacroDefinitionT]

Hooks for visiting macro definition token (AM).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroDefinitionTokenHooks(TokenHooksBase[MacroDefinitionT]):
    """Hooks for visiting macro definition token (AM)."""

MacroEvalHooks

Hooks called when evaluating macro aperture.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class MacroEvalHooks:
    """Hooks called when evaluating macro aperture."""

    def on_code_1_circle(
        self,
        context: Parser2Context,
        primitive: Code1Circle2,
    ) -> None:
        """Evaluate code 1 circle primitive."""

    def on_code_2_vector_line(
        self,
        context: Parser2Context,
        primitive: Code2VectorLine2,
    ) -> None:
        """Evaluate code 2 vector line primitive."""

    def on_code_4_outline(
        self,
        context: Parser2Context,
        primitive: Code4Outline2,
    ) -> None:
        """Evaluate code 4 outline primitive."""

    def on_code_5_polygon(
        self,
        context: Parser2Context,
        primitive: Code5Polygon2,
    ) -> None:
        """Evaluate code 5 polygon primitive."""

    def on_code_6_moire(
        self,
        context: Parser2Context,
        primitive: Code6Moire2,
    ) -> None:
        """Evaluate code 6 moire primitive."""

    def on_code_7_thermal(
        self,
        context: Parser2Context,
        primitive: Code7Thermal2,
    ) -> None:
        """Evaluate code 7 thermal primitive."""

    def on_code_20_vector_line(
        self,
        context: Parser2Context,
        primitive: Code20VectorLine2,
    ) -> None:
        """Evaluate code 20 vector line primitive."""

    def on_code_21_center_line(
        self,
        context: Parser2Context,
        primitive: Code21CenterLine2,
    ) -> None:
        """Evaluate code 21 center line primitive."""

    def on_code_22_lower_left_line(
        self,
        context: Parser2Context,
        primitive: Code22LowerLeftLine2,
    ) -> None:
        """Evaluate code 22 lower left line primitive."""

    def on_assignment(
        self,
        context: Parser2Context,
        assignment: Assignment2,
    ) -> None:
        """Evaluate macro variable assignment statement."""
on_code_1_circle
on_code_1_circle(
    context: Parser2Context, primitive: Code1Circle2
) -> None

Evaluate code 1 circle primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_1_circle(
    self,
    context: Parser2Context,
    primitive: Code1Circle2,
) -> None:
    """Evaluate code 1 circle primitive."""
on_code_2_vector_line
on_code_2_vector_line(
    context: Parser2Context, primitive: Code2VectorLine2
) -> None

Evaluate code 2 vector line primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_2_vector_line(
    self,
    context: Parser2Context,
    primitive: Code2VectorLine2,
) -> None:
    """Evaluate code 2 vector line primitive."""
on_code_4_outline
on_code_4_outline(
    context: Parser2Context, primitive: Code4Outline2
) -> None

Evaluate code 4 outline primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_4_outline(
    self,
    context: Parser2Context,
    primitive: Code4Outline2,
) -> None:
    """Evaluate code 4 outline primitive."""
on_code_5_polygon
on_code_5_polygon(
    context: Parser2Context, primitive: Code5Polygon2
) -> None

Evaluate code 5 polygon primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_5_polygon(
    self,
    context: Parser2Context,
    primitive: Code5Polygon2,
) -> None:
    """Evaluate code 5 polygon primitive."""
on_code_6_moire
on_code_6_moire(
    context: Parser2Context, primitive: Code6Moire2
) -> None

Evaluate code 6 moire primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_6_moire(
    self,
    context: Parser2Context,
    primitive: Code6Moire2,
) -> None:
    """Evaluate code 6 moire primitive."""
on_code_7_thermal
on_code_7_thermal(
    context: Parser2Context, primitive: Code7Thermal2
) -> None

Evaluate code 7 thermal primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_7_thermal(
    self,
    context: Parser2Context,
    primitive: Code7Thermal2,
) -> None:
    """Evaluate code 7 thermal primitive."""
on_code_20_vector_line
on_code_20_vector_line(
    context: Parser2Context, primitive: Code20VectorLine2
) -> None

Evaluate code 20 vector line primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_20_vector_line(
    self,
    context: Parser2Context,
    primitive: Code20VectorLine2,
) -> None:
    """Evaluate code 20 vector line primitive."""
on_code_21_center_line
on_code_21_center_line(
    context: Parser2Context, primitive: Code21CenterLine2
) -> None

Evaluate code 21 center line primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_21_center_line(
    self,
    context: Parser2Context,
    primitive: Code21CenterLine2,
) -> None:
    """Evaluate code 21 center line primitive."""
on_code_22_lower_left_line
on_code_22_lower_left_line(
    context: Parser2Context, primitive: Code22LowerLeftLine2
) -> None

Evaluate code 22 lower left line primitive.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_code_22_lower_left_line(
    self,
    context: Parser2Context,
    primitive: Code22LowerLeftLine2,
) -> None:
    """Evaluate code 22 lower left line primitive."""
on_assignment
on_assignment(
    context: Parser2Context, assignment: Assignment2
) -> None

Evaluate macro variable assignment statement.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_assignment(
    self,
    context: Parser2Context,
    assignment: Assignment2,
) -> None:
    """Evaluate macro variable assignment statement."""

BeginBlockApertureTokenHooks

Bases: TokenHooksBase[BlockApertureBeginT]

Hooks for visiting begin block aperture token (AB).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class BeginBlockApertureTokenHooks(TokenHooksBase[BlockApertureBeginT]):
    """Hooks for visiting begin block aperture token (AB)."""

EndBlockApertureTokenHooks

Bases: TokenHooksBase[BlockApertureEndT]

Hooks for visiting end block aperture token (AB).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class EndBlockApertureTokenHooks(TokenHooksBase[BlockApertureEndT]):
    """Hooks for visiting end block aperture token (AB)."""

DefineApertureCircleTokenHooks

Bases: TokenHooksBase[DefineCircleT]

Hooks for visiting circle aperture definition token (ADD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DefineApertureCircleTokenHooks(TokenHooksBase[DefineCircleT]):
    """Hooks for visiting circle aperture definition token (ADD)."""

DefineApertureRectangleTokenHooks

Bases: TokenHooksBase[DefineRectangleT]

Hooks for visiting rectangle aperture definition token (ADD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DefineApertureRectangleTokenHooks(TokenHooksBase[DefineRectangleT]):
    """Hooks for visiting rectangle aperture definition token (ADD)."""

DefineApertureObroundTokenHooks

Bases: TokenHooksBase[DefineObroundT]

Hooks for visiting obround aperture definition token (ADD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DefineApertureObroundTokenHooks(TokenHooksBase[DefineObroundT]):
    """Hooks for visiting obround aperture definition token (ADD)."""

DefineAperturePolygonTokenHooks

Bases: TokenHooksBase[DefinePolygonT]

Hooks for visiting polygon aperture definition token (ADD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DefineAperturePolygonTokenHooks(TokenHooksBase[DefinePolygonT]):
    """Hooks for visiting polygon aperture definition token (ADD)."""

DefineApertureMacroTokenHooks

Bases: TokenHooksBase[DefineMacroT]

Hooks for visiting macro aperture definition token (ADD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DefineApertureMacroTokenHooks(TokenHooksBase[DefineMacroT]):
    """Hooks for visiting macro aperture definition token (ADD)."""

DefineApertureTokenHooks

Bases: TokenHooksBase[DefineAnyT]

Hooks for visiting any aperture definition token (ADD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DefineApertureTokenHooks(TokenHooksBase[DefineAnyT]):
    """Hooks for visiting any aperture definition token (ADD)."""

AxisSelectTokenHooksTokenHooks

Bases: TokenHooksBase[AxisSelectT]

Hooks for visiting axis select token (AS).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class AxisSelectTokenHooksTokenHooks(TokenHooksBase[AxisSelectT]):
    """Hooks for visiting axis select token (AS)."""

CommandDrawTokenHooks

Bases: TokenHooksBase[D01DrawT]

Hooks for visiting draw token (D01).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class CommandDrawTokenHooks(TokenHooksBase[D01DrawT]):
    """Hooks for visiting draw token (D01)."""

CommandMoveTokenHooks

Bases: TokenHooksBase[D02MoveT]

Hooks for visiting move token (D02).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class CommandMoveTokenHooks(TokenHooksBase[D02MoveT]):
    """Hooks for visiting move token (D02)."""

CommandFlashTokenHooks

Bases: TokenHooksBase[D03FlashT]

Hooks for visiting flash token (D03).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class CommandFlashTokenHooks(TokenHooksBase[D03FlashT]):
    """Hooks for visiting flash token (D03)."""

SelectApertureTokenHooks

Bases: TokenHooksBase[DNNSelectApertureT]

Hooks for visiting select aperture token (DNN).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SelectApertureTokenHooks(TokenHooksBase[DNNSelectApertureT]):
    """Hooks for visiting select aperture token (DNN)."""

CoordinateFormatTokenHooks

Bases: TokenHooksBase[CoordinateFormatT]

Hooks for visiting coordinate format token (FS).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class CoordinateFormatTokenHooks(TokenHooksBase[CoordinateFormatT]):
    """Hooks for visiting coordinate format token (FS)."""

SetLinearTokenHooks

Bases: TokenHooksBase[SetLinearT]

Hooks for visiting set linear token (G01).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetLinearTokenHooks(TokenHooksBase[SetLinearT]):
    """Hooks for visiting set linear token (G01)."""

SetClockwiseCircularTokenHooks

Bases: TokenHooksBase[SetClockwiseCircularT]

Hooks for visiting set clockwise circular token (G02).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetClockwiseCircularTokenHooks(TokenHooksBase[SetClockwiseCircularT]):
    """Hooks for visiting set clockwise circular token (G02)."""

SetCounterClockwiseCircularTokenHooks

Bases: TokenHooksBase[SetCounterclockwiseCircularT]

Hooks for visiting set counter clockwise circular token (G03).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetCounterClockwiseCircularTokenHooks(
    TokenHooksBase[SetCounterclockwiseCircularT],
):
    """Hooks for visiting set counter clockwise circular token (G03)."""

CommentTokenHooks

Bases: TokenHooksBase[CommentT]

Hooks for visiting comment token (G04).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class CommentTokenHooks(TokenHooksBase[CommentT]):
    """Hooks for visiting comment token (G04)."""

BeginRegionTokenHooks

Bases: TokenHooksBase[BeginRegionT]

Hooks for visiting begin region token (G36).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class BeginRegionTokenHooks(TokenHooksBase[BeginRegionT]):
    """Hooks for visiting begin region token (G36)."""

EndRegionTokenHooks

Bases: TokenHooksBase[EndRegionT]

Hooks for visiting end region token (G37).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class EndRegionTokenHooks(TokenHooksBase[EndRegionT]):
    """Hooks for visiting end region token (G37)."""

PrepareSelectApertureTokenHooks

Bases: TokenHooksBase[G54SelectApertureT]

Hooks for visiting prepare select aperture token (G54).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class PrepareSelectApertureTokenHooks(TokenHooksBase[G54SelectApertureT]):
    """Hooks for visiting prepare select aperture token (G54)."""

SetUnitInchTokenHooks

Bases: TokenHooksBase[SetUnitInchT]

Hooks for visiting set unit inch token (G70).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetUnitInchTokenHooks(TokenHooksBase[SetUnitInchT]):
    """Hooks for visiting set unit inch token (G70)."""

SetUnitMillimetersTokenHooks

Bases: TokenHooksBase[SetUnitMillimetersT]

Hooks for visiting set unit millimeters token (G71).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetUnitMillimetersTokenHooks(TokenHooksBase[SetUnitMillimetersT]):
    """Hooks for visiting set unit millimeters token (G71)."""

SetSingleQuadrantModeTokenHooks

Bases: TokenHooksBase[SetSingleQuadrantModeT]

Hooks for visiting set single-quadrant mode token (G74).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetSingleQuadrantModeTokenHooks(TokenHooksBase[SetSingleQuadrantModeT]):
    """Hooks for visiting set single-quadrant mode token (G74)."""

SetMultiQuadrantModeTokenHooks

Bases: TokenHooksBase[SetMultiQuadrantModeT]

Hooks for visiting set multi-quadrant mode token (G75).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetMultiQuadrantModeTokenHooks(TokenHooksBase[SetMultiQuadrantModeT]):
    """Hooks for visiting set multi-quadrant mode token (G75)."""

SetCoordinateAbsoluteTokenHooks

Bases: TokenHooksBase[SetAbsoluteNotationT]

Hooks for visiting set coordinate absolute token (G90).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetCoordinateAbsoluteTokenHooks(TokenHooksBase[SetAbsoluteNotationT]):
    """Hooks for visiting set coordinate absolute token (G90)."""

SetCoordinateIncrementalTokenHooks

Bases: TokenHooksBase[SetIncrementalNotationT]

Hooks for visiting set coordinate incremental token (G91).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class SetCoordinateIncrementalTokenHooks(TokenHooksBase[SetIncrementalNotationT]):
    """Hooks for visiting set coordinate incremental token (G91)."""

ImageNameTokenHooks

Bases: TokenHooksBase[ImageNameT]

Hooks for visiting image name token (IN).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class ImageNameTokenHooks(TokenHooksBase[ImageNameT]):
    """Hooks for visiting image name token (IN)."""

InvalidTokenHooks

Bases: TokenHooksBase[InvalidTokenT]

Hooks for visiting invalid token.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class InvalidTokenHooks(TokenHooksBase[InvalidTokenT]):
    """Hooks for visiting invalid token."""

ImagePolarityTokenHooks

Bases: TokenHooksBase[ImagePolarityT]

Hooks for visiting image polarity token (IP).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class ImagePolarityTokenHooks(TokenHooksBase[ImagePolarityT]):
    """Hooks for visiting image polarity token (IP)."""

LoadMirroringTokenHooks

Bases: TokenHooksBase[LoadMirroringT]

Hooks for visiting load mirroring token (LM).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class LoadMirroringTokenHooks(TokenHooksBase[LoadMirroringT]):
    """Hooks for visiting load mirroring token (LM)."""

LoadNameTokenHooks

Bases: TokenHooksBase[LoadNameT]

Hooks for visiting load name token (LN).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class LoadNameTokenHooks(TokenHooksBase[LoadNameT]):
    """Hooks for visiting load name token (LN)."""

LoadPolarityTokenHooks

Bases: TokenHooksBase[LoadPolarityT]

Hooks for visiting load polarity token (LP).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class LoadPolarityTokenHooks(TokenHooksBase[LoadPolarityT]):
    """Hooks for visiting load polarity token (LP)."""

LoadRotationTokenHooks

Bases: TokenHooksBase[LoadRotationT]

Hooks for visiting load rotation token (LR).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class LoadRotationTokenHooks(TokenHooksBase[LoadRotationT]):
    """Hooks for visiting load rotation token (LR)."""

LoadScalingTokenHooks

Bases: TokenHooksBase[LoadScalingT]

Hooks for visiting load scaling token (LS).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class LoadScalingTokenHooks(TokenHooksBase[LoadScalingT]):
    """Hooks for visiting load scaling token (LS)."""

ProgramStopTokenHooks

Bases: TokenHooksBase[M00ProgramStopT]

Hooks for visiting program stop token (M00).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class ProgramStopTokenHooks(TokenHooksBase[M00ProgramStopT]):
    """Hooks for visiting program stop token (M00)."""

OptionalStopTokenHooks

Bases: TokenHooksBase[M01OptionalStopT]

Hooks for visiting optional stop token (M01).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class OptionalStopTokenHooks(TokenHooksBase[M01OptionalStopT]):
    """Hooks for visiting optional stop token (M01)."""

EndOfFileTokenHooks

Bases: TokenHooksBase[M02EndOfFileT]

Hooks for visiting end of file token (M02).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class EndOfFileTokenHooks(TokenHooksBase[M02EndOfFileT]):
    """Hooks for visiting end of file token (M02)."""

UnitModeTokenHooks

Bases: TokenHooksBase[UnitModeT]

Hooks for visiting unit mode token (MO).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class UnitModeTokenHooks(TokenHooksBase[UnitModeT]):
    """Hooks for visiting unit mode token (MO)."""

ImageOffsetTokenHooks

Bases: TokenHooksBase[ImageOffsetT]

Hooks for visiting image offset token (OF).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class ImageOffsetTokenHooks(TokenHooksBase[ImageOffsetT]):
    """Hooks for visiting image offset token (OF)."""

StepRepeatBeginTokenHooks

Bases: TokenHooksBase[StepRepeatBeginT]

Hooks for visiting step and repeat begin token (SR).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class StepRepeatBeginTokenHooks(TokenHooksBase[StepRepeatBeginT]):
    """Hooks for visiting step and repeat begin token (SR)."""

StepRepeatEndTokenHooks

Bases: TokenHooksBase[StepRepeatEndT]

Hooks for visiting step and repeat end token (SR).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class StepRepeatEndTokenHooks(TokenHooksBase[StepRepeatEndT]):
    """Hooks for visiting step and repeat end token (SR)."""

ApertureAttributeHooks

Bases: TokenHooksBase[ApertureAttributeT]

Hooks for visiting aperture attribute token (TA).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class ApertureAttributeHooks(TokenHooksBase[ApertureAttributeT]):
    """Hooks for visiting aperture attribute token (TA)."""

DeleteAttributeHooks

Bases: TokenHooksBase[DeleteAttributeT]

Hooks for visiting delete attribute token (TD).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class DeleteAttributeHooks(TokenHooksBase[DeleteAttributeT]):
    """Hooks for visiting delete attribute token (TD)."""

FileAttributeHooks

Bases: TokenHooksBase[FileAttributeT]

Hooks for visiting file attribute token (TF).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class FileAttributeHooks(TokenHooksBase[FileAttributeT]):
    """Hooks for visiting file attribute token (TF)."""

ObjectAttributeHooks

Bases: TokenHooksBase[ObjectAttributeT]

Hooks for visiting object attribute token (TO).

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
class ObjectAttributeHooks(TokenHooksBase[ObjectAttributeT]):
    """Hooks for visiting object attribute token (TO)."""

on_parser_init

on_parser_init(parser: Parser2) -> None

Called after parser initialization.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_parser_init(self, parser: Parser2) -> None:
    """Called after parser initialization."""

pre_parse

pre_parse(context: Parser2Context) -> None

Called before parsing starts.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def pre_parse(self, context: Parser2Context) -> None:
    """Called before parsing starts."""

post_parse

post_parse(context: Parser2Context) -> None

Called after parsing finishes.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def post_parse(self, context: Parser2Context) -> None:
    """Called after parsing finishes."""

on_parser_error

on_parser_error(
    context: Parser2Context, error: Parser2Error
) -> None

Called when parsing error is thrown.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_parser_error(self, context: Parser2Context, error: Parser2Error) -> None:
    """Called when parsing error is thrown."""

on_other_error

on_other_error(
    context: Parser2Context, error: Exception
) -> None

Called when other error is thrown.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def on_other_error(self, context: Parser2Context, error: Exception) -> None:
    """Called when other error is thrown."""

pre_parser_visit_any_token

pre_parser_visit_any_token(context: Parser2Context) -> None

Called before parser visits any token.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def pre_parser_visit_any_token(self, context: Parser2Context) -> None:
    """Called before parser visits any token."""

post_parser_visit_any_token

post_parser_visit_any_token(
    context: Parser2Context,
) -> None

Called after parser visits any token.

Source code in src\pygerber\gerberx3\parser2\parser2hooks_base.py
def post_parser_visit_any_token(self, context: Parser2Context) -> None:
    """Called after parser visits any token."""