Skip to content

Commit

Permalink
corrected abstractors
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlano authored Nov 24, 2024
1 parent afa9128 commit e9ab4aa
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 9 deletions.
9 changes: 8 additions & 1 deletion cg/VB2UML.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ MKDIR _1 |--> OclFile.mkdir(_1)

nameStmt::
NAME _1 AS _2 |--> OclFile.renameFile(_1,_2)
Name _1 As _2 |--> OclFile.renameFile(_1,_2)

randomizeStmt::
RANDOMIZE |--> MathLib.setSeeds((OclDate.getSystemTime() mod 30269), (OclDate.getSystemTime() mod 30307), (OclDate.getSystemTime() mod 30323))
Expand Down Expand Up @@ -314,6 +315,7 @@ SENDKEYS _* |-->

variableStmt::
DIM _1 |-->_1
Dim _1 |-->_1
PUBLIC _1 |-->_1
PRIVATE _1 |-->_1
GLOBAL _1 |-->_1`variableListInitialisation
Expand Down Expand Up @@ -908,7 +910,7 @@ FileLen ( _1 ) |-->(OclFile.newOclFile(_1)).length()
LOF ( _1 ) |-->(OclFile.newOclFile(_1)).length()
EOF ( _1 ) |-->(_1.getEof() = true)
InputBox ( _1 ) |-->(OclFile["System.in"]).readLine()
MsgBox ( _1 ) |-->(OclFile["System.in"]).readLine()
MsgBox ( _1 ) |-->("" + _1)->display()
GetAttr ( _1 ) |-->Sequence{ (if (OclFile.newOclFile(_1)).canWrite() then 0 else 1 endif), (if (OclFile.newOclFile(_1)).isHidden() then 2 else 0 endif), (if (OclFile.newOclFile(_1)).isDirectory() then 16 else 0 endif) }->sum()
GetObject ( _1 ) |-->(OclFile.newOclFile_Read(OclFile.newOclFile(_1))).readObject()
Input ( _1 ) |-->_1`last.readN(_1`first)->sum()
Expand Down Expand Up @@ -1373,6 +1375,11 @@ _1 FUNCTION _* |--> skip;
STATIC FUNCTION _* |--> skip;
_1 STATIC FUNCTION _* |--> skip;

Function _* |--> skip;
_1 Function _* |--> skip;
Static Function _* |--> skip;
_1 Static Function _* |--> skip;


forEachStmt::
FOR EACH _1 IN _2 \r\n _* NEXT |--> for _1 : _2 do\n (_*`blocks skip\n )
Expand Down
31 changes: 23 additions & 8 deletions cg/cgJava2UML.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -1222,8 +1222,8 @@ _1 ? _2 : _3 |-->if _1`queryForm then _2`queryForm else _3`queryForm endif
( short ) _1 |-->(_1`queryForm)->char2byte()<when> _1 String
( long ) _1 |-->(_1`queryForm)->char2byte()<when> _1 String

( byte ) _1 |-->(_1 mod 128)
( short ) _1 |-->(_1 mod 32768)
( byte ) _1 |-->(_1`queryForm mod 128)
( short ) _1 |-->(_1`queryForm mod 32768)

( _1 ) _2 |-->_2`queryForm->oclAsType(_1)

Expand Down Expand Up @@ -1287,6 +1287,12 @@ _1 . new _2 |-->_1`queryForm._2

{ _1 } |-->Sequence{_1}

{ _1, _2 } |-->Sequence{_1,_2}
{ _1, _2, _3 } |-->Sequence{_1,_2,_3}
{ _1, _2, _3, _4 } |-->Sequence{_1,_2,_3,_4}
{ _1, _2, _3, _4, _5 } |-->Sequence{_1,_2,_3,_4,_5}
{ _1, _2, _3, _4, _5, _6 } |-->Sequence{_1,_2,_3,_4,_5,_6}

{ _1, _* } |-->Sequence{_1,_*}

{ } |-->Sequence{}
Expand Down Expand Up @@ -1472,9 +1478,10 @@ _1 ( ) |-->_1()
_1 ( _2 ) |-->_1(_2)

_1 |-->_1`queryForm<when> _1 multiple
_1 |-->_1`queryForm<when> _1 arrayInitializer
_1 |-->_1`queryForm<when> _1 expression

_1 |-->_1

_0 |-->_0


enumsetMethodCall::
Expand Down Expand Up @@ -2490,9 +2497,10 @@ _1 ( ) |-->
_1 ( _2 ) |-->_2`expressionListPreSideEffect

_1 |-->_1`preSideEffect<when> _1 multiple

_1 |-->_1`preSideEffect<when> _1 arrayInitializer

_1 |-->
_* |-->


postSideEffect::
Expand Down Expand Up @@ -2592,6 +2600,7 @@ _1 *= _2 |--> _1 := _1 * (_2`queryForm) ; _2`sideEffect<when> _2 updatesObjec
_1 *= _2 |--> _2`preSideEffect _1 := _1 * (_2`queryForm) _2`postSideEffect<when> _2 hasSideEffect
_1 *= _2 |--> _1 := _1*(_2)

( _1 ) |-->_1`updateForm

_1 /= _2 |--> _1 := _1/(_2)
_1 &= _2 |--> _1 := MathLib.bitwiseAnd(_1, _2)
Expand All @@ -2602,6 +2611,12 @@ _1 <<= _2 |--> _1 := _1*(2->pow(_2))
_1 >>= _2 |--> _1 := _1/(2->pow(_2))
_1 >>>= _2 |--> _1 := _1/(2->pow(_2))

_1 < _2 |--> _1`updateForm ; _2`updateForm
_1 > _2 |--> _1`updateForm ; _2`updateForm
_1 <= _2 |--> _1`updateForm ; _2`updateForm
_1 >= _2 |--> _1`updateForm ; _2`updateForm
_1 == _2 |--> _1`updateForm ; _2`updateForm


Collections . _1 |-->_1`collectionsMethodCall
Arrays . _1 |-->_1`arraysMethodCall
Expand Down Expand Up @@ -2631,8 +2646,8 @@ _1 . _2 |-->_1`preSideEffect_2`preSideEffect _1`queryForm_2<when> _2 methodCa

_1 . _2 |-->_1`preSideEffect_2`preSideEffect _1`queryForm._2

_1 |--> _1

_1 |--> skip
_* |--> skip


updatedObject::
Expand Down Expand Up @@ -3314,7 +3329,7 @@ synchronized _1 _2 |-->_2
_1 : _2 |-->_2
_1 : _2 ; |-->_2

while _1 _2 |--> while _1 do _2 ;
while _1 _2 |--> while _1 do (_1`updateForm ; _2 ) ;

if _1 _2 else _3 |--> if _1 then _2 else _3 ;

Expand Down
5 changes: 5 additions & 0 deletions cg/vbDeclarations.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ defaultValue::
AS _1 |-->_1`defaultValue
AS NEW _1 |-->_1.new_1()
AS _1 _2 |-->_1`defaultValue

As _1 |-->_1`defaultValue
As New _1 |-->_1.new_1()
As _1 _2 |-->_1`defaultValue

DATE |-->null
Date |-->null
% |-->0
Expand Down
27 changes: 27 additions & 0 deletions cg/vbFunctions.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,28 @@ _1 |-->_1
functionStmt::
FUNCTION _1 _2 \r\n \r\n _3 _* END FUNCTION |-->operation _1`VB2UML_2`VB2UML : OclAny\n pre: true post: true\n activity: var _1 : OclAny;\n_3`VB2UML\n return _1;\n\n

Function _1 _2 \r\n \r\n _3 _* End Function |-->operation _1`VB2UML_2`VB2UML : OclAny\n pre: true post: true\n activity: var _1 : OclAny;\n_3`VB2UML\n return _1;\n\n

FUNCTION _1 _2 \r\n _3 _* END FUNCTION |-->operation _1`VB2UML_2`VB2UML : OclAny\n pre: true post: true\n activity: var _1`VB2UML : OclAny;\n_3`VB2UML\n return _1;\n\n

Function _1 _2 \r\n _3 _* End Function |-->operation _1`VB2UML_2`VB2UML : OclAny\n pre: true post: true\n activity: var _1`VB2UML : OclAny;\n_3`VB2UML\n return _1;\n\n

FUNCTION _1 _2 _3 \r\n \r\n _4 _* END FUNCTION |-->operation _1_2`VB2UML _3`VB2UML\n pre: true post: true\n activity: var _1 _3`VB2UML;\n_4`VB2UML\n return _1;\n\n

Function _1 _2 _3 \r\n \r\n _4 _* End Function |-->operation _1_2`VB2UML _3`VB2UML\n pre: true post: true\n activity: var _1 _3`VB2UML;\n_4`VB2UML\n return _1;\n\n

FUNCTION _1 _2 _3 \r\n _4 _* END FUNCTION |-->operation _1_2`VB2UML _3`VB2UML\n pre: true post: true\n activity: var _1 _3`VB2UML;\n_4`VB2UML\n return _1;\n\n

Function _1 _2 _3 \r\n _4 _* End Function |-->operation _1_2`VB2UML _3`VB2UML\n pre: true post: true\n activity: var _1 _3`VB2UML;\n_4`VB2UML\n return _1;\n\n

_1 FUNCTION _2 _3 _4 \r\n \r\n _5 _* END FUNCTION |-->operation _2`VB2UML_3`VB2UML _4`VB2UML\n pre: true post: true\n activity: var _2 _4`VB2UML;\n_5`VB2UML\n return _2;\n\n

_1 Function _2 _3 _4 \r\n \r\n _5 _* End Function |-->operation _2`VB2UML_3`VB2UML _4`VB2UML\n pre: true post: true\n activity: var _2 _4`VB2UML;\n_5`VB2UML\n return _2;\n\n

_1 FUNCTION _2 _3 _4 \r\n _5 _* END FUNCTION |-->operation _2`VB2UML_3`VB2UML _4`VB2UML\n pre: true post: true\n activity: var _2 _4`VB2UML;\n_5`VB2UML\n return _2;\n\n

_1 Function _2 _3 _4 \r\n _5 _* End Function |-->operation _2`VB2UML_3`VB2UML _4`VB2UML\n pre: true post: true\n activity: var _2 _4`VB2UML;\n_5`VB2UML\n return _2;\n\n

STATIC FUNCTION _1 _2 _3 \r\n \r\n _4 _* END FUNCTION |-->static operation _1_2`VB2UML _3`VB2UML\n pre: true post: true\n activity: var _1 _3`VB2UML;\n_4`VB2UML\n return _1;\n\n

STATIC FUNCTION _1 _2 _3 \r\n _4 _* END FUNCTION |-->static operation _1_2`VB2UML _3`VB2UML\n pre: true post: true\n activity: var _1 _3`VB2UML;\n_4`VB2UML\n return _1;\n\n
Expand Down Expand Up @@ -307,12 +319,21 @@ subStmt::
SUB _1 \r\n \r\n _2 _* END SUB |--> operation _1()\n pre: true post: true\n activity: _2`VB2UML\n\n
SUB _1 _2 \r\n \r\n _3 _* END SUB |--> operation _1_2`VB2UML\n pre: true post: true\n activity: _3`VB2UML\n\n

Sub _1 \r\n \r\n _2 _* End Sub |--> operation _1()\n pre: true post: true\n activity: _2`VB2UML\n\n
Sub _1 _2 \r\n \r\n _3 _* End Sub |--> operation _1_2`VB2UML\n pre: true post: true\n activity: _3`VB2UML\n\n

SUB _1 \r\n _2 _* END SUB |--> operation _1()\n pre: true post: true\n activity: _2`VB2UML\n\n
SUB _1 _2 \r\n _3 _* END SUB |--> operation _1_2`VB2UML\n pre: true post: true\n activity: _3`VB2UML\n\n

Sub _1 \r\n _2 _* End Sub |--> operation _1()\n pre: true post: true\n activity: _2`VB2UML\n\n
Sub _1 _2 \r\n _3 _* End Sub |--> operation _1_2`VB2UML\n pre: true post: true\n activity: _3`VB2UML\n\n

SUB _1 \r\n END SUB |--> operation _1()\n pre: true post: true;\n\n
SUB _1 _2 \r\n END SUB |--> operation _1_2`VB2UML\n pre: true post: true;\n\n

Sub _1 \r\n End Sub |--> operation _1()\n pre: true post: true;\n\n
Sub _1 _2 \r\n End Sub |--> operation _1_2`VB2UML\n pre: true post: true;\n\n

STATIC SUB _1 \r\n \r\n _2 _* END SUB |-->static operation _1`VB2UML()\n pre: true post: true\n activity: _2`VB2UML\n\n
STATIC SUB _1 _2 \r\n \r\n _3 _* END SUB |-->static operation _1`VB2UML_2`VB2UML\n pre: true post: true\n activity: _3`VB2UML\n\n

Expand Down Expand Up @@ -422,12 +443,18 @@ $ |-->: Sequence(String)
AS _1 |-->: Sequence(_1)
AS NEW _1 |-->: Sequence(_1)
AS _1 _2 |-->: Sequence(_1)
As _1 |-->: Sequence(_1)
As New _1 |-->: Sequence(_1)
As _1 _2 |-->: Sequence(_1)


asTypeType::
AS _1 |-->_1`VB2UML
AS NEW _1 |-->_1`VB2UML
AS _1 _2 |-->_1`VB2UML
As _1 |-->_1`VB2UML
As New _1 |-->_1`VB2UML
As _1 _2 |-->_1`VB2UML

typeHintDec::
% |--> : int
Expand Down

0 comments on commit e9ab4aa

Please sign in to comment.