Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ice 2 Slice translator #1576

Merged
merged 7 commits into from
Dec 15, 2023
Merged

Add Ice 2 Slice translator #1576

merged 7 commits into from
Dec 15, 2023

Conversation

pepone
Copy link
Member

@pepone pepone commented Dec 5, 2023

This PR adds an ice2slice translator, that allows to convert Ice .ice files to IceRPC .slice files.

There are still a few things to do, especially to deal with things that don't have equivalent in .slice files.

cpp/src/ice2slice/Main.cpp Outdated Show resolved Hide resolved
cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
return os.str();
}

string typeToCsString(const TypePtr& type, bool optional)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear why we need this in ice2slice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To map cs::generic metadata to cs::type

@pepone pepone changed the base branch from 3.7 to main December 7, 2023 16:54
@pepone pepone marked this pull request as ready for review December 7, 2023 16:54
Copy link
Member

@externl externl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
Copy link
Member

@InsertCreativityHere InsertCreativityHere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

OperationPtr operation = OperationPtr::dynamicCast(contained);
if (operation)
{
std::map<std::string, StringList> parameterDocs = comment->parameters();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also handle the 'returns', 'exceptions' (now @throws) and 'seealso' tags?

cpp/src/ice2slice/Gen.cpp Outdated Show resolved Hide resolved
for (ParamDeclList::const_iterator it = parameters.begin(); it != parameters.end(); it++)
{
ParamDeclPtr param = *it;
if (!param->isOutParam())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also map @param to @returns?
Slice lets you do:

@returns foo: something
@returns bar: i don't know

The same syntax as @param in the case where your return elements have names.

@pepone
Copy link
Member Author

pepone commented Dec 15, 2023

I will deal with the doc comments in a follow-up PR.

@pepone pepone merged commit 0c38478 into zeroc-ice:main Dec 15, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants