diff --git a/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc b/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc index b13cf488136..f19c70422a6 100644 --- a/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc +++ b/src/org/rascalmpl/library/lang/rascal/grammar/ParserGenerator.rsc @@ -216,7 +216,7 @@ public str newGenerate(str package, str name, Grammar gr) { ' protected static class { ' public final static AbstractStackNode\[] EXPECTS; ' static{ - ' ExpectBuilder\ builder = new ExpectBuilder\(_resultStoreIdMappings); + ' ExpectBuilder\ builder = new ExpectBuilder\(_dontNest, _resultStoreIdMappings); ' init(builder); ' EXPECTS = builder.buildExpectArray(); ' } diff --git a/src/org/rascalmpl/library/lang/rascal/syntax/RascalParser.java b/src/org/rascalmpl/library/lang/rascal/syntax/RascalParser.java index dba7c8d38da..cb57f46eda0 100644 --- a/src/org/rascalmpl/library/lang/rascal/syntax/RascalParser.java +++ b/src/org/rascalmpl/library/lang/rascal/syntax/RascalParser.java @@ -4343,7 +4343,7 @@ protected IntegerList getFilteredParents(int childId) { protected static class RealLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4437,7 +4437,7 @@ public static void init(ExpectBuilder builder){ protected static class Tags { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4470,7 +4470,7 @@ public static void init(ExpectBuilder builder){ protected static class start__EvalCommand { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4493,7 +4493,7 @@ public static void init(ExpectBuilder builder){ protected static class ModuleActuals { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4530,7 +4530,7 @@ public static void init(ExpectBuilder builder){ protected static class Renamings { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4565,7 +4565,7 @@ public static void init(ExpectBuilder builder){ protected static class KeywordFormal { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4616,7 +4616,7 @@ public static void init(ExpectBuilder builder){ protected static class MidPathChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4651,7 +4651,7 @@ public static void init(ExpectBuilder builder){ protected static class OptionalExpression { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4692,7 +4692,7 @@ public static void init(ExpectBuilder builder){ protected static class layouts_$default$ { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4713,7 +4713,7 @@ public static void init(ExpectBuilder builder){ protected static class PathPart { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4758,7 +4758,7 @@ public static void init(ExpectBuilder builder){ protected static class Signature { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -4815,7 +4815,7 @@ public static void init(ExpectBuilder builder){ protected static class Expression { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -5714,7 +5714,7 @@ public static void init(ExpectBuilder builder){ protected static class Class { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -5809,7 +5809,7 @@ public static void init(ExpectBuilder builder){ protected static class ShellCommand { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -5932,7 +5932,7 @@ public static void init(ExpectBuilder builder){ protected static class DataTarget { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -5975,7 +5975,7 @@ public static void init(ExpectBuilder builder){ protected static class KeywordFormals { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6018,7 +6018,7 @@ public static void init(ExpectBuilder builder){ protected static class Renaming { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6067,7 +6067,7 @@ public static void init(ExpectBuilder builder){ protected static class Catch { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6130,7 +6130,7 @@ public static void init(ExpectBuilder builder){ protected static class Tag { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6203,7 +6203,7 @@ public static void init(ExpectBuilder builder){ protected static class FunctionBody { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6240,7 +6240,7 @@ public static void init(ExpectBuilder builder){ protected static class start__Module { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6263,7 +6263,7 @@ public static void init(ExpectBuilder builder){ protected static class Field { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6316,7 +6316,7 @@ public static void init(ExpectBuilder builder){ protected static class Type { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6421,7 +6421,7 @@ public static void init(ExpectBuilder builder){ protected static class LocationLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6456,7 +6456,7 @@ public static void init(ExpectBuilder builder){ protected static class Declaration { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6609,7 +6609,7 @@ public static void init(ExpectBuilder builder){ protected static class Range { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6666,7 +6666,7 @@ public static void init(ExpectBuilder builder){ protected static class OptionalComma { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6699,7 +6699,7 @@ public static void init(ExpectBuilder builder){ protected static class start__Command { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6722,7 +6722,7 @@ public static void init(ExpectBuilder builder){ protected static class PrePathChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6756,7 +6756,7 @@ public static void init(ExpectBuilder builder){ protected static class StringConstant { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6791,7 +6791,7 @@ public static void init(ExpectBuilder builder){ protected static class Variable { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6848,7 +6848,7 @@ public static void init(ExpectBuilder builder){ protected static class TypeArg { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6915,7 +6915,7 @@ public static void init(ExpectBuilder builder){ protected static class Bound { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -6958,7 +6958,7 @@ public static void init(ExpectBuilder builder){ protected static class DateAndTime { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7008,7 +7008,7 @@ public static void init(ExpectBuilder builder){ protected static class StringLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7065,7 +7065,7 @@ public static void init(ExpectBuilder builder){ protected static class Backslash { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7098,7 +7098,7 @@ public static void init(ExpectBuilder builder){ protected static class Char { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7148,7 +7148,7 @@ public static void init(ExpectBuilder builder){ protected static class start__Commands { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7171,7 +7171,7 @@ public static void init(ExpectBuilder builder){ protected static class CaseInsensitiveStringConstant { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7206,7 +7206,7 @@ public static void init(ExpectBuilder builder){ protected static class JustTime { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7252,7 +7252,7 @@ public static void init(ExpectBuilder builder){ protected static class Declarator { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7287,7 +7287,7 @@ public static void init(ExpectBuilder builder){ protected static class Target { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7328,7 +7328,7 @@ public static void init(ExpectBuilder builder){ protected static class IntegerLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7377,7 +7377,7 @@ public static void init(ExpectBuilder builder){ protected static class Pattern { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7642,7 +7642,7 @@ public static void init(ExpectBuilder builder){ protected static class PostPathChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7677,7 +7677,7 @@ public static void init(ExpectBuilder builder){ protected static class StringCharacter { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7749,7 +7749,7 @@ public static void init(ExpectBuilder builder){ protected static class ConcretePart { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7844,7 +7844,7 @@ public static void init(ExpectBuilder builder){ protected static class ImportedModule { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7909,7 +7909,7 @@ public static void init(ExpectBuilder builder){ protected static class PathChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -7943,7 +7943,7 @@ public static void init(ExpectBuilder builder){ protected static class Case { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8002,7 +8002,7 @@ public static void init(ExpectBuilder builder){ protected static class Strategy { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8075,7 +8075,7 @@ public static void init(ExpectBuilder builder){ protected static class LocalVariableDeclaration { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8118,7 +8118,7 @@ public static void init(ExpectBuilder builder){ protected static class Visibility { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8167,7 +8167,7 @@ public static void init(ExpectBuilder builder){ protected static class JustDate { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8202,7 +8202,7 @@ public static void init(ExpectBuilder builder){ protected static class FunctionType { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8241,7 +8241,7 @@ public static void init(ExpectBuilder builder){ protected static class Replacement { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8286,7 +8286,7 @@ public static void init(ExpectBuilder builder){ protected static class NamedBackslash { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8319,7 +8319,7 @@ public static void init(ExpectBuilder builder){ protected static class Assoc { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8376,7 +8376,7 @@ public static void init(ExpectBuilder builder){ protected static class PathTail { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8421,7 +8421,7 @@ public static void init(ExpectBuilder builder){ protected static class MidProtocolChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8456,7 +8456,7 @@ public static void init(ExpectBuilder builder){ protected static class OctalIntegerLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8490,7 +8490,7 @@ public static void init(ExpectBuilder builder){ protected static class DateTimeLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8539,7 +8539,7 @@ public static void init(ExpectBuilder builder){ protected static class Kind { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -8636,7 +8636,7 @@ public static void init(ExpectBuilder builder){ protected static class RascalKeywords { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9225,7 +9225,7 @@ public static void init(ExpectBuilder builder){ protected static class Label { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9268,7 +9268,7 @@ public static void init(ExpectBuilder builder){ protected static class Prod { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9365,7 +9365,7 @@ public static void init(ExpectBuilder builder){ protected static class layouts_LAYOUTLIST { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9386,7 +9386,7 @@ public static void init(ExpectBuilder builder){ protected static class Comment { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9430,7 +9430,7 @@ public static void init(ExpectBuilder builder){ protected static class UnicodeEscape { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9493,7 +9493,7 @@ public static void init(ExpectBuilder builder){ protected static class SyntaxDefinition { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9586,7 +9586,7 @@ public static void init(ExpectBuilder builder){ protected static class ModuleParameters { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9623,7 +9623,7 @@ public static void init(ExpectBuilder builder){ protected static class DatePart { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9680,7 +9680,7 @@ public static void init(ExpectBuilder builder){ protected static class Assignable { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9853,7 +9853,7 @@ public static void init(ExpectBuilder builder){ protected static class Mapping_W3NvcnQoIlBhdHRlcm4iKV000 { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9902,7 +9902,7 @@ public static void init(ExpectBuilder builder){ protected static class Output { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -9957,7 +9957,7 @@ public static void init(ExpectBuilder builder){ protected static class RationalLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10004,7 +10004,7 @@ public static void init(ExpectBuilder builder){ protected static class BasicType { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10181,7 +10181,7 @@ public static void init(ExpectBuilder builder){ protected static class ProtocolTail { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10226,7 +10226,7 @@ public static void init(ExpectBuilder builder){ protected static class Commands { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10259,7 +10259,7 @@ public static void init(ExpectBuilder builder){ protected static class RegExpModifier { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10292,7 +10292,7 @@ public static void init(ExpectBuilder builder){ protected static class CommonKeywordParameters { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10337,7 +10337,7 @@ public static void init(ExpectBuilder builder){ protected static class Command { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10404,7 +10404,7 @@ public static void init(ExpectBuilder builder){ protected static class StringTemplate { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10563,7 +10563,7 @@ public static void init(ExpectBuilder builder){ protected static class Visit { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10630,7 +10630,7 @@ public static void init(ExpectBuilder builder){ protected static class StructuredType { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10669,7 +10669,7 @@ public static void init(ExpectBuilder builder){ protected static class ProtocolPart { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10714,7 +10714,7 @@ public static void init(ExpectBuilder builder){ protected static class Parameters { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10769,7 +10769,7 @@ public static void init(ExpectBuilder builder){ protected static class KeywordArguments_W3NvcnQoIlBhdHRlcm4iKV000 { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10812,7 +10812,7 @@ public static void init(ExpectBuilder builder){ protected static class DecimalIntegerLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10854,7 +10854,7 @@ public static void init(ExpectBuilder builder){ protected static class NamedRegExp { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10926,7 +10926,7 @@ public static void init(ExpectBuilder builder){ protected static class PreProtocolChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -10961,7 +10961,7 @@ public static void init(ExpectBuilder builder){ protected static class Header { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11016,7 +11016,7 @@ public static void init(ExpectBuilder builder){ protected static class ProtocolChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11051,7 +11051,7 @@ public static void init(ExpectBuilder builder){ protected static class Assignment { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11140,7 +11140,7 @@ public static void init(ExpectBuilder builder){ protected static class TypeVar { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11201,7 +11201,7 @@ public static void init(ExpectBuilder builder){ protected static class PostProtocolChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11236,7 +11236,7 @@ public static void init(ExpectBuilder builder){ protected static class Concrete { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11277,7 +11277,7 @@ public static void init(ExpectBuilder builder){ protected static class PatternWithAction { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11326,7 +11326,7 @@ public static void init(ExpectBuilder builder){ protected static class Module { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11361,7 +11361,7 @@ public static void init(ExpectBuilder builder){ protected static class MidStringChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11396,7 +11396,7 @@ public static void init(ExpectBuilder builder){ protected static class Toplevel { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11441,7 +11441,7 @@ public static void init(ExpectBuilder builder){ protected static class Statement { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11862,7 +11862,7 @@ public static void init(ExpectBuilder builder){ protected static class TimePartNoTZ { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11917,7 +11917,7 @@ public static void init(ExpectBuilder builder){ protected static class EvalCommand { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -11986,7 +11986,7 @@ public static void init(ExpectBuilder builder){ protected static class FunctionModifier { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12047,7 +12047,7 @@ public static void init(ExpectBuilder builder){ protected static class BooleanLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12088,7 +12088,7 @@ public static void init(ExpectBuilder builder){ protected static class KeywordArgument_W3NvcnQoIkV4cHJlc3Npb24iKV000 { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12137,7 +12137,7 @@ public static void init(ExpectBuilder builder){ protected static class Literal { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12226,7 +12226,7 @@ public static void init(ExpectBuilder builder){ protected static class ProdModifier { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12287,7 +12287,7 @@ public static void init(ExpectBuilder builder){ protected static class RegExpLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12323,7 +12323,7 @@ public static void init(ExpectBuilder builder){ protected static class KeywordArgument_W3NvcnQoIlBhdHRlcm4iKV000 { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12372,7 +12372,7 @@ public static void init(ExpectBuilder builder){ protected static class Nonterminal { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12405,7 +12405,7 @@ public static void init(ExpectBuilder builder){ protected static class PreStringChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12440,7 +12440,7 @@ public static void init(ExpectBuilder builder){ protected static class StringTail { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12497,7 +12497,7 @@ public static void init(ExpectBuilder builder){ protected static class RegExp { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12581,7 +12581,7 @@ public static void init(ExpectBuilder builder){ protected static class DataTypeSelector { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12618,7 +12618,7 @@ public static void init(ExpectBuilder builder){ protected static class TagString { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12653,7 +12653,7 @@ public static void init(ExpectBuilder builder){ protected static class NonterminalLabel { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12687,7 +12687,7 @@ public static void init(ExpectBuilder builder){ protected static class Name { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12742,7 +12742,7 @@ public static void init(ExpectBuilder builder){ protected static class FunctionDeclaration { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12835,7 +12835,7 @@ public static void init(ExpectBuilder builder){ protected static class Start { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12876,7 +12876,7 @@ public static void init(ExpectBuilder builder){ protected static class LAYOUT { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12929,7 +12929,7 @@ public static void init(ExpectBuilder builder){ protected static class Body { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -12962,7 +12962,7 @@ public static void init(ExpectBuilder builder){ protected static class Import { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13047,7 +13047,7 @@ public static void init(ExpectBuilder builder){ protected static class ConcreteHole { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13086,7 +13086,7 @@ public static void init(ExpectBuilder builder){ protected static class UserType { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13133,7 +13133,7 @@ public static void init(ExpectBuilder builder){ protected static class Variant { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13186,7 +13186,7 @@ public static void init(ExpectBuilder builder){ protected static class FunctionModifiers { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13219,7 +13219,7 @@ public static void init(ExpectBuilder builder){ protected static class TimeZonePart { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13287,7 +13287,7 @@ public static void init(ExpectBuilder builder){ protected static class PostStringChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13322,7 +13322,7 @@ public static void init(ExpectBuilder builder){ protected static class HexIntegerLiteral { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13357,7 +13357,7 @@ public static void init(ExpectBuilder builder){ protected static class KeywordArguments_W3NvcnQoIkV4cHJlc3Npb24iKV000 { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13400,7 +13400,7 @@ public static void init(ExpectBuilder builder){ protected static class Formals { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13433,7 +13433,7 @@ public static void init(ExpectBuilder builder){ protected static class Comprehension { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13510,7 +13510,7 @@ public static void init(ExpectBuilder builder){ protected static class Mapping_W3NvcnQoIkV4cHJlc3Npb24iKV000 { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13559,7 +13559,7 @@ public static void init(ExpectBuilder builder){ protected static class Sym { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13918,7 +13918,7 @@ public static void init(ExpectBuilder builder){ protected static class QualifiedName { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -13963,7 +13963,7 @@ public static void init(ExpectBuilder builder){ protected static class StringMiddle { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -14020,7 +14020,7 @@ public static void init(ExpectBuilder builder){ protected static class URLChars { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } diff --git a/src/org/rascalmpl/parser/gtd/preprocessing/ExpectBuilder.java b/src/org/rascalmpl/parser/gtd/preprocessing/ExpectBuilder.java index c5b7848feb1..5fbccf5d265 100644 --- a/src/org/rascalmpl/parser/gtd/preprocessing/ExpectBuilder.java +++ b/src/org/rascalmpl/parser/gtd/preprocessing/ExpectBuilder.java @@ -15,6 +15,8 @@ import org.rascalmpl.parser.gtd.stack.AbstractStackNode; import org.rascalmpl.parser.gtd.util.DoubleArrayList; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; +import org.rascalmpl.parser.gtd.util.IntegerList; import org.rascalmpl.parser.gtd.util.IntegerMap; import org.rascalmpl.parser.gtd.util.ObjectIntegerKeyedHashMap; import org.rascalmpl.parser.gtd.util.SortedIntegerObjectList; @@ -26,13 +28,15 @@ */ @SuppressWarnings("cast") public class ExpectBuilder

{ + private final IntegerKeyedHashMap dontNest; private final IntegerMap resultStoreMappings; private final SortedIntegerObjectList[]>> alternatives; - public ExpectBuilder(IntegerMap resultStoreMappings){ + public ExpectBuilder(IntegerKeyedHashMap dontNest, IntegerMap resultStoreMappings){ super(); - + + this.dontNest = dontNest; this.resultStoreMappings = resultStoreMappings; alternatives = new SortedIntegerObjectList[]>>(); @@ -86,7 +90,7 @@ public AbstractStackNode

[] buildExpectArray(){ AbstractStackNode

first = alternative[0]; int firstItemResultStoreId = resultStoreMappings.get(first.getId()); - if(isSharable(production)){ + if(isSharable(production) && dontNest.get(first.getId()) == null){ // Check if the first symbol in the alternative, with the same nesting restrictions, has been encountered before in another alternative. sharedExpect = constructedExpects.get(first, firstItemResultStoreId); } @@ -105,10 +109,13 @@ public AbstractStackNode

[] buildExpectArray(){ int k = 1; CHAIN: for(; k < alternative.length; ++k){ AbstractStackNode

alternativeItem = alternative[k]; + if(dontNest.get(alternativeItem.getId()) != null) { + break; // Don't share items with nesting restrictions associated with them + } int alternativeItemResultStoreId = resultStoreMappings.get(alternativeItem.getId()); AbstractStackNode

sharedExpectItem = sharedExpect[k]; - + // Can't share the current alternative's symbol with the shared alternative we are currently matching against; try all other possible continuations to find a potential match. if(!alternativeItem.isEqual(sharedExpectItem) || alternativeItemResultStoreId != resultStoreMappings.get(sharedExpectItem.getId())){ AbstractStackNode

[][] otherSharedExpects = sharedExpectItem.getAlternateProductions(); diff --git a/test/org/rascalmpl/test/parser/Ambiguous8.java b/test/org/rascalmpl/test/parser/Ambiguous8.java index 3015a518454..2bc7b35d445 100644 --- a/test/org/rascalmpl/test/parser/Ambiguous8.java +++ b/test/org/rascalmpl/test/parser/Ambiguous8.java @@ -20,6 +20,7 @@ import org.rascalmpl.parser.gtd.stack.AbstractStackNode; import org.rascalmpl.parser.gtd.stack.LiteralStackNode; import org.rascalmpl.parser.gtd.stack.NonTerminalStackNode; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; import org.rascalmpl.parser.gtd.util.IntegerMap; import org.rascalmpl.parser.uptr.UPTRNodeFactory; import io.usethesource.vallang.IConstructor; @@ -64,7 +65,7 @@ public class Ambiguous8 extends SGTDBF imp private final static AbstractStackNode[] S_EXPECTS; static{ - ExpectBuilder sExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder sExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); sExpectBuilder.addAlternative(PROD_S_AB, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_A0, NONTERMINAL_B1}); sExpectBuilder.addAlternative(PROD_S_AC, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_A0, NONTERMINAL_C2}); S_EXPECTS = sExpectBuilder.buildExpectArray(); @@ -72,21 +73,21 @@ public class Ambiguous8 extends SGTDBF imp private final static AbstractStackNode[] A_EXPECTS; static{ - ExpectBuilder aExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder aExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); aExpectBuilder.addAlternative(PROD_A_a, (AbstractStackNode[]) new AbstractStackNode[]{LITERAL_a3}); A_EXPECTS = aExpectBuilder.buildExpectArray(); } private final static AbstractStackNode[] B_EXPECTS; static{ - ExpectBuilder bExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder bExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); bExpectBuilder.addAlternative(PROD_B_a, (AbstractStackNode[]) new AbstractStackNode[]{LITERAL_a4}); B_EXPECTS = bExpectBuilder.buildExpectArray(); } private final static AbstractStackNode[] C_EXPECTS; static{ - ExpectBuilder cExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder cExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); cExpectBuilder.addAlternative(PROD_C_a, (AbstractStackNode[]) new AbstractStackNode[]{LITERAL_a5}); C_EXPECTS = cExpectBuilder.buildExpectArray(); } diff --git a/test/org/rascalmpl/test/parser/Ambiguous9.java b/test/org/rascalmpl/test/parser/Ambiguous9.java index 25e8bd9aa91..569bc2e045b 100644 --- a/test/org/rascalmpl/test/parser/Ambiguous9.java +++ b/test/org/rascalmpl/test/parser/Ambiguous9.java @@ -20,6 +20,7 @@ import org.rascalmpl.parser.gtd.stack.AbstractStackNode; import org.rascalmpl.parser.gtd.stack.LiteralStackNode; import org.rascalmpl.parser.gtd.stack.NonTerminalStackNode; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; import org.rascalmpl.parser.gtd.util.IntegerMap; import org.rascalmpl.parser.uptr.UPTRNodeFactory; import io.usethesource.vallang.IConstructor; @@ -66,14 +67,14 @@ public class Ambiguous9 extends SGTDBF imp private final static AbstractStackNode[] S_EXPECTS; static{ - ExpectBuilder sExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder sExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); sExpectBuilder.addAlternative(PROD_S_E, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_E0}); S_EXPECTS = sExpectBuilder.buildExpectArray(); } private final static AbstractStackNode[] E_EXPECTS; static{ - ExpectBuilder eExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder eExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); eExpectBuilder.addAlternative(PROD_E_EplusE, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_E1, LITERAL_4, NONTERMINAL_E2}); eExpectBuilder.addAlternative(PROD_E_EstarE, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_E1, LITERAL_5, NONTERMINAL_E3}); eExpectBuilder.addAlternative(PROD_E_1, (AbstractStackNode[]) new AbstractStackNode[]{LITERAL_6}); diff --git a/test/org/rascalmpl/test/parser/AmbiguousRecursivePrefixShared.java b/test/org/rascalmpl/test/parser/AmbiguousRecursivePrefixShared.java index f1c2e727acd..a1a956f3fe8 100644 --- a/test/org/rascalmpl/test/parser/AmbiguousRecursivePrefixShared.java +++ b/test/org/rascalmpl/test/parser/AmbiguousRecursivePrefixShared.java @@ -9,6 +9,7 @@ import org.rascalmpl.parser.gtd.stack.AbstractStackNode; import org.rascalmpl.parser.gtd.stack.LiteralStackNode; import org.rascalmpl.parser.gtd.stack.NonTerminalStackNode; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; import org.rascalmpl.parser.gtd.util.IntegerMap; import org.rascalmpl.parser.uptr.UPTRNodeFactory; import io.usethesource.vallang.IConstructor; @@ -50,7 +51,7 @@ public class AmbiguousRecursivePrefixShared extends SGTDBF[] S_EXPECTS; static{ - ExpectBuilder sExpectBuilder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder sExpectBuilder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); sExpectBuilder.addAlternative(PROD_S_SSS, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_S0, NONTERMINAL_S1, NONTERMINAL_S2}); sExpectBuilder.addAlternative(PROD_S_SS, (AbstractStackNode[]) new AbstractStackNode[]{NONTERMINAL_S0, NONTERMINAL_S1}); sExpectBuilder.addAlternative(PROD_S_a, (AbstractStackNode[]) new AbstractStackNode[]{LITERAL_a5}); diff --git a/test/org/rascalmpl/test/parser/DoubleLeftNullable.java b/test/org/rascalmpl/test/parser/DoubleLeftNullable.java index b1d40f1a572..72ca6885bc1 100644 --- a/test/org/rascalmpl/test/parser/DoubleLeftNullable.java +++ b/test/org/rascalmpl/test/parser/DoubleLeftNullable.java @@ -12,6 +12,7 @@ import org.rascalmpl.parser.gtd.stack.ListStackNode; import org.rascalmpl.parser.gtd.stack.LiteralStackNode; import org.rascalmpl.parser.gtd.stack.NonTerminalStackNode; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; import org.rascalmpl.parser.gtd.util.IntegerMap; import org.rascalmpl.parser.uptr.UPTRNodeFactory; import org.rascalmpl.values.RascalValueFactory; @@ -86,7 +87,7 @@ protected static IValue _read(java.lang.String s, io.usethesource.vallang.type.T protected static class layouts_$default$ { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder builder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -107,7 +108,7 @@ public static void init(ExpectBuilder builder){ protected static class start__Stmt { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder builder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -130,7 +131,7 @@ public static void init(ExpectBuilder builder){ protected static class Expr { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder builder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -149,7 +150,7 @@ public static void init(ExpectBuilder builder){ protected static class Stmt { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder builder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); init(builder); EXPECTS = builder.buildExpectArray(); } @@ -211,7 +212,7 @@ public static void init(ExpectBuilder builder){ protected static class layouts_WS { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(new IntegerMap()); + ExpectBuilder builder = new ExpectBuilder(new IntegerKeyedHashMap<>(), new IntegerMap()); init(builder); EXPECTS = builder.buildExpectArray(); } diff --git a/test/org/rascalmpl/test/parser/DoubleRightNullableWithPrefixSharing.java b/test/org/rascalmpl/test/parser/DoubleRightNullableWithPrefixSharing.java index 376d50d1f37..0a0e1cb8fbb 100644 --- a/test/org/rascalmpl/test/parser/DoubleRightNullableWithPrefixSharing.java +++ b/test/org/rascalmpl/test/parser/DoubleRightNullableWithPrefixSharing.java @@ -9,6 +9,8 @@ import org.rascalmpl.parser.gtd.stack.EmptyStackNode; import org.rascalmpl.parser.gtd.stack.LiteralStackNode; import org.rascalmpl.parser.gtd.stack.NonTerminalStackNode; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; +import org.rascalmpl.parser.gtd.util.IntegerList; import org.rascalmpl.parser.gtd.util.IntegerMap; import org.rascalmpl.parser.uptr.UPTRNodeFactory; import org.rascalmpl.values.RascalValueFactory; @@ -40,6 +42,7 @@ protected static IValue _read(java.lang.String s, io.usethesource.vallang.type.T protected static final TypeFactory _tf = TypeFactory.getInstance(); + private static final IntegerKeyedHashMap _dontNest = new IntegerKeyedHashMap(); private static final IntegerMap _resultStoreIdMappings = new IntegerMap(); // Production declarations @@ -58,7 +61,7 @@ protected static IValue _read(java.lang.String s, io.usethesource.vallang.type.T protected static class Stmt { public final static AbstractStackNode[] EXPECTS; static{ - ExpectBuilder builder = new ExpectBuilder(_resultStoreIdMappings); + ExpectBuilder builder = new ExpectBuilder(_dontNest, _resultStoreIdMappings); init(builder); EXPECTS = builder.buildExpectArray(); } diff --git a/test/org/rascalmpl/test/parser/ParserTest.java b/test/org/rascalmpl/test/parser/ParserTest.java index 460d8f002d0..c647ec6ee67 100644 --- a/test/org/rascalmpl/test/parser/ParserTest.java +++ b/test/org/rascalmpl/test/parser/ParserTest.java @@ -152,9 +152,13 @@ public void testListSharing(){ public void testDoubleLeftNullable() { executeParser(new DoubleLeftNullable()); - } + } + + public void testDoubleRightNullable() { + executeParser(new DoubleRightNullableWithPrefixSharing()); + } - public void testDoubleRightNullable() { - executeParser(new DoubleRightNullableWithPrefixSharing()); - } + public void testPrefixSharedExcept() { + executeParser(new PrefixSharedExcept()); + } } diff --git a/test/org/rascalmpl/test/parser/PrefixSharedExcept.java b/test/org/rascalmpl/test/parser/PrefixSharedExcept.java new file mode 100644 index 00000000000..353460bd909 --- /dev/null +++ b/test/org/rascalmpl/test/parser/PrefixSharedExcept.java @@ -0,0 +1,172 @@ +/******************************************************************************* + * Copyright (c) 2009-2011 CWI + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + + * * Jurgen J. Vinju - Jurgen.Vinju@cwi.nl - CWI + * * Arnold Lankamp - Arnold.Lankamp@cwi.nl +*******************************************************************************/ +package org.rascalmpl.test.parser; + +import java.io.IOException; +import java.io.StringReader; + +import org.rascalmpl.parser.gtd.SGTDBF; +import org.rascalmpl.parser.gtd.preprocessing.ExpectBuilder; +import org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener; +import org.rascalmpl.parser.gtd.stack.AbstractStackNode; +import org.rascalmpl.parser.gtd.stack.LiteralStackNode; +import org.rascalmpl.parser.gtd.stack.NonTerminalStackNode; +import org.rascalmpl.parser.gtd.util.IntegerKeyedHashMap; +import org.rascalmpl.parser.gtd.util.IntegerList; +import org.rascalmpl.parser.gtd.util.IntegerMap; +import org.rascalmpl.parser.uptr.UPTRNodeFactory; +import io.usethesource.vallang.IConstructor; +import io.usethesource.vallang.ISourceLocation; +import io.usethesource.vallang.IValue; +import io.usethesource.vallang.io.StandardTextReader; + +import org.rascalmpl.values.RascalValueFactory; +import org.rascalmpl.values.ValueFactoryFactory; +import org.rascalmpl.values.parsetrees.ITree; + +/* +S ::= A!c | C +A ::= c: C | CB +B ::= b +C ::= c +*/ +@SuppressWarnings({"unchecked"}) +public class PrefixSharedExcept extends SGTDBF implements IParserTest{ + private final static IntegerKeyedHashMap dontNest = new IntegerKeyedHashMap(); + private final static IntegerMap resultStoreIdMappings = new IntegerMap(); + + private final static IConstructor SYMBOL_START_S = VF.constructor(RascalValueFactory.Symbol_Sort, VF.string("S")); + private final static IConstructor SYMBOL_A = VF.constructor(RascalValueFactory.Symbol_Sort, VF.string("A")); + private final static IConstructor SYMBOL_B = VF.constructor(RascalValueFactory.Symbol_Sort, VF.string("B")); + private final static IConstructor SYMBOL_C = VF.constructor(RascalValueFactory.Symbol_Sort, VF.string("C")); + private final static IConstructor SYMBOL_char_b = VF.constructor(RascalValueFactory.Symbol_CharClass, VF.list(VF.constructor(RascalValueFactory.CharRange_Single, VF.integer(98)))); + private final static IConstructor SYMBOL_char_c = VF.constructor(RascalValueFactory.Symbol_CharClass, VF.list(VF.constructor(RascalValueFactory.CharRange_Single, VF.integer(99)))); + + private final static IConstructor PROD_S_A = VF.constructor(RascalValueFactory.Production_Default, SYMBOL_START_S, VF.list(SYMBOL_A), VF.set()); + private final static IConstructor PROD_S_C = VF.constructor(RascalValueFactory.Production_Default, SYMBOL_START_S, VF.list(SYMBOL_C), VF.set()); + private final static IConstructor PROD_A_CB = VF.constructor(RascalValueFactory.Production_Default, SYMBOL_A, VF.list(SYMBOL_C, SYMBOL_B), VF.set()); + private final static IConstructor PROD_A_C = VF.constructor(RascalValueFactory.Production_Default, SYMBOL_C, VF.list(SYMBOL_C), VF.set()); + private final static IConstructor PROD_B_b = VF.constructor(RascalValueFactory.Production_Default, SYMBOL_B, VF.list(SYMBOL_char_b), VF.set()); + private final static IConstructor PROD_C_c = VF.constructor(RascalValueFactory.Production_Default, SYMBOL_C, VF.list(SYMBOL_char_c), VF.set()); + + private final static AbstractStackNode NONTERMINAL_START_S = new NonTerminalStackNode(AbstractStackNode.START_SYMBOL_ID, 0, "S"); + private final static AbstractStackNode NONTERMINAL_A0 = new NonTerminalStackNode(0, 0, "A"); + private final static AbstractStackNode NONTERMINAL_C1 = new NonTerminalStackNode(1, 0, "C"); + private final static AbstractStackNode NONTERMINAL_C2 = new NonTerminalStackNode(2, 0, "C"); + private final static AbstractStackNode NONTERMINAL_C3 = new NonTerminalStackNode(3, 0, "C"); + private final static AbstractStackNode NONTERMINAL_B4 = new NonTerminalStackNode(4, 1, "B"); + + private final static AbstractStackNode LITERAL_b = new LiteralStackNode(5, 0, PROD_B_b, new int[]{'b'}); + private final static AbstractStackNode LITERAL_c = new LiteralStackNode(6, 0, PROD_C_c, new int[]{'c'}); + + static { + IntegerList parents = new IntegerList(); + parents.add(NONTERMINAL_A0.getId()); + dontNest.put(NONTERMINAL_C2.getId(), parents); + + resultStoreIdMappings.put(NONTERMINAL_A0.getId(), 0); + } + + private final static AbstractStackNode[] S_EXPECT_1 = (AbstractStackNode[]) new AbstractStackNode[1]; + static{ + S_EXPECT_1[0] = NONTERMINAL_A0; + S_EXPECT_1[0].setProduction(S_EXPECT_1); + S_EXPECT_1[0].setAlternativeProduction(PROD_S_A); + } + + private final static AbstractStackNode[] S_EXPECT_2 = (AbstractStackNode[]) new AbstractStackNode[1]; + static{ + S_EXPECT_2[0] = NONTERMINAL_C1; + S_EXPECT_2[0].setProduction(S_EXPECT_2); + S_EXPECT_2[0].setAlternativeProduction(PROD_S_C); + } + + private final static AbstractStackNode[] A_EXPECTS; + static{ + ExpectBuilder builder = new ExpectBuilder(dontNest, resultStoreIdMappings); + + AbstractStackNode[] A_EXPECT_1 = (AbstractStackNode[]) new AbstractStackNode[1]; + A_EXPECT_1[0] = NONTERMINAL_C2; + builder.addAlternative(PROD_A_C, A_EXPECT_1); + + AbstractStackNode[] A_EXPECT_2 = (AbstractStackNode[]) new AbstractStackNode[2]; + A_EXPECT_2[0] = NONTERMINAL_C3; + A_EXPECT_2[1] = NONTERMINAL_B4; + builder.addAlternative(PROD_A_CB, A_EXPECT_2); + + A_EXPECTS = builder.buildExpectArray(); + } + + private final static AbstractStackNode[] B_EXPECT_1 = (AbstractStackNode[]) new AbstractStackNode[1]; + static{ + B_EXPECT_1[0] = LITERAL_b; + B_EXPECT_1[0].setProduction(B_EXPECT_1); + B_EXPECT_1[0].setAlternativeProduction(PROD_B_b); + } + + private final static AbstractStackNode[] C_EXPECT_1 = (AbstractStackNode[]) new AbstractStackNode[1]; + static{ + C_EXPECT_1[0] = LITERAL_c; + C_EXPECT_1[0].setProduction(C_EXPECT_1); + C_EXPECT_1[0].setAlternativeProduction(PROD_C_c); + } + + public PrefixSharedExcept(){ + super(); + } + + protected int getResultStoreId(int parentId) { + return resultStoreIdMappings.get(parentId); + } + + protected boolean hasNestingRestrictions(String name){ + return true; + } + + protected IntegerList getFilteredParents(int childId) { + return dontNest.get(childId); + } + + public AbstractStackNode[] S(){ + return (AbstractStackNode[]) new AbstractStackNode[]{S_EXPECT_1[0], S_EXPECT_2[0]}; + } + + public AbstractStackNode[] A(){ + return A_EXPECTS; + } + + public AbstractStackNode[] B(){ + return (AbstractStackNode[]) new AbstractStackNode[]{B_EXPECT_1[0]}; + } + + public AbstractStackNode[] C(){ + return (AbstractStackNode[]) new AbstractStackNode[]{C_EXPECT_1[0]}; + } + + public ITree executeParser(){ + return parse(NONTERMINAL_START_S, null, "c".toCharArray(), new DefaultNodeFlattener(), new UPTRNodeFactory(true)); + } + + public IValue getExpectedResult() throws IOException{ + String expectedInput = "appl(prod(sort(\"S\"),[sort(\"C\")],{}),[appl(prod(sort(\"C\"),[\\char-class([single(99)])],{}),[appl(prod(sort(\"C\"),[\\char-class([single(99)])],{}),[char(99)])])])"; + return new StandardTextReader().read(ValueFactoryFactory.getValueFactory(), RascalValueFactory.uptr, RascalValueFactory.Tree, new StringReader(expectedInput)); + } + + public static void main(String[] args){ + PrefixSharedExcept pse = new PrefixSharedExcept(); + IConstructor result = pse.executeParser(); + System.out.println(result); + + System.out.println("appl(prod(sort(\"S\"),[sort(\"C\")],{}),[appl(prod(sort(\"C\"),[\\char-class([single(99)])],{}),[appl(prod(sort(\"C\"),[\\char-class([single(99)])],{}),[char(99)])])]) <- good"); + } +}