All files / src/abap/2_statements/statements communication.ts

100% Statements 36/36
100% Branches 1/1
100% Functions 1/1
100% Lines 36/36

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 361x 1x 1x 1x 1x 1x 1x 1x 1x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 1x 1x
import {IStatement} from "./_statement";
import {verNot, seq, alt, opt} from "../combi";
import {Target, Source} from "../expressions";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
 
export class Communication implements IStatement {
 
  public getMatcher(): IStatementRunnable {
    const length = seq("LENGTH", Target);
 
    const init = seq("INIT ID", Source, "DESTINATION", Target);
    const allocate = seq("ALLOCATE ID", Source);
    const send = seq("SEND ID", Source, "BUFFER", Target, opt(length));
    const deallocate = seq("DEALLOCATE ID", Source);
    const accept = seq("ACCEPT ID", Source);
 
    const receive = seq("RECEIVE ID",
                        Source,
                        "BUFFER",
                        Source,
                        opt(length),
                        "DATAINFO",
                        Target,
                        "STATUSINFO",
                        Target,
                        "RECEIVED",
                        Target);
 
    const ret = seq("COMMUNICATION",
                    alt(init, allocate, send, deallocate, receive, accept));
 
    return verNot(Version.Cloud, ret);
  }
 
}