0

In Lark parser how do I pass out of bound data to the Transformer, so I can process the text differently based on the value of the argument f.e.. lets say I can modify the Parser, then i want a behavior as if ...

parser.parse(txt, my_arg='blah')

class Parser :

     def parse(self, txt, my_arg):
            ............
            self.transformer.my_arg = my_arg

class T(Transformer):

     def block(self,items):
        if self.my_arg == 'blah' : ....
        else: ...
sten
  • 7,028
  • 9
  • 41
  • 63

0 Answers0