Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VIATRA2/Examples/VTCL/TypeChecking"

< VIATRA2‎ | Examples‎ | VTCL
(Overview: Type checking)
(Overview: Type checking)
Line 14: Line 14:
  
 
=== Typed variables in graph patterns ===
 
=== Typed variables in graph patterns ===
 +
 +
=== Error messages ===
 +
 +
The following error messages are issued by the type checker
 +
* '''Operator '-' is undefined for the argument type ('datatypes.String')''': issued when checking an ASM term
 +
* '''Operator '*' is undefined for the argument types ('datatypes.String', 'datatypes.String')''': issued when checking an ASM term
 +
* '''The type 'uml2.metamodel.Classifier' of actual parameter is not compatible with the type 'uml2.metamodel.Class' of symbolic parameter 'C'. See the definition of 'myPattern' ''': issued when calling a graph pattern using the '''find''' construct
 +
* '''The type 'uml2.metamodel.Classifier' of variable reference is not compatible with the type 'uml2.metamodel.Class' of its definition.''': issued in ASM rules or in the body of graph patterns
 +
* '''Type incompatible assignment: left value is of type 'datatypes.String', right value is of type 'datatypes.Integer' ''': issued in case of an '''update''' rule
 +
* '''Type incompatible initialization: expecting a term of type 'datatypes.String' instead of 'datatypes.Integer' ''': issued when initializing an ASM function
 +
 +
--[[User:Varro.mit.bme.hu|Varro.mit.bme.hu]] 11:02, 25 May 2009 (UTC)

Revision as of 07:02, 25 May 2009

Overview: Type checking

Type checking is introduced to the VTCL language in a backward compatible way. This means that any existing VTCL transformation should compile without modification.

As the main extension of the language, one can add type information to

  • all variables defined locally with the let rule
  • a parameter of an ASM rule, graph pattern or graph transformation rule
  • for the parameters and return values of ASM functions

Then the VIATRA2 parser checks if these variables are used in a type conformant way.

Typed variables within ASM rules

Typed variables in ASM functions

Typed variables in graph patterns

Error messages

The following error messages are issued by the type checker

  • Operator '-' is undefined for the argument type ('datatypes.String'): issued when checking an ASM term
  • Operator '*' is undefined for the argument types ('datatypes.String', 'datatypes.String'): issued when checking an ASM term
  • The type 'uml2.metamodel.Classifier' of actual parameter is not compatible with the type 'uml2.metamodel.Class' of symbolic parameter 'C'. See the definition of 'myPattern' : issued when calling a graph pattern using the find construct
  • The type 'uml2.metamodel.Classifier' of variable reference is not compatible with the type 'uml2.metamodel.Class' of its definition.: issued in ASM rules or in the body of graph patterns
  • Type incompatible assignment: left value is of type 'datatypes.String', right value is of type 'datatypes.Integer' : issued in case of an update rule
  • Type incompatible initialization: expecting a term of type 'datatypes.String' instead of 'datatypes.Integer' : issued when initializing an ASM function

--Varro.mit.bme.hu 11:02, 25 May 2009 (UTC)

Back to the top