antlr / antlr/antlr4

Add error for EOF transition reachable in closure from itself

Open
#535 1 comment 0 reactions 0 assignees View on GitHub
atn-analysis comp:tool type:bug
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

If the closure of the right side of an EOF transition sees the left side of that transition, it would result in a stack overflow in closure. This situation should be detected and reported as an error when the grammar is compiled.

Contributor guide

Open the contributing guide

Research direction

Start by tracing EOF transition handling and closure computation during grammar compilation. Reproduce a grammar where the closure of an EOF transition's right side reaches its left side, then inspect existing grammar error reporting. Done means the recursive case is detected and reported as a compilation error instead of causing a stack overflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
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.