|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sintef.mofscript.parser.MofScriptModelChecker
public class MofScriptModelChecker
Semantic checker for MOFScript
Field Summary | |
---|---|
protected java.util.Hashtable |
_currentCreatedTypes
|
protected TransformationRule |
_currentRule
|
protected java.lang.String |
_currentRuleType
|
protected MofScriptErrorManager |
_errorMgr
|
protected ExecutionManager |
_execMgr
|
protected java.util.Hashtable |
_fileDeclarations
|
protected java.util.Hashtable |
_importedTransformations
|
protected boolean |
_metamodelsOk
|
protected java.util.Hashtable |
_postCheckReferences
|
protected java.util.Hashtable |
_ruleDeclarations
|
protected MOFScriptTransformation |
_transformation
|
protected TransformationProxy |
_transformationProxy
|
protected MOFScriptSpecification |
_transformationSpec
|
protected java.util.Stack |
_variableStack
|
static int |
SOURCE_METAMODEL
|
static int |
TARGET_METAMODEL
|
Constructor Summary | |
---|---|
MofScriptModelChecker()
Default constructor |
Method Summary | |
---|---|
void |
addImportedTransformation(java.lang.String importName,
java.lang.String importUri,
MOFScriptTransformation importedTr)
|
boolean |
addSourceMetaModel(MOFScriptParameter param)
|
protected MofScriptParseError |
booleanFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
void |
checkExpression(Expression exp)
Checks an expression |
void |
checkMetaModels()
sets the source and target metamodels from transformation objects |
void |
checkParameter(MOFScriptParameter parameter)
Checks a domain (a parameter) to the rule |
protected MofScriptParseError |
checkParameterUsage(java.lang.String fName,
FunctionCall fc,
int requiredParamCount)
Checks the parameters usage Used where for locked number of parameters |
protected MofScriptParseError |
checkParameterUsage(java.lang.String fName,
FunctionCall fc,
int lowerCount,
int upperCount)
Checks the numbers of parameters |
void |
checkReference(Reference ref)
|
void |
checkReferenceName(java.lang.String refName,
MOFScriptObject checkObj)
|
protected MofScriptParseError |
checkRuleContext(MOFScriptParameter parameter)
Checks the context of a rule |
void |
checkStatement(MOFScriptStatement statement,
boolean postCheck)
Checks a statement within a rule |
void |
checkTransformationRule(TransformationRule rule,
boolean postCheck)
Checks a transformation rule for type usages, rule invocations etc |
protected java.lang.String |
checkType(java.lang.String dtype,
MOFScriptObject checkObject)
|
void |
checkVariableDeclaration(VariableDeclaration varDecl)
Checks properties of the transformation |
protected MofScriptParseError |
checkVariableUsage(VariableDeclaration var,
java.lang.String functionCalled,
FunctionCall fc)
Check if the usage of a variable (e.g. a Hashtable var) is legal |
void |
clear()
Clears all stored values |
java.lang.String |
findGlobalParameter(java.lang.String name)
Returns the type name of the parameter if it exists |
VariableDeclaration |
findGlobalVariables(MOFScriptTransformation transformation,
java.lang.String name)
|
java.lang.Object |
findVariable(java.lang.String name)
Find a variable either globally or locally |
int |
getErrorCount()
Gets the error count |
MofScriptErrorManager |
getErrorManager()
Gets the error manager |
java.util.Iterator |
getErrors()
Gets the errors |
org.eclipse.emf.ecore.EClassifier |
getMetaModelClassifier(org.eclipse.emf.ecore.EPackage model,
java.lang.String classifierName)
Looks for a classifier for a metamodel package Looks recursively into sub packages |
protected org.eclipse.emf.ecore.EClassifier |
getMetaModelReference(java.lang.String refName)
Gets a meta model reference |
boolean |
getMetaModelsOK()
|
protected VariableDeclaration |
getTempVar()
|
MOFScriptTransformation |
getTransformationModel()
|
TransformationProxy |
getTransformationProxy()
returns the current transformation model |
MOFScriptSpecification |
getTransformationSpecification()
|
protected MofScriptParseError |
hashtableFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
protected MofScriptParseError |
integerFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
boolean |
isSuperTransformation(MOFScriptTransformation transformation,
MOFScriptTransformation possibleSuper)
|
protected MofScriptParseError |
listFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
void |
postCheck()
Semantic checks of the complete model |
protected void |
postCheckExpression(Expression exp)
Post checking, when all rules can be resolved... |
protected void |
postCheckFunctionCall(FunctionCall fc)
Perform post check of a function call |
protected void |
postCheckUnresolvedReferences()
Iterators through unresolved references and looks for them again. |
void |
printErrors()
Prints the errors to system.out |
protected MofScriptParseError |
realFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
protected void |
setExtendsRelation(MOFScriptTransformation transformation,
java.util.Hashtable trHierarchy)
|
boolean |
setTargetMetaModel(java.lang.String targetMM)
Sets the target metamodel |
void |
setTransformationModel(MOFScriptTransformation transformation)
|
void |
setTransformationSpecification(MOFScriptSpecification trModel)
|
protected MofScriptParseError |
stringFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
protected MofScriptParseError |
systemFunctionOk(java.lang.String functionCalled,
FunctionCall fc)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int SOURCE_METAMODEL
public static int TARGET_METAMODEL
protected TransformationProxy _transformationProxy
protected MOFScriptSpecification _transformationSpec
protected MOFScriptTransformation _transformation
protected ExecutionManager _execMgr
protected MofScriptErrorManager _errorMgr
protected java.util.Stack _variableStack
protected java.util.Hashtable _ruleDeclarations
protected java.util.Hashtable _fileDeclarations
protected java.util.Hashtable _currentCreatedTypes
protected java.util.Hashtable _importedTransformations
protected java.lang.String _currentRuleType
protected TransformationRule _currentRule
protected boolean _metamodelsOk
protected java.util.Hashtable _postCheckReferences
Constructor Detail |
---|
public MofScriptModelChecker()
Method Detail |
---|
public TransformationProxy getTransformationProxy()
public void setTransformationSpecification(MOFScriptSpecification trModel)
trModel
- public MOFScriptSpecification getTransformationSpecification()
public void setTransformationModel(MOFScriptTransformation transformation)
transformation
- public MOFScriptTransformation getTransformationModel()
public void clear()
public boolean getMetaModelsOK()
public void checkMetaModels()
public boolean addSourceMetaModel(MOFScriptParameter param)
param
-
public boolean setTargetMetaModel(java.lang.String targetMM)
targetMetaModel
- public void checkVariableDeclaration(VariableDeclaration varDecl)
public org.eclipse.emf.ecore.EClassifier getMetaModelClassifier(org.eclipse.emf.ecore.EPackage model, java.lang.String classifierName)
model
- classifierName
-
public void checkTransformationRule(TransformationRule rule, boolean postCheck)
protected org.eclipse.emf.ecore.EClassifier getMetaModelReference(java.lang.String refName)
refName
-
protected MofScriptParseError checkRuleContext(MOFScriptParameter parameter)
parameter
- public void checkParameter(MOFScriptParameter parameter)
domain
- protected java.lang.String checkType(java.lang.String dtype, MOFScriptObject checkObject)
dtype
- Full name of the type
public void checkStatement(MOFScriptStatement statement, boolean postCheck)
statement
- public java.lang.String findGlobalParameter(java.lang.String name)
exp
- public VariableDeclaration findGlobalVariables(MOFScriptTransformation transformation, java.lang.String name)
name
-
public java.lang.Object findVariable(java.lang.String name)
exp
- public void checkExpression(Expression exp)
exp
- public void checkReference(Reference ref)
public void checkReferenceName(java.lang.String refName, MOFScriptObject checkObj)
public void postCheck() throws MofScriptModelException
MofScriptModelException
protected void postCheckUnresolvedReferences()
protected void postCheckExpression(Expression exp)
exp
- protected void postCheckFunctionCall(FunctionCall fc)
fc
- public boolean isSuperTransformation(MOFScriptTransformation transformation, MOFScriptTransformation possibleSuper)
transformation
- possibleSuper
-
protected void setExtendsRelation(MOFScriptTransformation transformation, java.util.Hashtable trHierarchy)
transformation
- trHierarchy
- public void addImportedTransformation(java.lang.String importName, java.lang.String importUri, MOFScriptTransformation importedTr)
protected VariableDeclaration getTempVar()
protected MofScriptParseError checkVariableUsage(VariableDeclaration var, java.lang.String functionCalled, FunctionCall fc)
var
- functionCalled
-
protected MofScriptParseError systemFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError stringFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError listFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError hashtableFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError booleanFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError realFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError integerFunctionOk(java.lang.String functionCalled, FunctionCall fc)
functionCalled
- fc
-
protected MofScriptParseError checkParameterUsage(java.lang.String fName, FunctionCall fc, int requiredParamCount)
fName
- fc
- requiredParamCount
-
protected MofScriptParseError checkParameterUsage(java.lang.String fName, FunctionCall fc, int lowerCount, int upperCount)
fName
- fc
- lowerCount
- upperCount
-
public void printErrors()
public MofScriptErrorManager getErrorManager()
public int getErrorCount()
public java.util.Iterator getErrors()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |