Skip to content

Commit

Permalink
Merge pull request #57 from MontiCore/rumpe-patch-1-1
Browse files Browse the repository at this point in the history
Update StreamExpressions.mc4: Editorial changes
  • Loading branch information
luepges authored Nov 19, 2024
2 parents 639c98f + 69e28f7 commit 3f58553
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ import de.monticore.expressions.ExpressionsBasis;
/**
* This grammar extends the available expressions with
* special operations for streams as initially defined by
* Broy/Stoelen in [BS01] using the syntax from
* Broy/Stoelen in [BS01] using the syntax style and
* function libraries from
* Ringert/Rumpe [RR11] and
* Buerger, Kausch, Raco, Ringert, Rumpe, Stueber, Wiartalla [BKR+20]
* (see https://www.se-rwth.de/publications/)
*
* Stream expressions are partly
* 1) extending the Expression syntax by grammatical operations (see below),
* 1) extending the MontiCore Expression syntax by new grammar
* constructs (see below),
* 2) are provided as library of available Stream operations, and
* 3) are based on the type constructors Stream<T>, EventStream<T>, SyncStream<T>,
* ToptStream<T> (defined in Types)
* 3) are based on the type constructors
* Stream<T>, EventStream<T>, SyncStream<T>,
* ToptStream<T> (defined in Types)
*
* The language developer may choose the subset of expressions
* of interest and combine these with the appropriate typing infrastructure
Expand Down Expand Up @@ -47,7 +50,8 @@ component grammar StreamExpressions extends CommonExpressions {
* the scanner recognizing timing keywords as names
*/
StreamConstructorExpression implements Expression <360> =
({noSpace(2)}? timing:[key("Event") | key("Sync") | key("Topt") | key("Untimed")])?
({noSpace(2)}?
timing:[key("Event") | key("Sync") | key("Topt") | key("Untimed")])?
"<" (Expression || ",")* ">";

/*
Expand All @@ -63,7 +67,7 @@ component grammar StreamExpressions extends CommonExpressions {
left:Expression operator:":" right:Expression;

/*
* Concatenation of streams
* Concatenation of two streams
* a^^b^^c is equal to a^^(b^^c), hence <rightassoc>
* (even so it is semantically associative)
*/
Expand All @@ -72,7 +76,7 @@ component grammar StreamExpressions extends CommonExpressions {
left:Expression operator:"^^" right:Expression;

/*
* Length of stream
* Length of a stream
*/
LengthStreamExpression implements Expression <185>
= "#" Expression;
Expand Down

0 comments on commit 3f58553

Please sign in to comment.