Package de.monticore.types.check
Class DeriveSymTypeOfBSCommonExpressions
- java.lang.Object
-
- de.monticore.types.check.AbstractDeriveFromExpression
-
- de.monticore.types.check.DeriveSymTypeOfBSCommonExpressions
-
- All Implemented Interfaces:
CommonExpressionsHandler,CommonExpressionsVisitor2,de.monticore.visitor.IHandler,de.monticore.visitor.IVisitor
- Direct Known Subclasses:
DeriveSymTypeOfCommonExpressions
@Deprecated public class DeriveSymTypeOfBSCommonExpressions extends AbstractDeriveFromExpression implements CommonExpressionsVisitor2, CommonExpressionsHandler
Deprecated.part of typecheck1, useTypeCheck3instead.This Visitor can calculate a SymTypeExpression (type) for the expressions in CommonExpressions The BS stands for BasicSymbols. Therefore, the class should not be used in an OO-context as it does not know OO concepts such as the modifiers static, public or private. For an OO language, useDeriveSymTypeOfCommonExpressionsinstead, which extends the functionality of this class so that it may be used in an OO-context as well. It can be combined with other expressions in your language by creating a DelegatorVisitor
-
-
Field Summary
Fields Modifier and Type Field Description protected DefiningSymbolSetterdefiningSymbolSetterDeprecated.protected SubExprNameExtractorsubExprNameExtractorDeprecated.protected CommonExpressionsTraversertraverserDeprecated.-
Fields inherited from class de.monticore.types.check.AbstractDeriveFromExpression
ERROR_MSG, typeCheckResult
-
-
Constructor Summary
Constructors Constructor Description DeriveSymTypeOfBSCommonExpressions()Deprecated.DeriveSymTypeOfBSCommonExpressions(SubExprNameExtractor subExprNameExtractor, DefiningSymbolSetter definingSymbolSetter)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected SymTypeExpressionbooleanNot(SymTypeExpression inner, de.se_rwth.commons.SourcePosition pos)Deprecated.protected java.util.List<SymTypeExpression>calculateArguments(ASTCallExpression expr)Deprecated.protected voidcalculateArithmeticCallExpression(ASTCallExpression expr, java.lang.String methodName, java.util.List<ExprToOptNamePair> methodCallParts, java.util.List<SymTypeExpression> argTypes)Deprecated.Calculates the type result of the expression, given that it is not a simple, or qualified method access.protected SymTypeExpressioncalculateArithmeticExpression(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculateArithmeticFieldAccessExpression(ASTFieldAccessExpression expr)Deprecated.Calculate the type result of FieldAccessExpressions that do not represent qualified names.protected SymTypeExpressioncalculateArrayExpression(ASTArrayAccessExpression node, SymTypeExpression arrayTypeResult, SymTypeExpression indexResult)Deprecated.protected SymTypeExpressioncalculateBooleanAndOpExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressioncalculateBooleanOrOpExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressioncalculateConditionalExpressionType(ASTConditionalExpression expr, SymTypeExpression conditionResult, SymTypeExpression trueResult, SymTypeExpression falseResult)Deprecated.protected SymTypeExpressioncalculateDivideExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculatedQualifiedEntity(java.util.List<ExprToNamePair> nameParts)Deprecated.Tries to resolve the given name parts to a variable, type variable, or type and if a symbol is found, then it(s type) is set as the current type check result.protected SymTypeExpressioncalculateEqualsExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculateFieldAccess(ASTFieldAccessExpression expr, boolean quiet)Deprecated.Calculates the type result of the field access expression, given that the type result of the accessed entity's owner has already been computed (and is accessible via getTypeCheckResult()).protected voidcalculateFunctionReturnTypeBasedOnSignature(java.util.List<SymTypeOfFunction> candidates, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes)Deprecated.protected voidcalculateFunctionReturnTypeBasedOnSignature(java.util.List<SymTypeOfFunction> candidates, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes, java.util.Map<SymTypeOfFunction,FunctionSymbol> definingSymbols)Deprecated.Checks whether any of thecandidatesfunctions that thecallExprmay represent match the givenargTypessignature.protected SymTypeExpressioncalculateGreaterThanExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressioncalculateLogicalOrOpAndOp(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculateMethodReturnTypeBasedOnSignature(java.util.List<FunctionSymbol> candidates, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes)Deprecated.Checks whether any of thecandidatesmethods that thecallExprmay represent match the givenargTypessignature.protected SymTypeExpressioncalculateMinusExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressioncalculateModuloExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressioncalculateMultExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculateNamingChainCallExpression(ASTCallExpression expr, java.util.List<ExprToNamePair> nameParts, java.util.List<SymTypeExpression> argTypes)Deprecated.Calculate the type result of call expressions that represent fully qualified method calls (like when calling a static method:pac.kage.Type.staticMethod()) and methodCalls on cascading field accesses (e.g.,localField.innerField.instanceMethod()).protected voidcalculateNamingChainFieldAccess(ASTFieldAccessExpression expr, java.util.List<ExprToNamePair> nameParts)Deprecated.Calculate the type result of FieldAccessExpressions that represent qualified names and cascading field accesses.protected SymTypeExpressioncalculateNotEqualsExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculateOwnedCallExpression(ASTCallExpression expr, java.lang.String methodName, java.util.List<SymTypeExpression> args)Deprecated.Calculates the type result of the call expression, given that the type result of the method owner has already been computed (and is accessible via getTypeCheckResult()), and that the type of its arguments has already been computed.protected SymTypeExpressioncalculatePlusExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected voidcalculateQualifiedMethod(java.lang.String qualName, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes)Deprecated.Checks whether there exists a method symbol with the name given byqualNamewith matching argument types.protected SymTypeExpressioncalculateTypeCompare(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)Deprecated.helper method for<=, >=, <, > ->calculates the result of these expressionsprotected SymTypeExpressioncalculateTypeLogical(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)Deprecated.helper method for ==, != calculates the result of these expressionsprotected voidcheckForReturnType(ASTCallExpression expr, java.util.List<FunctionSymbol> fittingMethods)Deprecated.protected voidcheckForReturnType(java.util.List<SymTypeOfFunction> fittingFunctions, ASTCallExpression expr)Deprecated.protected booleancheckModifierType(TypeSymbol typeSymbol)Deprecated.Hookpoint for object oriented languages that offer modifiers like static, public, private, ...protected java.util.List<SymTypeOfFunction>chooseMostSpecificFunction(java.util.List<SymTypeOfFunction> candidates, java.util.List<SymTypeExpression> args, ASTCallExpression expr)Deprecated.protected SymTypeExpressionderive(ASTBooleanNotExpression expr)Deprecated.protected SymTypeExpressionderive(ASTLogicalNotExpression expr)Deprecated.protected java.util.List<FunctionSymbol>filterModifiersFunctions(java.util.List<FunctionSymbol> functionSymbols)Deprecated.Hookpoint for object oriented languages that offer modifiers like static, public, private, ...protected java.util.List<VariableSymbol>filterModifiersVariables(java.util.List<VariableSymbol> variableSymbols)Deprecated.Hookpoint for object oriented languages that offer modifiers like static, public, private, ...protected SymTypeExpressiongetBinaryNumericPromotion(SymTypeExpression leftResult, SymTypeExpression rightResult)Deprecated.return the result for the five basic arithmetic operations (+,-,*,/,%)protected java.util.List<VariableSymbol>getCorrectFieldsFromInnerType(SymTypeExpression innerResult, ASTFieldAccessExpression expr)Deprecated.Hookpoint for object oriented languages to get the correct variables/fields from a type based on their modifiersprotected java.util.List<FunctionSymbol>getCorrectMethodsFromInnerType(SymTypeExpression innerResult, ASTCallExpression expr, java.lang.String name)Deprecated.Hookpoint for object oriented languages to get the correct functions/methods from a type based on their modifiersprotected SymTypeExpressiongetCorrectResultArrayExpression(IExpressionsBasisScope scope, SymTypeExpression indexResult, SymTypeExpression arrayTypeResult, SymTypeArray arrayResult)Deprecated.DefiningSymbolSettergetDefiningSymbolSetter()Deprecated.protected java.util.List<SymTypeOfFunction>getFittingFunctions(java.util.List<SymTypeOfFunction> candidates, ASTCallExpression expr, java.util.List<SymTypeExpression> args)Deprecated.SubExprNameExtractorgetSubExprNameExtractor()Deprecated.CommonExpressionsTraversergetTraverser()Deprecated.protected SymTypeExpressiongreaterEqual(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressionless(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressionlessEqual(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressionlogicalNot(SymTypeExpression inner, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressionnumericPrefix(ASTExpression expr, java.lang.String op, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressionnumericPrefix(SymTypeExpression inner, java.lang.String op, de.se_rwth.commons.SourcePosition pos)Deprecated.protected SymTypeExpressionreplaceTypeVariables(SymTypeExpression wholeResult, java.util.List<SymTypeExpression> typeArgs, java.util.List<SymTypeExpression> argumentList)Deprecated.voidsetDefiningSymbolSetter(DefiningSymbolSetter definingSymboLSetter)Deprecated.voidsetSubExprNameExtractor(SubExprNameExtractor subExprNameExtractor)Deprecated.voidsetTraverser(CommonExpressionsTraverser traverser)Deprecated.voidtraverse(ASTArrayAccessExpression node)Deprecated.voidtraverse(ASTBooleanAndOpExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTBooleanNotExpression expr)Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expressionvoidtraverse(ASTBooleanOrOpExpression expr)Deprecated.voidtraverse(ASTCallExpression expr)Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expressionvoidtraverse(ASTConditionalExpression expr)Deprecated.We use traverse to collect the results of the three parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTDivideExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTEqualsExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTFieldAccessExpression expr)Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expressionvoidtraverse(ASTGreaterEqualExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTGreaterThanExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTLessEqualExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTLessThanExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTLogicalNotExpression expr)Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expressionvoidtraverse(ASTMinusExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTMinusPrefixExpression expr)Deprecated.voidtraverse(ASTModuloExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTMultExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTNotEqualsExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTPlusExpression expr)Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expressionvoidtraverse(ASTPlusPrefixExpression expr)Deprecated.-
Methods inherited from class de.monticore.types.check.AbstractDeriveFromExpression
acceptThisAndReturnSymTypeExpression, acceptThisAndReturnSymTypeExpression, calculateInnerTypes, checkNotObscure, getScope, getTypeCheckResult, isIntegralType, isNumericType, logError, setTypeCheckResult, storeResultOrLogError
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.monticore.expressions.commonexpressions._visitor.CommonExpressionsHandler
handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, handle, traverse, traverse, traverse, traverse, traverse
-
Methods inherited from interface de.monticore.expressions.commonexpressions._visitor.CommonExpressionsVisitor2
endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Field Detail
-
traverser
protected CommonExpressionsTraverser traverser
Deprecated.
-
subExprNameExtractor
protected SubExprNameExtractor subExprNameExtractor
Deprecated.
-
definingSymbolSetter
protected DefiningSymbolSetter definingSymbolSetter
Deprecated.
-
-
Constructor Detail
-
DeriveSymTypeOfBSCommonExpressions
public DeriveSymTypeOfBSCommonExpressions()
Deprecated.
-
DeriveSymTypeOfBSCommonExpressions
public DeriveSymTypeOfBSCommonExpressions(SubExprNameExtractor subExprNameExtractor, DefiningSymbolSetter definingSymbolSetter)
Deprecated.
-
-
Method Detail
-
getTraverser
public CommonExpressionsTraverser getTraverser()
Deprecated.- Specified by:
getTraverserin interfaceCommonExpressionsHandler- Specified by:
getTraverserin interfacede.monticore.visitor.IHandler- Specified by:
getTraverserin classAbstractDeriveFromExpression
-
setTraverser
public void setTraverser(CommonExpressionsTraverser traverser)
Deprecated.- Specified by:
setTraverserin interfaceCommonExpressionsHandler
-
getSubExprNameExtractor
public SubExprNameExtractor getSubExprNameExtractor()
Deprecated.
-
setSubExprNameExtractor
public void setSubExprNameExtractor(SubExprNameExtractor subExprNameExtractor)
Deprecated.
-
getDefiningSymbolSetter
public DefiningSymbolSetter getDefiningSymbolSetter()
Deprecated.
-
setDefiningSymbolSetter
public void setDefiningSymbolSetter(DefiningSymbolSetter definingSymboLSetter)
Deprecated.
-
traverse
public void traverse(ASTPlusPrefixExpression expr)
Deprecated.- Specified by:
traversein interfaceCommonExpressionsHandler
-
traverse
public void traverse(ASTMinusPrefixExpression expr)
Deprecated.- Specified by:
traversein interfaceCommonExpressionsHandler
-
numericPrefix
protected SymTypeExpression numericPrefix(ASTExpression expr, java.lang.String op, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
numericPrefix
protected SymTypeExpression numericPrefix(SymTypeExpression inner, java.lang.String op, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTPlusExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculatePlusExpression
protected SymTypeExpression calculatePlusExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTMultExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateMultExpression
protected SymTypeExpression calculateMultExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTDivideExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateDivideExpression
protected SymTypeExpression calculateDivideExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTMinusExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateMinusExpression
protected SymTypeExpression calculateMinusExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTModuloExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateModuloExpression
protected SymTypeExpression calculateModuloExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTLessEqualExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
lessEqual
protected SymTypeExpression lessEqual(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTGreaterEqualExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
greaterEqual
protected SymTypeExpression greaterEqual(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTLessThanExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
less
protected SymTypeExpression less(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTGreaterThanExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateGreaterThanExpression
protected SymTypeExpression calculateGreaterThanExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTEqualsExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateEqualsExpression
protected SymTypeExpression calculateEqualsExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTNotEqualsExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateNotEqualsExpression
protected SymTypeExpression calculateNotEqualsExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTBooleanAndOpExpression expr)
Deprecated.We use traverse to collect the results of the two parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateBooleanAndOpExpression
protected SymTypeExpression calculateBooleanAndOpExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTBooleanOrOpExpression expr)
Deprecated.- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateBooleanOrOpExpression
protected SymTypeExpression calculateBooleanOrOpExpression(SymTypeExpression left, SymTypeExpression right, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
calculateLogicalOrOpAndOp
protected SymTypeExpression calculateLogicalOrOpAndOp(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTLogicalNotExpression expr)
Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
derive
protected SymTypeExpression derive(ASTLogicalNotExpression expr)
Deprecated.
-
logicalNot
protected SymTypeExpression logicalNot(SymTypeExpression inner, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTConditionalExpression expr)
Deprecated.We use traverse to collect the results of the three parts of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateConditionalExpressionType
protected SymTypeExpression calculateConditionalExpressionType(ASTConditionalExpression expr, SymTypeExpression conditionResult, SymTypeExpression trueResult, SymTypeExpression falseResult)
Deprecated.
-
traverse
public void traverse(ASTBooleanNotExpression expr)
Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
derive
protected SymTypeExpression derive(ASTBooleanNotExpression expr)
Deprecated.
-
booleanNot
protected SymTypeExpression booleanNot(SymTypeExpression inner, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTFieldAccessExpression expr)
Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateNamingChainFieldAccess
protected void calculateNamingChainFieldAccess(ASTFieldAccessExpression expr, java.util.List<ExprToNamePair> nameParts)
Deprecated.Calculate the type result of FieldAccessExpressions that represent qualified names and cascading field accesses. E.g., pac.kage.Type.staticMember, or, localField.innerField.furtherNestedField. But not: pac.kage.Type.staticMethod().innerField, as here innerField is not only qualified by names, but it is based on the access of a value returned by a CallExpression.- Parameters:
expr- The only valid sub expressions of the FieldAccessExpression are other FieldAccessExpressions, and aASTNameExpressionthat is the end of the field access chain.
-
calculateArithmeticFieldAccessExpression
protected void calculateArithmeticFieldAccessExpression(ASTFieldAccessExpression expr)
Deprecated.Calculate the type result of FieldAccessExpressions that do not represent qualified names. (E.g. `new Foo().bar`)
-
calculateFieldAccess
protected void calculateFieldAccess(ASTFieldAccessExpression expr, boolean quiet)
Deprecated.Calculates the type result of the field access expression, given that the type result of the accessed entity's owner has already been computed (and is accessible via getTypeCheckResult()).- Parameters:
quiet- Prevents the logging of errors if no entity is found that could be accessed, i.e., if the field access is invalid and the calculation of a result is not possible.
-
getCorrectFieldsFromInnerType
protected java.util.List<VariableSymbol> getCorrectFieldsFromInnerType(SymTypeExpression innerResult, ASTFieldAccessExpression expr)
Deprecated.Hookpoint for object oriented languages to get the correct variables/fields from a type based on their modifiers
-
checkModifierType
protected boolean checkModifierType(TypeSymbol typeSymbol)
Deprecated.Hookpoint for object oriented languages that offer modifiers like static, public, private, ...
-
filterModifiersVariables
protected java.util.List<VariableSymbol> filterModifiersVariables(java.util.List<VariableSymbol> variableSymbols)
Deprecated.Hookpoint for object oriented languages that offer modifiers like static, public, private, ...
-
calculatedQualifiedEntity
protected void calculatedQualifiedEntity(java.util.List<ExprToNamePair> nameParts)
Deprecated.Tries to resolve the given name parts to a variable, type variable, or type and if a symbol is found, then it(s type) is set as the current type check result. If no symbol is found, then nothing happens (no error logged, no altering of the type check result). If multiple fields are found, then the result is set to obscure, and an error is logged. Variables take precedence over types variables that take precedence over types.- Parameters:
nameParts- Expressions that represent a qualified identification of aVariableSymbol,TypeVarSymbol, orTypeSymbol. Therefore, the list that must contain aNameExpressionat the beginning, followed only byFieldAccessExpressions.
-
traverse
public void traverse(ASTCallExpression expr)
Deprecated.We use traverse to collect the result of the inner part of the expression and calculate the result for the whole expression- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateNamingChainCallExpression
protected void calculateNamingChainCallExpression(ASTCallExpression expr, java.util.List<ExprToNamePair> nameParts, java.util.List<SymTypeExpression> argTypes)
Deprecated.Calculate the type result of call expressions that represent fully qualified method calls (like when calling a static method:pac.kage.Type.staticMethod()) and methodCalls on cascading field accesses (e.g.,localField.innerField.instanceMethod()). But not:pac.kage.Type.staticMethod().innerField.instanceMethod(), as here instanceMethod is not only qualified by names, but it is based on the access of a value returned by a CallExpression.- Parameters:
expr- The call expression itselfnameParts- The name parts of the method in their order of appearance. Provide both their AST version, and their String version!argTypes- the types of the arguments of the method
-
calculateArithmeticCallExpression
protected void calculateArithmeticCallExpression(ASTCallExpression expr, java.lang.String methodName, java.util.List<ExprToOptNamePair> methodCallParts, java.util.List<SymTypeExpression> argTypes)
Deprecated.Calculates the type result of the expression, given that it is not a simple, or qualified method access. E.g., this method calculates the result of"FooBar".substring(0, 3), or( foo ? new LinkedList<String>() : new ArrayList<String>() ).add("bar"). On the other hand, this method is not suited forpac.kage.Owner.staticMethod(), orisInt()(a local Method name). UsecalculateNamingChainCallExpression(ASTCallExpression, List, List)in these cases.
-
calculateOwnedCallExpression
protected void calculateOwnedCallExpression(ASTCallExpression expr, java.lang.String methodName, java.util.List<SymTypeExpression> args)
Deprecated.Calculates the type result of the call expression, given that the type result of the method owner has already been computed (and is accessible via getTypeCheckResult()), and that the type of its arguments has already been computed.
-
calculateQualifiedMethod
protected void calculateQualifiedMethod(java.lang.String qualName, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes)Deprecated.Checks whether there exists a method symbol with the name given byqualNamewith matching argument types. If such a method exists, it's return type is set as the type check result.- Parameters:
qualName- Qualified name of the method symbol to look for. Can also be a simple name without qualification.callExpr- The call expression of the method call. Needed as entry point to the symbol table to resolve method symbols.argTypes- The types of the method arguments. Are allowed to be obscure, but in this case the method will also always set *obscure* to be the method's type. Nevertheless, this method may print errors, if there is no method symbol of the given name at all, regardless of matching argument types.
-
calculateFunctionReturnTypeBasedOnSignature
protected void calculateFunctionReturnTypeBasedOnSignature(java.util.List<SymTypeOfFunction> candidates, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes)
Deprecated.
-
calculateFunctionReturnTypeBasedOnSignature
protected void calculateFunctionReturnTypeBasedOnSignature(java.util.List<SymTypeOfFunction> candidates, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes, java.util.Map<SymTypeOfFunction,FunctionSymbol> definingSymbols)
Deprecated.Checks whether any of thecandidatesfunctions that thecallExprmay represent match the givenargTypessignature. If there are multiple candidates remaining and the callExpr has bounds on the types that it may represent, then the candidate with the matching return type is chosen. The chosen candidate's return type is then set as the current type check result.- Parameters:
argTypes- The types of the method arguments. Are allowed to be obscure, but in this case the function will also always set *obscure* to be the method's type. Nevertheless, this method may print errors, if there is no method symbol of the given name at all, regardless of matching argument types.definingSymbols- if one candidate is found the corresponding symbol is set as the defining symbol, if applicable.
-
calculateMethodReturnTypeBasedOnSignature
protected void calculateMethodReturnTypeBasedOnSignature(java.util.List<FunctionSymbol> candidates, ASTCallExpression callExpr, java.util.List<SymTypeExpression> argTypes)
Deprecated.Checks whether any of thecandidatesmethods that thecallExprmay represent match the givenargTypessignature. If there are multiple candidates remaining and the callExpr has bounds on the types that it may represent, then the candidate with the matching return type is chosen. The chosen candidate's return type is then set as the current type check result.- Parameters:
argTypes- The types of the method arguments. Are allowed to be obscure, but in this case the method will also always set *obscure* to be the method's type. Nevertheless, this method may print errors, if there is no method symbol of the given name at all, regardless of matching argument types.
-
calculateArguments
protected java.util.List<SymTypeExpression> calculateArguments(ASTCallExpression expr)
Deprecated.
-
checkForReturnType
protected void checkForReturnType(ASTCallExpression expr, java.util.List<FunctionSymbol> fittingMethods)
Deprecated.
-
checkForReturnType
protected void checkForReturnType(java.util.List<SymTypeOfFunction> fittingFunctions, ASTCallExpression expr)
Deprecated.
-
getCorrectMethodsFromInnerType
protected java.util.List<FunctionSymbol> getCorrectMethodsFromInnerType(SymTypeExpression innerResult, ASTCallExpression expr, java.lang.String name)
Deprecated.Hookpoint for object oriented languages to get the correct functions/methods from a type based on their modifiers
-
getFittingFunctions
protected java.util.List<SymTypeOfFunction> getFittingFunctions(java.util.List<SymTypeOfFunction> candidates, ASTCallExpression expr, java.util.List<SymTypeExpression> args)
Deprecated.
-
chooseMostSpecificFunction
protected java.util.List<SymTypeOfFunction> chooseMostSpecificFunction(java.util.List<SymTypeOfFunction> candidates, java.util.List<SymTypeExpression> args, ASTCallExpression expr)
Deprecated.
-
filterModifiersFunctions
protected java.util.List<FunctionSymbol> filterModifiersFunctions(java.util.List<FunctionSymbol> functionSymbols)
Deprecated.Hookpoint for object oriented languages that offer modifiers like static, public, private, ...
-
calculateTypeCompare
protected SymTypeExpression calculateTypeCompare(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)
Deprecated.helper method for<=, >=, <, > ->calculates the result of these expressions
-
calculateTypeLogical
protected SymTypeExpression calculateTypeLogical(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)
Deprecated.helper method for ==, != calculates the result of these expressions
-
getBinaryNumericPromotion
protected SymTypeExpression getBinaryNumericPromotion(SymTypeExpression leftResult, SymTypeExpression rightResult)
Deprecated.return the result for the five basic arithmetic operations (+,-,*,/,%)
-
calculateArithmeticExpression
protected SymTypeExpression calculateArithmeticExpression(SymTypeExpression left, SymTypeExpression right, java.lang.String op, de.se_rwth.commons.SourcePosition pos)
Deprecated.
-
traverse
public void traverse(ASTArrayAccessExpression node)
Deprecated.- Specified by:
traversein interfaceCommonExpressionsHandler
-
calculateArrayExpression
protected SymTypeExpression calculateArrayExpression(ASTArrayAccessExpression node, SymTypeExpression arrayTypeResult, SymTypeExpression indexResult)
Deprecated.
-
getCorrectResultArrayExpression
protected SymTypeExpression getCorrectResultArrayExpression(IExpressionsBasisScope scope, SymTypeExpression indexResult, SymTypeExpression arrayTypeResult, SymTypeArray arrayResult)
Deprecated.
-
replaceTypeVariables
protected SymTypeExpression replaceTypeVariables(SymTypeExpression wholeResult, java.util.List<SymTypeExpression> typeArgs, java.util.List<SymTypeExpression> argumentList)
Deprecated.
-
-