antlr / antlr/antlr4

Feature: listen to parser state changes

Open
#3,218 1 comment 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

We'd like to track state changes in our parser. The objective is to compute an estimate of how much of the language is covered by the examples we have. We've tried with a listener but it's not enough to track just rule enter/exit.
However, the setState method is final (in the Java target) and the parser does not notify anyone of its state changes.

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 by locating the Java target's final setState method and the parser notification path. Determine how state changes could be exposed beyond rule enter/exit; done means a listener can observe those changes well enough to estimate language coverage from examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.