mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 01:38:03 +00:00
Renamed method name
This commit is contained in:
parent
f40318f905
commit
1b8ed72dff
@ -11,7 +11,7 @@ public class TypedExpressionUtil {
|
||||
|
||||
public static TypedExpression getKindOfExpression(Map<String, Type> localVar, TypedClass clas, Expression expression) {
|
||||
if (expression instanceof BoolLiteral boolLiteral) {
|
||||
return new TypedBoolLiteral(boolLiteral.value());
|
||||
return new TypedBoolLiteral(localVar, clas, boolLiteral);
|
||||
}
|
||||
else if (expression instanceof CharLiteral charLiteral) {
|
||||
return new TypedCharLiteral(localVar, clas, charLiteral);
|
||||
|
@ -22,14 +22,14 @@ public class TypedBlock implements TypedNode {
|
||||
|
||||
|
||||
public TypedBlock(Map<String, Type> localVar, TypedClass clas, Block unTypedBlock) {
|
||||
blockToTypedBlock(localVar, clas, unTypedBlock);
|
||||
convertToTypedBlock(localVar, clas, unTypedBlock);
|
||||
}
|
||||
public TypedBlock(List<TypedLocalVariable> vars, List<TypedStatement> stmts) {
|
||||
this.vars = vars;
|
||||
this.stmts = stmts;
|
||||
}
|
||||
|
||||
public void blockToTypedBlock(Map<String, Type> localVar, TypedClass clas, Block unTypedBlock) {
|
||||
public void convertToTypedBlock(Map<String, Type> localVar, TypedClass clas, Block unTypedBlock) {
|
||||
|
||||
if(unTypedBlock == null) {
|
||||
return;
|
||||
|
@ -1,7 +1,6 @@
|
||||
package de.maishai.typedast.typedclass;
|
||||
|
||||
import de.maishai.ast.records.Constructor;
|
||||
import de.maishai.ast.records.Node;
|
||||
import de.maishai.ast.records.Parameter;
|
||||
import de.maishai.typedast.CodeGenUtils;
|
||||
import de.maishai.typedast.MethodContext;
|
||||
@ -28,14 +27,14 @@ public class TypedConstructor implements TypedNode {
|
||||
private TypedBlock typedBlock;
|
||||
|
||||
public TypedConstructor(Map<String, Type> localVar, TypedClass clas, Constructor unTypedConstructor) {
|
||||
constructorToTypedConstructor(localVar, clas, unTypedConstructor);
|
||||
convertToTypedConstructor(localVar, clas, unTypedConstructor);
|
||||
}
|
||||
|
||||
public void constructorToTypedConstructor(Map<String, Type> localVar, TypedClass clas, Constructor unTypedConstructor) {
|
||||
public void convertToTypedConstructor(Map<String, Type> localVar, TypedClass clas, Constructor unTypedConstructor) {
|
||||
name = unTypedConstructor.className();
|
||||
|
||||
for (Parameter param : unTypedConstructor.params()) {
|
||||
typedParameters.add(new TypedParameter(param.name(), param.type()));
|
||||
typedParameters.add(new TypedParameter(localVar, clas, param));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user