Skip to content

Commit

Permalink
feat(anno): add ddsservice, ddsrequesttopic ddsreplytopic
Browse files Browse the repository at this point in the history
Signed-off-by: loongtao.zhang <[email protected]>
  • Loading branch information
cathaysia committed Aug 8, 2024
1 parent 8e24e53 commit e2fa5d2
Show file tree
Hide file tree
Showing 8 changed files with 34,451 additions and 29,769 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ DDS-RPC v1.0:

- [x] 7.3.1 Service Definition in IDL
- [x] 7.5.1.2.1 Annotations for the Enhanced Service Mapping
- [x] 7.4.2.2 Specifying Topic Names using Annotations

## extends

Expand Down Expand Up @@ -106,3 +107,13 @@ bitmask A {
// ^ allow
};
```

### allow ignore 'name='

```idl
@DDSRequestTopic("RobotRequestTopic")
// ^ allow ignore `name=`
interface RobotControl {
void command(Command com);
};
```
20 changes: 20 additions & 0 deletions common/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ exports.rules = {
$.annotation_appl_topic,
$.annotation_appl_choice,
$.annotation_appl_empty,
$.annotation_appl_dds_service,
$.annotation_appl_dds_reply_topic,
$.annotation_appl_dds_request_topic,
),

// IDL 4.2 8.3 Standardized Groups of Annotations
Expand Down Expand Up @@ -207,6 +210,23 @@ exports.rules = {
topic_platform: $ => choice(/DDS/i, '*'),
annotation_appl_choice: _ => /Choice/i, // RPC v1.0
annotation_appl_empty: _ => /Empty/i, // RPC v1.0
annotation_appl_dds_service: _ => /DDSService/i, // RPC v1.0
annotation_appl_dds_request_topic: $ =>
create_anno(
$,
/DDSRequestTopic/i,
false,
optional(seq(alias(/name/i, $.arg_key), '=')),
$.const_expr,
),
annotation_appl_dds_reply_topic: $ =>
create_anno(
$,
/DDSReplyTopic/i,
false,
optional(seq(alias(/name/i, $.arg_key), '=')),
$.const_expr,
),
}

function create_anno($, name, is_optional, ...args) {
Expand Down
133 changes: 133 additions & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e2fa5d2

Please sign in to comment.