Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lexer declarations and constructor extension #2642

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sirkon
Copy link

@sirkon sirkon commented Sep 7, 2019

Having @lexer::members support for Go target is not enough. Just like C++, Go needs @lexer::declarations to add needed fields into a lexer and I also added @lexer::construction block (I don't know how you call it in ANTLR4) to extend New<Gramman Name>Lexer constructor code.

This is how I used this:

...

@lexer::declarations {
    comments map[int]map[int]string // This adds a new field "comments"
}

@lexer::construction {
    l.comments = map[int]map[int]string{} // This inits "comments" field in the constructor
}

...

@@ -234,6 +234,7 @@ YYYY/MM/DD, github id, Full name, email
2019/08/27, wurzelpeter, Markus Franke, markus[hyphen]franke[at]web[dot]de
2019/09/10, ImanHosseini, Iman Hosseini, hosseini.iman@yahoo.com
2019/09/03, João Henrique, johnnyonflame@hotmail.com
<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line looks like leftover of conflict resolving. Please remove.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, removed. Removed the last line too.

@@ -328,3 +329,4 @@ YYYY/MM/DD, github id, Full name, email
2021/12/31, Biswa96, Biswapriyo Nath, nathbappai@gmail.com
2022/03/07, chenquan, chenquan, chenquan.dev@gmail.com
2022/03/15, hzeller, Henner Zeller, h.zeller@acm.org
2023/04/29, sirkon, Denis Cheremisov, denis.cheremisov@gmail.com
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there is no need to change this file. Please revert.

Signed-off-by: Denis Cheremisov <denis.cheremisov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants