antlr / antlr/antlr4

Cpp ANTLRFileStream hides and ignores file failures

Open
#2,255 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

Cpp ANTLRFileStream provides no way for a caller to see failures caused by file open errors or file read errors, and it ignores such errors. This seems like a design flaw, since the equivalent Java classes would seem to throw exceptions under these error conditions.

A workaround is to open a std::ifstream, verify that it's good, then pass it to the ANTLRInputStream constructor, and then perhaps check it again afterwards, but then this begs the question of why ANTLRFileStream exists.

Contributor guide

Open the contributing guide

Research direction

Start with the Cpp ANTLRFileStream and ANTLRInputStream entry points, then compare their failure behavior with the equivalent Java classes mentioned in the issue. Done means callers can observe file-open and file-read failures instead of having them ignored, while preserving the stated stream use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.