antlr / antlr/antlr3

The questions when i try to translate java class to antlr3 grammer file.

Open
#208 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
253
Forks
178
PR merge metrics
No merged PRs in 30d

Description

The context Link:https://github.com/antlr/antlr4/issues/3652

```
Env: antlr 3.5
Run commond: java -jar antlr-3.5-complete.jar TarsParser.g
```

I have tralated the lexer file successfully.: https://github.com/walkertest/TarsJava/blob/feature/antlrfind/tools/tars-maven-plugin/src/main/resources/antlr/TarsLexer.g

The parser file was almost found back:https://github.com/walkertest/TarsJava/blob/feature/antlrfind/tools/tars-maven-plugin/src/main/resources/antlr/TafParser.g

The remaining questions are:
First:
![image](https://user-images.githubusercontent.com/49718754/167753003-766c7043-01d7-4c74-b38a-69fdbc686be9.png)
const_initializer func was different like this.

Second:
![image](https://user-images.githubusercontent.com/49718754/167753175-298170dd-403b-49d2-87c4-5ed8b6e5a5cf.png)
The Follow bitset define index was a little differant like this.

Third:
![image](https://user-images.githubusercontent.com/49718754/167753405-23602f88-a3ad-479e-8c2a-01200b774fcc.png)
The order of some valiables which defined in func was differant.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked issue #3652 and reproduce the reported command, `java -jar antlr-3.5-complete.jar TarsParser.g`. Compare the generated output with `TarsLexer.g` and `TafParser.g`, focusing on `const_initializer`, the Follow bitset indexes, and local variable ordering. Done means explaining whether these differences are expected or identifying a reproducible ANTLR 3.5 generation problem.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.