Skip to content

Commit

Permalink
Support recursive typedef and constant usage (#60)
Browse files Browse the repository at this point in the history
Refactor away from iterative IDLNodeProcessor to IDL node classes that
resolve when writing out to `IDLMessageDefinition`. This allows for more
clear types before/after resolving of constants and typedefs. Hoping
this also makes it more clear how we resolve certain fields on
end-types.

- All AST types dubbed with ASTNode type
- added output union type and `aggregatedKind` in anticipation of union
type support (not used yet)
- update ros2idl to convert to messagedefinitions since the test cases
are there
- `Idl` -> `IDL` and `Ast` -> `AST`

Terms:

`ASTNode`'s - the direct output of the grammar parser `parseIDLToAST`.
This is unresolved in that primitive types reference other types or
constants. These are only to be used internally.

`IDLNode`'s - This is a collection of classes that wrap ASTNodes in
order to facilitate resolving those types to IDLMessageDefinitions. Uses
a map of global scoped identifiers to other IDLNodes to resolve the
`ASTNode`s.

`IDLMessageDefinition` - The final, resolved, ready-for-serde types.
These are exposed via the API.


FG-4327
  • Loading branch information
snosenzo authored Aug 30, 2023
1 parent f9c6c90 commit 80a951f
Show file tree
Hide file tree
Showing 29 changed files with 1,231 additions and 719 deletions.
2 changes: 1 addition & 1 deletion packages/omgidl-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Output definitions can be passed to serializers along with a specified root sche

## API

`parseIdl` - parses raw `.idl` schema string to resolved, flattened definitions.
`parseIDL` - parses raw `.idl` schema string to resolved, flattened definitions.

## OMG IDL Subset Support

Expand Down
Loading

0 comments on commit 80a951f

Please sign in to comment.