Skip to content

Commit

Permalink
Extended/revised cstl scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlano authored Feb 18, 2025
1 parent fb7101e commit db57b4c
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 32 deletions.
16 changes: 14 additions & 2 deletions cg/cgJava2UML.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Entry |-->Map
Pair |-->Map
Triple |-->Map
LinkedHashMap |-->Map
NavigableMap |-->Map
ConcurrentNavigableMap |-->Map

Vector |-->Sequence
ArrayList |-->Sequence
Expand Down Expand Up @@ -280,6 +282,8 @@ EnumMap _1 |-->Map_1`collectionParameters
Pair _1 |-->Map(String,OclAny)
Triple _1 |-->Map(String,OclAny)
LinkedHashMap _1 |-->Map_1`collectionParameters
NavigableMap _1 |-->Map_1`collectionParameters
ConcurrentNavigableMap _1 |-->Map_1`collectionParameters

ArrayList _1 |-->Sequence_1`collectionParameters
List _1 |-->Sequence_1`collectionParameters
Expand Down Expand Up @@ -966,8 +970,8 @@ getLong ( _1 ) |-->->at(_1)->toLong()
isNull ( _1 ) |-->->at(_1)->oclIsUndefined()
contains ( _1 ) |-->->values()->includes(_1)
containsAll ( _1 ) |-->->includesAll(_1)
containsKey ( _1 ) |-->->keys()->includes(_1)
containsValue ( _1 ) |-->->values()->includes(_1)
containsKey ( _1 ) |-->->includesKey(_1)
containsValue ( _1 ) |-->->includesValue(_1)
isEmpty ( ) |-->->isEmpty()
clear ( ) |-->
clone ( ) |-->->union(Map{})
Expand Down Expand Up @@ -3630,6 +3634,8 @@ ImmutableMap _1 |-->Map{}_1`collectionCreationRest
JsonObject _1 |-->Map{}_1`collectionCreationRest
JSONObject _1 |-->Map{}_1`collectionCreationRest
LinkedHashMap _1 |-->Map{}_1`collectionCreationRest
NavigableMap _1 |-->Map{}_1`collectionCreationRest
ConcurrentNavigableMap _1 |-->Map{}_1`collectionCreationRest

PrintStream _1 |-->_1`newTextWriter
FileInputStream _1 |-->_1`newTextReader
Expand Down Expand Up @@ -3720,6 +3726,8 @@ HashMap _1 |-->true
TreeMap _1 |-->true
EnumMap _1 |-->true
LinkedHashMap _1 |-->true
NavigableMap _1 |-->true
ConcurrentNavigableMap _1 |-->true

_1 _2 |-->false
_1 |-->false
Expand Down Expand Up @@ -3819,6 +3827,8 @@ Entry |-->Map
Pair |-->Map
Triple |-->Map
LinkedHashMap |-->Map
NavigableMap |-->Map
ConcurrentNavigableMap |-->Map

Vector |-->Sequence
ArrayList |-->Sequence
Expand Down Expand Up @@ -4029,6 +4039,8 @@ Pair _1 |-->Map{}
Triple _1 |-->Map{}
EnumMap _1 |-->Map{}
LinkedHashMap _1 |-->Map{}
NavigableMap _1 |-->Map{}
ConcurrentNavigableMap _1 |-->Map{}

ArrayList _1 |-->Sequence{}
List _1 |-->Sequence{}
Expand Down
6 changes: 6 additions & 0 deletions cg/cgJava8.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,14 @@ _1->excludes(_2) |-->!(_1.containsKey(_2))<when> _1 Map
_1->excludes(_2) |-->!(_1.contains(_2))
_1->excludesAll(_2) |-->Collections.disjoint(_1,_2)

_1->includesKey(_2) |-->_1.containsKey(_2)
_1->includesValue(_2) |-->_1.containsValue(_2)
_1->excludesKey(_2) |-->!(_1.containsKey(_2))
_1->excludesValue(_2) |-->!(_1.containsValue(_2))

_1->including(_2) |-->Ocl.includingSet(_1,_2)<when> _1 Set
_1->including(_2) |-->Ocl.includingSequence(_1,_2)<when> _1 Sequence

_1->prepend(_2) |-->Ocl.prepend(_1,_2)
_1->append(_2) |-->Ocl.append(_1,_2)
_1->excluding(_2) |-->Ocl.excludingSet(_1,_2)<when> _1 Set
Expand Down
65 changes: 35 additions & 30 deletions cg/cobol2UML.cstl
Original file line number Diff line number Diff line change
Expand Up @@ -1704,18 +1704,23 @@ statement::
_1 |-->_1


acceptSystemIn::
_1 |-->_1 := StringLib.padRightWithInto((OclFile["System.in"]).readLine(), " ", _1`fieldWidth)



acceptStatement::
ACCEPT _1 _2 _3 END-ACCEPT |--> try (_1 := (OclFile["System.in"]).readLine() ; _3 skip) catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause, _3 notOnExceptionClause
ACCEPT _1 _2 _3 |--> try (_1 := (OclFile["System.in"]).readLine() ; _3 skip) catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause, _3 notOnExceptionClause
ACCEPT _1 _2 _3 END-ACCEPT |--> try (_1`acceptSystemIn ; _3 skip) catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause, _3 notOnExceptionClause
ACCEPT _1 _2 _3 |--> try (_1`acceptSystemIn ; _3 skip) catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause, _3 notOnExceptionClause

ACCEPT _1 _2 END-ACCEPT |--> try _1 := (OclFile["System.in"]).readLine() catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause
ACCEPT _1 _2 |--> try _1 := (OclFile["System.in"]).readLine() catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause
ACCEPT _1 _2 END-ACCEPT |--> try _1`acceptSystemIn catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause
ACCEPT _1 _2 |--> try _1`acceptSystemIn catch (_ex : IOException) do (_2 skip) ;\n<when> _2 onExceptionClause

ACCEPT _1 _2 END-ACCEPT |--> try (_1 := (OclFile["System.in"]).readLine() ; _2 skip) catch (_ex : IOException) do skip ;\n<when> _2 notOnExceptionClause
ACCEPT _1 _2 |--> try (_1 := (OclFile["System.in"]).readLine() ; _2 skip) catch (_ex : IOException) do skip ;\n<when> _2 notOnExceptionClause
ACCEPT _1 _2 END-ACCEPT |--> try (_1`acceptSystemIn ; _2 skip) catch (_ex : IOException) do skip ;\n<when> _2 notOnExceptionClause
ACCEPT _1 _2 |--> try (_1`acceptSystemIn ; _2 skip) catch (_ex : IOException) do skip ;\n<when> _2 notOnExceptionClause

ACCEPT _1 END-ACCEPT |--> _1 := (OclFile["System.in"]).readLine() ;\n
ACCEPT _1 |--> _1 := (OclFile["System.in"]).readLine() ;\n
ACCEPT _1 END-ACCEPT |--> _1`acceptSystemIn ;\n
ACCEPT _1 |--> _1`acceptSystemIn ;\n

ACCEPT _1 _2 _3 _4 END-ACCEPT |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement, _3 onExceptionClause, _4 notOnExceptionClause
ACCEPT _1 _2 _3 _4 |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement, _3 onExceptionClause, _4 notOnExceptionClause
Expand All @@ -1724,22 +1729,22 @@ ACCEPT _1 _2 _3 END-ACCEPT |--> (var _dte : OclDate ; _dte := OclDate.newOcl
ACCEPT _1 _2 _3 |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement, _3 onExceptionClause

ACCEPT _1 _2 _3 END-ACCEPT |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement, _3 notOnExceptionClause
ACCEPT _1 _2 _3 |-->(var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement, _3 notOnExceptionClause
ACCEPT _1 _2 _3 |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement, _3 notOnExceptionClause

ACCEPT _1 _2 END-ACCEPT |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement
ACCEPT _1 _2 |--> (var _dte : OclDate ; _dte := OclDate.newOclDate() ; _1 := _2 ) ;\n<when> _2 acceptFromDateStatement

ACCEPT _1 _2 _3 _4 END-ACCEPT |--> _1 := (OclFile["_2"]).readLine() ;\n<when>_3 onExceptionClause, _4 notOnExceptionClause
ACCEPT _1 _2 _3 _4 |--> _1 := (OclFile["_2"]).readLine() ;\n<when>_3 onExceptionClause, _4 notOnExceptionClause
ACCEPT _1 _2 _3 _4 END-ACCEPT |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n<when>_3 onExceptionClause, _4 notOnExceptionClause
ACCEPT _1 _2 _3 _4 |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n<when>_3 onExceptionClause, _4 notOnExceptionClause

ACCEPT _1 _2 _3 END-ACCEPT |--> _1 := (OclFile["_2"]).readLine() ;\n<when>_3 onExceptionClause
ACCEPT _1 _2 _3 |--> _1 := (OclFile["_2"]).readLine() ;\n<when>_3 onExceptionClause
ACCEPT _1 _2 _3 END-ACCEPT |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n<when>_3 onExceptionClause
ACCEPT _1 _2 _3 |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n<when>_3 onExceptionClause

ACCEPT _1 _2 _3 END-ACCEPT |--> _1 := (OclFile["_2"]).readLine() ;\n<when>_3 notOnExceptionClause
ACCEPT _1 _2 _3 |--> _1 := (OclFile["_2"]).readLine() ;\n<when>_3 notOnExceptionClause
ACCEPT _1 _2 _3 END-ACCEPT |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n<when>_3 notOnExceptionClause
ACCEPT _1 _2 _3 |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n<when>_3 notOnExceptionClause

ACCEPT _1 _2 END-ACCEPT |--> _1 := (OclFile["_2"]).readLine() ;\n
ACCEPT _1 _2 |--> _1 := (OclFile["_2"]).readLine() ;\n
ACCEPT _1 _2 END-ACCEPT |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n
ACCEPT _1 _2 |--> _1 := StringLib.padRightWithInto((OclFile["_2"]).readLine(), " ", _1`fieldWidth) ;\n

ACCEPT _2 _3 _4 _5 END-ACCEPT |--> <when> _3 acceptMessageCountStatement, _4 onExceptionClause, _5 notOnExceptionClause
ACCEPT _2 _3 _4 _5 |--> <when> _3 acceptMessageCountStatement, _4 onExceptionClause, _5 notOnExceptionClause
Expand All @@ -1752,19 +1757,19 @@ ACCEPT _2 _3 |--> <when> _3 acceptMessageCountStatement


acceptFromDateStatement::
FROM DATE YYYYMMDD |-->_dte.getYear() + "" + _dte.getMonth() + "" + _dte.getDate()
FROM DATE |-->(_dte.getYear() mod 100) + "" + _dte.getMonth() + "" + _dte.getDate()
FROM DAY YYYYDDD |-->
FROM DAY |-->
FROM DAY OF WEEK |-->
FROM TIME |-->OclDate.getSystemTime()
FROM TIMER |-->
FROM TODAYS DATE MMDDYYYY |-->_dte.getMonth() + "" + _dte.getDate() + "" + _dte.getYear()
FROM TODAYS DATE |-->
FROM TODAYS NAME |-->
FROM YEAR |-->"" + _dte.getYear()
FROM YYYYMMDD |-->_dte.getYear() + "" + _dte.getMonth() + "" + _dte.getDate()
FROM YYYYDDD |-->
FROM DATE YYYYMMDD |-->(_dte.getYear() + "" + _dte.getMonth() + "" + _dte.getDate())
FROM DATE |-->((_dte.getYear() mod 100) + "" + _dte.getMonth() + "" + _dte.getDate())
FROM DAY YYYYDDD |-->_dte.getYearDays()
FROM DAY |-->_dte.getYearDays().subrange(3,7)
FROM DAY OF WEEK |-->_dte.getDay()
FROM TIME |-->(_dte.getHour() + "" + _dte.getMinute() + "" + _dte.getSecond() + "" + (_dte.getMicrosecond()/10000))
FROM TIMER |-->("" + ((OclDate.getSystemTime() mod 86400000)/2.4)*1000)->toLong()
FROM TODAYS DATE MMDDYYYY |-->(_dte.getMonth() + "" + _dte.getDate() + "" + _dte.getYear())
FROM TODAYS DATE |-->(_dte.getMonth() + "" + _dte.getDate() + "" + (_dte.getYear() mod 100))
FROM TODAYS NAME |-->_dte.getDayName()
FROM YEAR |-->("" + _dte.getYear())
FROM YYYYMMDD |-->(_dte.getYear() + "" + _dte.getMonth() + "" + _dte.getDate())
FROM YYYYDDD |-->_dte.getYearDays()


acceptFromMnemonicStatement::
Expand Down

0 comments on commit db57b4c

Please sign in to comment.