Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pseuco
pseuco-ccs-compiler
Commits
75ea2d79
Commit
75ea2d79
authored
Jun 09, 2020
by
Sebastian Biewer
Browse files
Fixed bug, thanks to Lena
parent
ecdc74ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
75ea2d79
# Change Log for PseuCo to CCS Compiler
##0.8.10 - 2020-06-09
### Fixed
-
Send expressions with unbuffered channels could not be used as RHS expression of assignments. The container holding the sent value was not protected during transition to the followup process.
##0.8.9 - 2019-05-31
### Fixed
...
...
src/PCCCompiler.coffee
View file @
75ea2d79
...
...
@@ -133,7 +133,18 @@ class PCCCompiler # ToDo: Allow assigning a recently used program controller (
sysDefs
.
push
(
def
)
procDefs
[
0
].
insertLinesBefore
=
1
if
procDefs
.
length
>
0
and
sysDefs
.
length
>
0
mainAgentDefs
[
0
].
insertLinesBefore
=
1
if
mainAgentDefs
.
length
>
0
and
(
procDefs
.
length
>
0
or
sysDefs
.
length
>
0
)
new
CCS
.
CCS
(
sysDefs
.
concat
(
procDefs
).
concat
(
mainAgentDefs
),
@
_getSystem
())
allPdefs
=
sysDefs
.
concat
(
procDefs
).
concat
(
mainAgentDefs
)
system
=
@
_getSystem
()
#@__dumpUncheckedCCS(allPdefs, system)
new
CCS
.
CCS
(
allPdefs
,
system
)
__dumpUncheckedCCS
:
(
pdefs
,
system
)
->
console
.
log
(
'Dumping unchecked CCS.'
)
res
=
''
(
res
+=
pd
.
toString
()
+
"
\n
"
)
for
pd
in
pdefs
res
+=
"
\n
#{
system
.
toString
()
}
"
console
.
log
(
res
)
res
__assertEmptyGroupStack
:
->
if
@
groupElements
.
length
>
0
...
...
src/PseuCo+Compiler.coffee
View file @
75ea2d79
...
...
@@ -154,7 +154,7 @@ PC.StartExpression::compile = (compiler) ->
PC
.
AssignExpression
::
compile
=
(
compiler
)
->
c
=
compiler
.
compile
(
@
getExpression
())
c
=
compiler
.
compile
(
@
getExpression
())
if
@
operator
==
"+="
c
=
new
PCCBinaryContainer
(
compiler
.
compile
(
@
getDestination
()),
c
,
"+"
)
else
if
@
operator
==
"-="
...
...
@@ -221,6 +221,7 @@ PC.SendExpression::compile = (compiler) ->
c
=
compiler
.
compile
(
@
children
[
0
])
v
=
compiler
.
compile
(
@
children
[
1
])
if
@
children
[
0
].
getType
(
compiler
).
capacity
<=
0
compiler
.
protectContainer
(
v
)
control
=
compiler
.
emitChoice
()
compiler
.
emitCondition
(
new
PCCBinaryContainer
(
c
,
new
PCCConstantContainer
(
0
),
">="
))
compiler
.
emitOutput
(
"put"
,
c
,
v
)
# Buffered
...
...
@@ -231,6 +232,7 @@ PC.SendExpression::compile = (compiler) ->
p2
=
compiler
.
emitProcessApplicationPlaceholder
()
control
.
setBranchFinished
()
compiler
.
emitMergeOfProcessFramesOfPlaceholders
([
p1
,
p2
])
v
=
compiler
.
unprotectContainer
()
else
compiler
.
emitOutput
(
"put"
,
c
,
v
)
# Buffered
v
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment