Skip to content

Commit

Permalink
Merge 338b04e
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Oct 5, 2023
2 parents 1642745 + 338b04e commit 6076263
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/FAST-Core-Model/FASTTBinaryExpression.trait.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"
A trait representing a binary expression of a node of a source code.
"
Trait {
#name : #FASTTBinaryExpression,
#traits : 'FASTTExpression',
#classTraits : 'FASTTExpression classTrait',
#category : #'FAST-Core-Model-Traits'
}

{ #category : #meta }
FASTTBinaryExpression classSide >> annotation [

<FMClass: #TBinaryExpression super: #Object>
<package: #'FAST-Core-Model'>
<generated>
^ self
]
18 changes: 18 additions & 0 deletions src/FAST-Core-Model/FASTTUnaryExpression.trait.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"
A trait representing an unary expression of a node of a source code.
"
Trait {
#name : #FASTTUnaryExpression,
#traits : 'FASTTExpression',
#classTraits : 'FASTTExpression classTrait',
#category : #'FAST-Core-Model-Traits'
}

{ #category : #meta }
FASTTUnaryExpression classSide >> annotation [

<FMClass: #TUnaryExpression super: #Object>
<package: #'FAST-Core-Model'>
<generated>
^ self
]
18 changes: 17 additions & 1 deletion src/FAST-Model-Generator/FASTMetamodelGenerator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Class {
'tAssignment',
'tVariableEntity',
'tComment',
'tWithComments'
'tWithComments',
'tBinaryExpression',
'tUnaryExpression'
],
#category : #'FAST-Model-Generator'
}
Expand Down Expand Up @@ -68,6 +70,11 @@ Has parameters , and a body (StatementBlock).
Local variables are intended to be stored in the local entities of the body'
]

{ #category : #comments }
FASTMetamodelGenerator >> commentForTBinaryExpression [
^ 'A trait representing a binary expression of a node of a source code.'
]

{ #category : #comments }
FASTMetamodelGenerator >> commentForTBooleanLiteral [
^ 'A boolean literal'
Expand Down Expand Up @@ -163,6 +170,11 @@ FASTMetamodelGenerator >> commentForTStringLiteral [
^ 'A string literal'
]

{ #category : #comments }
FASTMetamodelGenerator >> commentForTUnaryExpression [
^ 'A trait representing an unary expression of a node of a source code.'
]

{ #category : #comments }
FASTMetamodelGenerator >> commentForTVariableEntity [
^ 'A node for variable name not in a expression (example: assigned variable or parameter)'
Expand Down Expand Up @@ -193,6 +205,8 @@ FASTMetamodelGenerator >> defineHierarchy [
entity --|> tEntity.

tLiteral --|> tExpression.
tBinaryExpression --|> tExpression.
tUnaryExpression --|> tExpression.

tBooleanLiteral --|> tLiteral.
tCharacterLiteral --|> tLiteral.
Expand Down Expand Up @@ -278,6 +292,8 @@ FASTMetamodelGenerator >> defineTraits [
tEntity := builder newTraitNamed: #TEntity comment: 'any entity'.
tNamedEntity := builder newTraitNamed: #TNamedEntity comment: 'A entity with a name'.
tExpression := builder newTraitNamed: #TExpression comment: self commentForTExpression.
tBinaryExpression := builder newTraitNamed: #TBinaryExpression comment: self commentForTBinaryExpression.
tUnaryExpression := builder newTraitNamed: #TUnaryExpression comment: self commentForTUnaryExpression.
tLiteral := builder newTraitNamed: #TLiteral comment: self commentForTLiteral.
tBooleanLiteral := builder newTraitNamed: #TBooleanLiteral comment: self commentForTBooleanLiteral.
tCharacterLiteral := builder newTraitNamed: #TCharacterLiteral comment: self commentForTCharacterLiteral.
Expand Down

0 comments on commit 6076263

Please sign in to comment.