Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRootTokenInStarLoop
- avg: 33.33333333333333
- name of old: testActionInStarLoop
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testActionInStarLoop
- avg: 33.33333333333333
- name of new: setChildIndex
- name of old: TestASTConstruction
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- }
- OldName: TestASTConstruction
- avg: 100.0
- name of old: testA
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testA
- avg: 50.0
- name of old: testNakeRulePlusInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
- String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("A").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakeRulePlusInLexer
- avg: 50.0
- name of old: testRulePlus
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRulePlus
- avg: 50.0
- name of old: testNakedRulePlus
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRulePlus
- avg: 50.0
- name of old: testRuleOptional
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleOptional
- avg: 50.0
- name of old: testNakedRuleOptional
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleOptional
- avg: 50.0
- name of old: testRuleStar
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleStar
- avg: 50.0
- name of old: testNakedRuleStar
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleStar
- avg: 50.0
- name of old: testCharStar
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStar
- avg: 50.0
- name of old: testCharStarInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStarInLexer
- avg: 50.0
- name of old: testStringStar
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStar
- avg: 50.0
- name of old: testStringStarInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStarInLexer
- avg: 50.0
- name of old: testCharPlus
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlus
- avg: 50.0
- name of old: testCharPlusInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlusInLexer
- avg: 50.0
- name of old: testCharOptional
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptional
- avg: 50.0
- name of old: testCharOptionalInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptionalInLexer
- avg: 50.0
- name of old: testCharRangePlus
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
- String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("ID").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharRangePlus
- avg: 50.0
- name of old: testLabel
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabel
- avg: 50.0
- name of old: testLabelOfOptional
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfOptional
- avg: 50.0
- name of old: testLabelOfClosure
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfClosure
- avg: 50.0
- name of old: testRuleLabel
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabel
- avg: 50.0
- name of old: testSetLabel
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testSetLabel
- avg: 50.0
- name of old: testNotSetLabel
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetLabel
- avg: 50.0
- name of old: testNotSetListLabel
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabel
- avg: 50.0
- name of old: testNotSetListLabelInLoop
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabelInLoop
- avg: 50.0
- name of old: testRuleLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabelOfPositiveClosure
- avg: 50.0
- name of old: testListLabelOfClosure
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure
- avg: 50.0
- name of old: testListLabelOfClosure2
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure2
- avg: 50.0
- name of old: testRuleListLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleListLabelOfPositiveClosure
- avg: 50.0
- name of old: testRootTokenInStarLoop
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRootTokenInStarLoop
- avg: 50.0
- name of old: testActionInStarLoop
- Outcome: false
- NewCode: {
- }
- NewName: setChildIndex
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testActionInStarLoop
- avg: 50.0
- name of new: getParent
- name of old: TestASTConstruction
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- }
- OldName: TestASTConstruction
- avg: 33.33333333333333
- name of old: testA
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testA
- avg: 33.33333333333333
- name of old: testNakeRulePlusInLexer
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
- String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("A").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakeRulePlusInLexer
- avg: 33.33333333333333
- name of old: testRulePlus
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRulePlus
- avg: 33.33333333333333
- name of old: testNakedRulePlus
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRulePlus
- avg: 33.33333333333333
- name of old: testRuleOptional
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleOptional
- avg: 33.33333333333333
- name of old: testNakedRuleOptional
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleOptional
- avg: 33.33333333333333
- name of old: testRuleStar
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleStar
- avg: 33.33333333333333
- name of old: testNakedRuleStar
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleStar
- avg: 33.33333333333333
- name of old: testCharStar
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStar
- avg: 33.33333333333333
- name of old: testCharStarInLexer
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStarInLexer
- avg: 33.33333333333333
- name of old: testStringStar
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStar
- avg: 33.33333333333333
- name of old: testStringStarInLexer
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStarInLexer
- avg: 33.33333333333333
- name of old: testCharPlus
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlus
- avg: 33.33333333333333
- name of old: testCharPlusInLexer
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlusInLexer
- avg: 33.33333333333333
- name of old: testCharOptional
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptional
- avg: 33.33333333333333
- name of old: testCharOptionalInLexer
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptionalInLexer
- avg: 33.33333333333333
- name of old: testCharRangePlus
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
- String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("ID").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharRangePlus
- avg: 33.33333333333333
- name of old: testLabel
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabel
- avg: 33.33333333333333
- name of old: testLabelOfOptional
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfOptional
- avg: 33.33333333333333
- name of old: testLabelOfClosure
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfClosure
- avg: 33.33333333333333
- name of old: testRuleLabel
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabel
- avg: 33.33333333333333
- name of old: testSetLabel
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testSetLabel
- avg: 33.33333333333333
- name of old: testNotSetLabel
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetLabel
- avg: 33.33333333333333
- name of old: testNotSetListLabel
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabel
- avg: 33.33333333333333
- name of old: testNotSetListLabelInLoop
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabelInLoop
- avg: 33.33333333333333
- name of old: testRuleLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabelOfPositiveClosure
- avg: 33.33333333333333
- name of old: testListLabelOfClosure
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure
- avg: 33.33333333333333
- name of old: testListLabelOfClosure2
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure2
- avg: 33.33333333333333
- name of old: testRuleListLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleListLabelOfPositiveClosure
- avg: 33.33333333333333
- name of old: testRootTokenInStarLoop
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRootTokenInStarLoop
- avg: 33.33333333333333
- name of old: testActionInStarLoop
- Outcome: false
- NewCode: {
- return null;
- }
- NewName: getParent
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testActionInStarLoop
- avg: 33.33333333333333
- name of new: setParent
- name of old: TestASTConstruction
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- }
- OldName: TestASTConstruction
- avg: 100.0
- name of old: testA
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testA
- avg: 50.0
- name of old: testNakeRulePlusInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
- String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("A").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakeRulePlusInLexer
- avg: 50.0
- name of old: testRulePlus
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRulePlus
- avg: 50.0
- name of old: testNakedRulePlus
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRulePlus
- avg: 50.0
- name of old: testRuleOptional
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleOptional
- avg: 50.0
- name of old: testNakedRuleOptional
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleOptional
- avg: 50.0
- name of old: testRuleStar
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleStar
- avg: 50.0
- name of old: testNakedRuleStar
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleStar
- avg: 50.0
- name of old: testCharStar
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStar
- avg: 50.0
- name of old: testCharStarInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStarInLexer
- avg: 50.0
- name of old: testStringStar
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStar
- avg: 50.0
- name of old: testStringStarInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStarInLexer
- avg: 50.0
- name of old: testCharPlus
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlus
- avg: 50.0
- name of old: testCharPlusInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlusInLexer
- avg: 50.0
- name of old: testCharOptional
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptional
- avg: 50.0
- name of old: testCharOptionalInLexer
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptionalInLexer
- avg: 50.0
- name of old: testCharRangePlus
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
- String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("ID").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharRangePlus
- avg: 50.0
- name of old: testLabel
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabel
- avg: 50.0
- name of old: testLabelOfOptional
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfOptional
- avg: 50.0
- name of old: testLabelOfClosure
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfClosure
- avg: 50.0
- name of old: testRuleLabel
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabel
- avg: 50.0
- name of old: testSetLabel
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testSetLabel
- avg: 50.0
- name of old: testNotSetLabel
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetLabel
- avg: 50.0
- name of old: testNotSetListLabel
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabel
- avg: 50.0
- name of old: testNotSetListLabelInLoop
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabelInLoop
- avg: 50.0
- name of old: testRuleLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabelOfPositiveClosure
- avg: 50.0
- name of old: testListLabelOfClosure
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure
- avg: 50.0
- name of old: testListLabelOfClosure2
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure2
- avg: 50.0
- name of old: testRuleListLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleListLabelOfPositiveClosure
- avg: 50.0
- name of old: testRootTokenInStarLoop
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRootTokenInStarLoop
- avg: 50.0
- name of old: testActionInStarLoop
- Outcome: false
- NewCode: {
- }
- NewName: setParent
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testActionInStarLoop
- avg: 50.0
- name of new: toStringTree
- name of old: TestASTConstruction
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- }
- OldName: TestASTConstruction
- avg: 4.545454545454546
- name of old: testA
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testA
- avg: 4.545454545454546
- name of old: testNakeRulePlusInLexer
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
- String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("A").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakeRulePlusInLexer
- avg: 4.545454545454546
- name of old: testRulePlus
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRulePlus
- avg: 4.545454545454546
- name of old: testNakedRulePlus
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRulePlus
- avg: 4.545454545454546
- name of old: testRuleOptional
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleOptional
- avg: 4.545454545454546
- name of old: testNakedRuleOptional
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleOptional
- avg: 4.545454545454546
- name of old: testRuleStar
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleStar
- avg: 4.545454545454546
- name of old: testNakedRuleStar
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleStar
- avg: 4.545454545454546
- name of old: testCharStar
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStar
- avg: 4.545454545454546
- name of old: testCharStarInLexer
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStarInLexer
- avg: 4.545454545454546
- name of old: testStringStar
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStar
- avg: 4.545454545454546
- name of old: testStringStarInLexer
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStarInLexer
- avg: 4.545454545454546
- name of old: testCharPlus
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'+;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlus
- avg: 4.545454545454546
- name of old: testCharPlusInLexer
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'+;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharPlusInLexer
- avg: 4.545454545454546
- name of old: testCharOptional
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptional
- avg: 4.545454545454546
- name of old: testCharOptionalInLexer
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'?;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharOptionalInLexer
- avg: 4.545454545454546
- name of old: testCharRangePlus
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "ID : 'a'..'z'+;");
- String expecting=" ( rule ID ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( .. 'a' 'z' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("ID").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharRangePlus
- avg: 4.545454545454546
- name of old: testLabel
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabel
- avg: 4.545454545454546
- name of old: testLabelOfOptional
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID?;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfOptional
- avg: 4.545454545454546
- name of old: testLabelOfClosure
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( = x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testLabelOfClosure
- avg: 4.545454545454546
- name of old: testRuleLabel
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabel
- avg: 4.545454545454546
- name of old: testSetLabel
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testSetLabel
- avg: 4.545454545454546
- name of old: testNotSetLabel
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( = x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetLabel
- avg: 4.545454545454546
- name of old: testNotSetListLabel
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B);\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabel
- avg: 4.545454545454546
- name of old: testNotSetListLabelInLoop
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=~(A|B)+;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x ( ~ ( BLOCK ( ALT A <end-of-alt> ) ( ALT B <end-of-alt> ) <end-of-block> ) ) ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNotSetListLabelInLoop
- avg: 4.545454545454546
- name of old: testRuleLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x=b+;\n" + "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( = x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleLabelOfPositiveClosure
- avg: 4.545454545454546
- name of old: testListLabelOfClosure
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+=ID*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x ID ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure
- avg: 4.545454545454546
- name of old: testListLabelOfClosure2
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : x+='int'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT ( += x 'int' ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testListLabelOfClosure2
- avg: 4.545454545454546
- name of old: testRuleListLabelOfPositiveClosure
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "options {output=AST;}\n" + "a : x+=b+;\n"+ "b : ID;\n");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT ( += x b ) <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleListLabelOfPositiveClosure
- avg: 4.545454545454546
- name of old: testRootTokenInStarLoop
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ('*'^)* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT '*' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRootTokenInStarLoop
- avg: 4.545454545454546
- name of old: testActionInStarLoop
- Outcome: false
- NewCode: {
- if (children == null || children.size() == 0) {
- return this.toString();
- }
- StringBuffer buf=new StringBuffer();
- if (!isNil()) {
- buf.append("(");
- buf.append(this.toString());
- buf.append(' ');
- }
- for (int i=0; children != null && i < children.size(); i++) {
- BaseTree t=(BaseTree)children.get(i);
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(t.toStringTree());
- }
- if (!isNil()) {
- buf.append(")");
- }
- return buf.toString();
- }
- NewName: toStringTree
- OldCode: {
- Grammar g=new Grammar("grammar Expr;\n" + "options { backtrack=true; }\n" + "a : ({blort} 'x')* ;\n");
- String expecting=" ( rule synpred1_Expr ARG RET scope ( BLOCK ( ALT blort 'x' <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("synpred1_Expr").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testActionInStarLoop
- avg: 4.545454545454546
- name of new: getLine
- name of old: TestASTConstruction
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- }
- OldName: TestASTConstruction
- avg: 33.33333333333333
- name of old: testA
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : A;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT A <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testA
- avg: 33.33333333333333
- name of old: testNakeRulePlusInLexer
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "A : B+;\n" + "B : 'a';");
- String expecting=" ( rule A ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT B <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("A").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakeRulePlusInLexer
- avg: 33.33333333333333
- name of old: testRulePlus
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRulePlus
- avg: 33.33333333333333
- name of old: testNakedRulePlus
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b+;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( + ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRulePlus
- avg: 33.33333333333333
- name of old: testRuleOptional
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleOptional
- avg: 33.33333333333333
- name of old: testNakedRuleOptional
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b?;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( ? ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleOptional
- avg: 33.33333333333333
- name of old: testRuleStar
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : (b)*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testRuleStar
- avg: 33.33333333333333
- name of old: testNakedRuleStar
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("parser grammar P;\n" + "a : b*;\n" + "b : B;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT b <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testNakedRuleStar
- avg: 33.33333333333333
- name of old: testCharStar
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'a'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'a' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStar
- avg: 33.33333333333333
- name of old: testCharStarInLexer
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'b'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'b' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testCharStarInLexer
- avg: 33.33333333333333
- name of old: testStringStar
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("grammar P;\n" + "a : 'while'*;");
- String expecting=" ( rule a ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("a").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStar
- avg: 33.33333333333333
- name of old: testStringStarInLexer
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
- OldCode: {
- Grammar g=new Grammar("lexer grammar P;\n" + "B : 'while'*;");
- String expecting=" ( rule B ARG RET scope ( BLOCK ( ALT ( * ( BLOCK ( ALT 'while' <end-of-alt> ) <end-of-block> ) ) <end-of-alt> ) <end-of-block> ) <end-of-rule> )";
- String found=g.getRule("B").tree.toStringTree();
- assertEquals(expecting,found);
- }
- OldName: testStringStarInLexer
- avg: 33.33333333333333
- name of old: testCharPlus
- Outcome: false
- NewCode: {
- return 0;
- }
- NewName: getLine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement