-
Is it possible to store information in a Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yes, that should be possible. There are two options: First you could use the provided node class and simply store a different type in it. We do this here: PEGTL/src/example/pegtl/abnf2pegtl.cpp Lines 277 to 289 in f0b76a1 That is the simple, but also limited way. If you are looking for a more advanced solution, I recommend you write your own node class. The design of the parse-tree supports this. You can derive from the existing node class, overwrite some methods and add member as needed. Again, the above PEGTL/src/example/pegtl/abnf2pegtl.cpp Lines 244 to 249 in f0b76a1 although the above does not add more members and just overwrite an existing method from the node class. Let me know if any of those options works for you or if you need something else. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I'll try the first one out and see how far it takes me. |
Beta Was this translation helpful? Give feedback.
Yes, that should be possible. There are two options: First you could use the provided node class and simply store a different type in it. We do this here:
PEGTL/src/example/pegtl/abnf2pegtl.cpp
Lines 277 to 289 in f0b76a1
That is the simple, but also limited way.
If you are looking for a more advanced solution, I recommend you write your …