Skip to content

Commit 8aeeccb

Browse files
committed
Introduce TCanBeVariable
This can be useful to implement a name resolution or a SSA
1 parent aa283b0 commit 8aeeccb

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"
2+
Represent everything that can be a variable. Useful for the LocalResolver and the SSA builder.
3+
4+
5+
"
6+
Trait {
7+
#name : 'FASTTCanBeVariable',
8+
#category : 'FAST-Core-Model-Traits',
9+
#package : 'FAST-Core-Model',
10+
#tag : 'Traits'
11+
}
12+
13+
{ #category : 'meta' }
14+
FASTTCanBeVariable classSide >> annotation [
15+
16+
<ignoreForCoverage>
17+
<FMClass: #TCanBeVariable super: #Object>
18+
<package: #'FAST-Core-Model'>
19+
<generated>
20+
]
21+
22+
{ #category : 'testing' }
23+
FASTTCanBeVariable >> canBeVariable [
24+
25+
<ignoreForCoverage>
26+
<generated>
27+
^ true
28+
]

‎src/FAST-Model-Generator/FASTMetamodelGenerator.class.st‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Class {
3939
'tWithStatements',
4040
'tWithCondition',
4141
'tBreakStatement',
42-
'tContinueStatement'
42+
'tContinueStatement',
43+
'tCanBeVariable'
4344
],
4445
#category : 'FAST-Model-Generator',
4546
#package : 'FAST-Model-Generator'
@@ -348,6 +349,8 @@ FASTMetamodelGenerator >> defineTraits [
348349
tBooleanLiteral withTesting.
349350
tBreakStatement := builder newTraitNamed: #TBreakStatement comment: self commentForTBreakStatement.
350351
tBreakStatement withTesting.
352+
tCanBeVariable := (builder newTraitNamed: #TCanBeVariable) comment: 'Represent everything that can be a variable. Useful for the LocalResolver and the SSA builder.'.
353+
tCanBeVariable testingSelector: #canBeVariable.
351354
tCharacterLiteral := builder newTraitNamed: #TCharacterLiteral comment: self commentForTCharacterLiteral.
352355
tCharacterLiteral withTesting.
353356
tComment := builder newTraitNamed: #TComment.

0 commit comments

Comments
 (0)