Fehler in Parser behoben
This commit is contained in:
parent
2d8adb5c69
commit
985f3e984c
@ -1455,7 +1455,7 @@ case 98:
|
|||||||
case 99:
|
case 99:
|
||||||
// line 912 "./../src/de/dhbwstuttgart/parser/JavaParser.jay"
|
// line 912 "./../src/de/dhbwstuttgart/parser/JavaParser.jay"
|
||||||
{
|
{
|
||||||
Constructor CON = new Constructor(null); /*TODO: Der Parser kann sowieso nicht zwischen einem Konstruktor und einer Methode unterscheiden. Das hier kann wegfallen...*/
|
Constructor CON = new Constructor(null,null); /*TODO: Der Parser kann sowieso nicht zwischen einem Konstruktor und einer Methode unterscheiden. Das hier kann wegfallen...*/
|
||||||
DeclId DIDCon = new DeclId();
|
DeclId DIDCon = new DeclId();
|
||||||
DIDCon.set_Name(((UsedId)yyVals[-2+yyTop]).get_Name_1Element());
|
DIDCon.set_Name(((UsedId)yyVals[-2+yyTop]).get_Name_1Element());
|
||||||
CON.set_DeclId(DIDCon);
|
CON.set_DeclId(DIDCon);
|
||||||
@ -1465,7 +1465,7 @@ case 99:
|
|||||||
case 100:
|
case 100:
|
||||||
// line 920 "./../src/de/dhbwstuttgart/parser/JavaParser.jay"
|
// line 920 "./../src/de/dhbwstuttgart/parser/JavaParser.jay"
|
||||||
{
|
{
|
||||||
Constructor CONpara = new Constructor(null);
|
Constructor CONpara = new Constructor(null,null);
|
||||||
DeclId DIconpara = new DeclId();
|
DeclId DIconpara = new DeclId();
|
||||||
DIconpara.set_Name(((UsedId)yyVals[-3+yyTop]).get_Name_1Element());
|
DIconpara.set_Name(((UsedId)yyVals[-3+yyTop]).get_Name_1Element());
|
||||||
CONpara.set_DeclId(DIconpara);
|
CONpara.set_DeclId(DIconpara);
|
||||||
|
@ -910,7 +910,7 @@ block : '{' '}'
|
|||||||
|
|
||||||
constructordeclarator : simplename '(' ')'
|
constructordeclarator : simplename '(' ')'
|
||||||
{
|
{
|
||||||
Constructor CON = new Constructor(null); //TODO: Der Parser kann sowieso nicht zwischen einem Konstruktor und einer Methode unterscheiden. Das hier kann wegfallen...
|
Constructor CON = new Constructor(null,null); //TODO: Der Parser kann sowieso nicht zwischen einem Konstruktor und einer Methode unterscheiden. Das hier kann wegfallen...
|
||||||
DeclId DIDCon = new DeclId();
|
DeclId DIDCon = new DeclId();
|
||||||
DIDCon.set_Name($1.get_Name_1Element());
|
DIDCon.set_Name($1.get_Name_1Element());
|
||||||
CON.set_DeclId(DIDCon);
|
CON.set_DeclId(DIDCon);
|
||||||
@ -918,7 +918,7 @@ constructordeclarator : simplename '(' ')'
|
|||||||
}
|
}
|
||||||
| simplename '('formalparameterlist')'
|
| simplename '('formalparameterlist')'
|
||||||
{
|
{
|
||||||
Constructor CONpara = new Constructor(null);
|
Constructor CONpara = new Constructor(null,null);
|
||||||
DeclId DIconpara = new DeclId();
|
DeclId DIconpara = new DeclId();
|
||||||
DIconpara.set_Name($1.get_Name_1Element());
|
DIconpara.set_Name($1.get_Name_1Element());
|
||||||
CONpara.set_DeclId(DIconpara);
|
CONpara.set_DeclId(DIconpara);
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
class Assign{
|
class Assign{
|
||||||
|
|
||||||
void method() {a; a = 20;b; b=59;}
|
void method() {
|
||||||
|
a;
|
||||||
|
a = 20;
|
||||||
|
b;
|
||||||
|
b=59;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ public class Assign {
|
|||||||
|
|
||||||
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
|
public final static String rootDirectory = System.getProperty("user.dir")+"/test/bytecode/";
|
||||||
public final static String testFile = "Assign.jav";
|
public final static String testFile = "Assign.jav";
|
||||||
public final static String outputFile = "Assign.class";
|
public final static String outputFile = "AssignTest.class";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
|
@ -4,5 +4,7 @@
|
|||||||
class Test{
|
class Test{
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
new EmptyClass();
|
new EmptyClass();
|
||||||
|
new AssignTest();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user