moosetechnology / FAST-Fortran

MIT License
0 stars 1 forks source link

Adding DataStatementConstant entity #214

Open lsafina opened 6 months ago

lsafina commented 6 months ago

Currently FASTFortranDataGroup is designed to have dataConstants as a list of FASTFortranTExpression which covers the case when a data constant is a constant or the symbolic name of a constant.

However, there exist a case when a data constant is presented in the format r*c equivalent to r successive occurrences of the constant c.

At the moment there is no expression able to cover this case.

I propose to create DataStatementConstant -> FASTFortranTExpression with properties occurence and constant both of the type FASTFortranIntegerLiteral

lsafina commented 6 months ago

doc https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn85/index.html

NicolasAnquetil commented 6 months ago

I am not sure the constant need to be numerical To be checked, but it may need to be a TExpression itself ...

Another solution I see is to have a TDataStatementConstant and a RepeatedDataConstant (with occurence and constant): `st DataGroup <>-* TDataConstant RepeatedDataConstant --|> TDataConstant (RepeatedDataConstant property: occurence) - NumericalLiteral (RepeatedDataConstant property: constant) - TExpression Literal --|> TDataConstant ScalarVariable --|> TDataConstant

NicolasAnquetil commented 6 months ago

inviting @uNouss to the discussion

lsafina commented 6 months ago
DataGroup <>-* TDataConstant
RepeatedDataConstant --|> TDataConstant
(RepeatedDataConstant property: occurence) - TDataConstant
(RepeatedDataConstant property: constant) - TDataConstant
Literal --|> TDataConstant
ScalarVariable --|> TDataConstant