public class TempAttributeSemantics extends java.lang.Object implements SemanticChecks
Modifier and Type | Field and Description |
---|---|
private java.util.Hashtable<java.lang.String,TempAttributeDescription> |
_allTempAttributes
Liste mit allen temporären Attributen.
|
private AttributeSemantics |
_attributeSemantics |
private MemberCheck |
_check |
private Semantics |
_semantics |
private SymbolTable |
_symbolTable |
Constructor and Description |
---|
TempAttributeSemantics(Semantics semantics,
AttributeSemantics attributeSemantics) |
Modifier and Type | Method and Description |
---|---|
void |
addTempAttributeDefinition(antlr.collections.AST ast,
java.lang.String attribute,
java.lang.String type,
ExpressionTree expression)
Überprüft die Definition eines temporären Attributs.
|
void |
addTempAttributePlaceholder(java.lang.String name,
java.lang.String columnName)
Fügt ein Platzhalter Attribut in die Liste der Attribute bzw.
|
private java.lang.String |
checkAttributeForRecursion(TempAttributeDescription startAttribute,
java.util.HashSet<TempAttributeDescription> checked,
java.util.HashSet<TempAttributeDescription> inTest)
Überprüft ob die Definitionen eines temporären Attributs rekursiv ist.
|
private java.lang.String |
checkForRecursion()
Überprüft ob die Definitionen der temporären Attribute rekursiv sind.
|
(package private) java.lang.String |
checkForRecursion(java.util.List<TempAttributeDescription> atts)
Diese Methode existiert nur zu Testzwecken und überschreibt
_allTempAttributes ! |
void |
cleanUp(ProcessingParameter pp,
boolean processScript)
Führt eine abschließende Überprüfung durch.
|
(package private) static boolean |
isTypeCompatible(AttributeType attributeType,
ExpressionResult.ResultType resultType)
Gibt an, ob der Attributtyp ein sinnvoller Container für den Wert einer Berechnung (z.B. in TempAttributen) ist.
|
private Semantics _semantics
private SymbolTable _symbolTable
private AttributeSemantics _attributeSemantics
private MemberCheck _check
private java.util.Hashtable<java.lang.String,TempAttributeDescription> _allTempAttributes
public TempAttributeSemantics(Semantics semantics, AttributeSemantics attributeSemantics)
semantics
- attributeSemantics
- public void addTempAttributeDefinition(antlr.collections.AST ast, java.lang.String attribute, java.lang.String type, ExpressionTree expression) throws CriticalParserException
AttributeSemantics.incAttributeCount()
erhöht.ast
- Knoten (wird nur für Zeilenangabe in der Fehlermeldung benötigt)attribute
- Temporäres Attributtype
- Typ des temporären Attributsexpression
- Ausdruck um den Wert des temporären AttributeDescription zu berechnenCriticalParserException
- Falls das Attribut nicht korrekt definiert wurde oder es zu einem Kommunikationsfehler kommtstatic boolean isTypeCompatible(AttributeType attributeType, ExpressionResult.ResultType resultType) throws SemanticErrorException
attributeType
- Attributtyp in den der Wert gesteckt werden sollresultType
- Ergebnistyp einer BerechnungSemanticErrorException
- Wenn ein Integer-Attribut keinen Zahlenbereich enthält, es aber Zahlen aufnehmen sollpublic void addTempAttributePlaceholder(java.lang.String name, java.lang.String columnName)
name
- Name des temporären Attributspublic void cleanUp(ProcessingParameter pp, boolean processScript) throws SemanticErrorException
addTempAttributePlaceholder(String,String)
eingefügt) durch das jeweilige
temporäre Attribut.cleanUp
in interface SemanticChecks
pp
- Wird nicht berücksichtigt.processScript
- Hat keine Bedeutung.SemanticErrorException
- Undefiniertes temporäres Attribut.private java.lang.String checkForRecursion()
checkAttributeForRecursion(TempAttributeDescription,HashSet,HashSet)
private java.lang.String checkAttributeForRecursion(TempAttributeDescription startAttribute, java.util.HashSet<TempAttributeDescription> checked, java.util.HashSet<TempAttributeDescription> inTest)
startAttribute
verweist, auf.startAttribute
- Temporäres Attribut das überprüft werden soll.checked
- Bisher überprüfte temporäre Attribute.inTest
- Attribute die gerade überprüft werden.java.lang.String checkForRecursion(java.util.List<TempAttributeDescription> atts)
_allTempAttributes
!