Rename files for macos and windows

This commit is contained in:
Daniel Holle 2023-08-15 17:17:03 +02:00
parent 7193f5a646
commit be5591f7dc
3 changed files with 16 additions and 16 deletions

View File

@ -165,7 +165,7 @@ methodBody
; ;
refType refType
: typeType # reftype : typeType # refType2
| VOID # refvoid | VOID # refvoid
; ;
@ -603,7 +603,7 @@ methodCall
; ;
expression expression
: primary #primaryexpression : primary #primaryExpression2
| expression bop='.' | expression bop='.'
( (
identifier identifier
@ -634,8 +634,8 @@ expression
| <assoc=right> expression | <assoc=right> expression
bop=('=' | '+=' | '-=' | '*=' | '/=' | '&=' | '|=' | '^=' | '>>=' | '>>>=' | '<<=' | '%=') bop=('=' | '+=' | '-=' | '*=' | '/=' | '&=' | '|=' | '^=' | '>>=' | '>>>=' | '<<=' | '%=')
expression #assignexpression expression #assignexpression
| lambdaExpression #lambdaexpression // Java8 | lambdaExpression #lambdaExpression2 // Java8
| switchExpression #switchexpression // Java17 | switchExpression #switchExpression2 // Java17
// Java 8 methodReference // Java 8 methodReference
| expression '::' typeArguments? identifier #methodreferenceexpression | expression '::' typeArguments? identifier #methodreferenceexpression

View File

@ -44,7 +44,7 @@ import de.dhbwstuttgart.parser.antlr.Java17Parser.LabeledRuleExprListContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.LabeledRulePatternContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.LabeledRulePatternContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.LabeledstmtContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.LabeledstmtContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.LambdaLVTIParameterContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.LambdaLVTIParameterContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.LambdaexpressionContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.LambdaExpression2Context;
import de.dhbwstuttgart.parser.antlr.Java17Parser.MathaddsubexpressionContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.MathaddsubexpressionContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.MathmuldivmodexpressionContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.MathmuldivmodexpressionContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.MethodCallContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.MethodCallContext;
@ -63,7 +63,7 @@ import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryLiteralContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryPatternContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryPatternContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimarySuperContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimarySuperContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryThisContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryThisContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryexpressionContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.PrimaryExpression2Context;
import de.dhbwstuttgart.parser.antlr.Java17Parser.RPatternContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.RPatternContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.RecordPatternContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.RecordPatternContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.RelationalexpressionContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.RelationalexpressionContext;
@ -79,7 +79,7 @@ import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchLabelDefaultContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchLabelPatternContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchLabelPatternContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchLabeledRuleContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchLabeledRuleContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchRuleOutcomeContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchRuleOutcomeContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchexpressionContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchExpression2Context;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchstmtContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SwitchstmtContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SynchronizedstmtContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SynchronizedstmtContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.TPatternContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.TPatternContext;
@ -272,7 +272,7 @@ public class StatementGenerator {
ret = convert(prefix); ret = convert(prefix);
ret.setStatement(); ret.setStatement();
return ret; return ret;
case SwitchexpressionContext switchexpr: case SwitchExpression2Context switchexpr:
ret = convert(switchexpr); ret = convert(switchexpr);
ret.setStatement(); ret.setStatement();
return ret; return ret;
@ -359,7 +359,7 @@ public class StatementGenerator {
} }
// Um switchExpressions als Statement zu behandeln // Um switchExpressions als Statement zu behandeln
private Statement convert(Java17Parser.SwitchexpressionContext switchexpression) { private Statement convert(Java17Parser.SwitchExpression2Context switchexpression) {
Expression switchExpr = convert(switchexpression.switchExpression()); Expression switchExpr = convert(switchexpression.switchExpression());
if (switchExpr instanceof Switch s) { if (switchExpr instanceof Switch s) {
s.setStatement(); s.setStatement();
@ -624,7 +624,7 @@ public class StatementGenerator {
private Expression convert(Java17Parser.ExpressionContext expression) { private Expression convert(Java17Parser.ExpressionContext expression) {
switch (expression) { switch (expression) {
case PrimaryexpressionContext primary: case PrimaryExpression2Context primary:
return convert(primary.primary()); return convert(primary.primary());
case DottedexpressionContext dotted: case DottedexpressionContext dotted:
return convert(dotted, expression.getStart()); return convert(dotted, expression.getStart());
@ -646,13 +646,13 @@ public class StatementGenerator {
return convert(comparison); return convert(comparison);
case InstanceofexpressionContext instanceOf: case InstanceofexpressionContext instanceOf:
return convert(instanceOf); return convert(instanceOf);
case SwitchexpressionContext switchexpression: case SwitchExpression2Context switchexpression:
return convert(switchexpression.switchExpression()); return convert(switchexpression.switchExpression());
case EqualityexpressionContext equal: case EqualityexpressionContext equal:
return convert(equal); return convert(equal);
case AssignexpressionContext assignment: case AssignexpressionContext assignment:
return convert(assignment); return convert(assignment);
case LambdaexpressionContext lambdaexpr: case LambdaExpression2Context lambdaexpr:
return convert(lambdaexpr.lambdaExpression()); return convert(lambdaexpr.lambdaExpression());
case ArrayaccessexpressionContext arrayaccess: case ArrayaccessexpressionContext arrayaccess:
return convert(arrayaccess); return convert(arrayaccess);
@ -725,7 +725,7 @@ public class StatementGenerator {
public Receiver getReceiver(ExpressionContext expr) { public Receiver getReceiver(ExpressionContext expr) {
Expression expression = convert(expr); Expression expression = convert(expr);
/* /*
* if (expr instanceof PrimaryexpressionContext pc) { expression = convert(pc.primary()); } else { expression = generateLocalOrFieldVarOrClassName(expr.getText(), expr.getStart()); } * if (expr instanceof PrimaryExpression2Context pc) { expression = convert(pc.primary()); } else { expression = generateLocalOrFieldVarOrClassName(expr.getText(), expr.getStart()); }
*/ */
return getReceiver(expression); return getReceiver(expression);
} }

View File

@ -54,7 +54,7 @@ import de.dhbwstuttgart.parser.antlr.Java17Parser.ModifierContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.NoclassorinterfaceContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.NoclassorinterfaceContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.RecordComponentContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.RecordComponentContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.RecordDeclarationContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.RecordDeclarationContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.ReftypeContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.RefType2Context;
import de.dhbwstuttgart.parser.antlr.Java17Parser.SrcfileContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.SrcfileContext;
import de.dhbwstuttgart.parser.antlr.Java17Parser.TypeArgumentsContext; import de.dhbwstuttgart.parser.antlr.Java17Parser.TypeArgumentsContext;
import de.dhbwstuttgart.parser.scope.GatherNames; import de.dhbwstuttgart.parser.scope.GatherNames;
@ -419,7 +419,7 @@ public class SyntaxTreeGenerator {
if (Objects.isNull(bodydeclaration.refType())) { if (Objects.isNull(bodydeclaration.refType())) {
retType = TypePlaceholder.fresh(bodydeclaration.getStart()); retType = TypePlaceholder.fresh(bodydeclaration.getStart());
} else { } else {
if (bodydeclaration.refType() instanceof ReftypeContext reftype) { if (bodydeclaration.refType() instanceof RefType2Context reftype) {
retType = TypeGenerator.convert(reftype.typeType(), reg, generics); retType = TypeGenerator.convert(reftype.typeType(), reg, generics);
} else { } else {
retType = new Void(bodydeclaration.refType().getStart()); retType = new Void(bodydeclaration.refType().getStart());
@ -512,7 +512,7 @@ public class SyntaxTreeGenerator {
if (Objects.isNull(header.refType())) { if (Objects.isNull(header.refType())) {
retType = TypePlaceholder.fresh(header.getStart()); retType = TypePlaceholder.fresh(header.getStart());
} else { } else {
if (header.refType() instanceof ReftypeContext reftype) { if (header.refType() instanceof RefType2Context reftype) {
retType = TypeGenerator.convert(reftype.typeType(), reg, generics); retType = TypeGenerator.convert(reftype.typeType(), reg, generics);
} else { } else {
retType = new Void(header.refType().getStart()); retType = new Void(header.refType().getStart());