diff options
author | fjouault | 2008-04-08 21:53:35 +0000 |
---|---|---|
committer | fjouault | 2008-04-08 21:53:35 +0000 |
commit | f00686da27fa4dd00bac681729cf6bf9ceff6741 (patch) | |
tree | 7e6895c050b7570113014d2e4091837d5285913f /dsls | |
parent | 2c81dcaa8cb0c8474da6fc09d5e559fc5199b474 (diff) | |
download | org.eclipse.atl-f00686da27fa4dd00bac681729cf6bf9ceff6741.tar.gz org.eclipse.atl-f00686da27fa4dd00bac681729cf6bf9ceff6741.tar.xz org.eclipse.atl-f00686da27fa4dd00bac681729cf6bf9ceff6741.zip |
added support for NullValue
Diffstat (limited to 'dsls')
-rw-r--r-- | dsls/ATL/Compiler/ATL.acg | 30 | ||||
-rw-r--r-- | dsls/ATL/RuntimeSupport/RefiningTrace.km3 | 2 |
2 files changed, 26 insertions, 6 deletions
diff --git a/dsls/ATL/Compiler/ATL.acg b/dsls/ATL/Compiler/ATL.acg index afb3cc54..c792c3c6 100644 --- a/dsls/ATL/Compiler/ATL.acg +++ b/dsls/ATL/Compiler/ATL.acg @@ -325,6 +325,11 @@ acg ATL startsWith Unit { call 'J.=(J):B' if thn3 -- not enum literal + load 'self' + call 'J.oclIsUndefined():B' + if oclUndefined + -- This point should only be reached for model elements + push 'ElementVal' push 'RefiningTrace' new @@ -333,6 +338,11 @@ acg ATL startsWith Unit { call 'J.__asElement():J' set 'value' goto eoi3 + oclUndefined: + push 'NullVal' + push 'RefiningTrace' + new + goto eoi3 thn3: push 'EnumLiteralVal' push 'RefiningTrace' @@ -348,12 +358,12 @@ acg ATL startsWith Unit { context 'J' name '__asElement' { -- TODO: use a Map as cache - push 'Element' - push 'RefiningTrace' - new - dup - load 'self' - set 'sourceElement' + push 'Element' + push 'RefiningTrace' + new + dup + load 'self' + set 'sourceElement' } operation context 'MRefiningTrace!BooleanVal;' @@ -380,6 +390,14 @@ acg ATL startsWith Unit { get 'value' } operation + context 'MRefiningTrace!NullVal;' + name '__fromValue' { + push 'Sequence' + push '#native' + new + call 'QJ.first():J' + } + operation context 'MRefiningTrace!ElementVal;' name '__fromValue' { load 'self' diff --git a/dsls/ATL/RuntimeSupport/RefiningTrace.km3 b/dsls/ATL/RuntimeSupport/RefiningTrace.km3 index 30c82e88..f3dedd3d 100644 --- a/dsls/ATL/RuntimeSupport/RefiningTrace.km3 +++ b/dsls/ATL/RuntimeSupport/RefiningTrace.km3 @@ -45,6 +45,8 @@ package RefiningTrace { attribute value : String; } + class NullVal extends Value {} + class EnumLiteralVal extends Value { attribute value : String; } |