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

Finish the Identifier semantic action #123

Open
julianbraha opened this issue Nov 6, 2020 · 5 comments
Open

Finish the Identifier semantic action #123

julianbraha opened this issue Nov 6, 2020 · 5 comments
Assignees

Comments

@julianbraha
Copy link
Contributor

From nmap/libssh2/src/, running

java superc.SugarC -D HAVE_CONFIG_H -I ../include/ -I ../src ${SUGARC_EVALUATION}/nmap/openssl.headless.c > openssl.desugared.c

results in ERROR: unsupported semantic action: Identifier.

@paulgazz
Copy link
Member

paulgazz commented Nov 7, 2020

Can you provide a code snippet to evaluate this on?

@julianbraha
Copy link
Contributor Author

I will try to narrow down the cause of this in the original file, and create a small example

@julianbraha
Copy link
Contributor Author

Here's an example:

void function(x)
{
}

This looks like a K&R-style function declaration. I'm realizing now that the original function was not like this, it's just that the type of the argument was a typedef, which was missing. In other words, this same error appears for a function like this:

void function(missing_typedef x)
{
}

This isn't actually a K&R-style function, it's just superc thinking that missing_typedef is the parameter's identifier rather than the type.

@paulgazz
Copy link
Member

paulgazz commented Nov 7, 2020

Is this a problem then with the headers?

@julianbraha
Copy link
Contributor Author

Yes, and I should be able to proceed without this semantic action being finished. We may want an additional error message in the identifier semantic action to let the user know that superc was unable to proceed because there was either a missing typedef/#define or a K&R-style function.

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

No branches or pull requests

2 participants