I have a working lexer and semi-working parser. My data contains name=value pairs , and value can be an object in itself. I am trying to determine how deep in the tree I am when my method for the nested object is being called. I tried to add indentLevel as the member of Parser, but that fails. I understand why - it is because the nested elements are reduced before the object itself, but I do not see a proper way to do it. Please advice. See code snippet below.
I have a working lexer and semi-working parser. My data contains name=value pairs , and value can be an object in itself. I am trying to determine how deep in the tree I am when my method for the nested object is being called. I tried to add
indentLevel
as the member of Parser, but that fails. I understand why - it is because the nested elements are reduced before the object itself, but I do not see a proper way to do it. Please advice. See code snippet below.