Open yonatanLehman opened 6 years ago
What C# code do you try to parse?
It's some internal code. BTW = a simpler way to solve the problem is to replace the code as follows (I can do this in the .g4)
Stack<Boolean> conditions = new Stack<Boolean>() {{ push(true); }}
HashSet<String> ConditionalSymbols = new HashSet<String>() {{ add("DEBUG"); }}
Looking at examples of the use of {{ }} this seems to be the correct way to do it (i.e. call the method directly and not via the global which has not yet been assigned).
The CSharpPreprocessirParser.g4 contains the lines
As I understand it this is added to the preprocess parser code. The problem is when I do
It crashes in the constructor of CSharpPreprocessorParser. The reason being that the code in the double braches is accessing a null pointer (conditions and ConditionalSymbols)
I patched around this by doing the initialization in functions added from the constructor like so:
Am I do something wrong or is this a problem? I'm using InteliJ 2017.2 with Java JRE 1.8.