antlr / antlr/antlr4

Generating a Cpp parser for the Cpp grammar produces incorrect method call.

Open
#2,116 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

Xcode chokes on the generated CPP14Parser.cpp with this error:

/Users/huperniketes/Documents/Projects/Applications/Multiplatform/Cppquins/generated/CPP14Parser.cpp:16897:145: No member named 'compareTo' in 'std::__1::basic_string'; did you mean 'compare'?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated CPP14Parser.cpp location and the reported line around the std::string compareTo call. Check how the Cpp grammar generates this method invocation and compare it with the C++ string API, then reproduce the Xcode compilation failure. Done means generated C++ code compiles without the invalid method call.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.