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

A dedicated bug under CPP, where assignment expressions are treated as variables #4761

Open
cxasm opened this issue Jan 22, 2025 · 1 comment

Comments

@cxasm
Copy link

cxasm commented Jan 22, 2025

{
ning zs_1 = 1;
ning bl_3 = (zs_1 and (1>2));
}

Image

If it is under Java, zs_1 and (1>2) in the following figure will be well handled.

But if it's cpp, “zs_1and” will be treated as a variable.

Suspect that CPP is dealing with some malfunctions in this area.

antlr4 version is 4.13.2 。

@kaby76
Copy link
Contributor

kaby76 commented Jan 22, 2025

What is the grammar? Is it the CPP14 grammar from grammars-v4? https://github.com/antlr/grammars-v4/tree/83cb847a0a6d278b166eb3cb48f032533d0c8060/cpp ? That grammar does not use a symbol table. It's not the cpp14 grammar because there's no block, statement, or defvar. We need a grammar, not just an input string.

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