Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[REFACTOR] Refactoring Identifier Parsing in JSqlParserCC.jjt for Consistency #2216

minleejae started this conversation in General
Discussion options

Hi,

To improve the consistency of the codebase, I propose standardizing the parsing of identifiers in JSqlParserCC.jjt. Currently, there are multiple methods used to parse identifiers, including direct usage of S_IDENTIFIER, using RelObjectName(), and allowing various options with OR conditions. This inconsistency can lead to maintenance challenges and potential parsing errors.

By unifying the parsing method to consistently use a single approach, whether it is RelObjectName() or another method, we can achieve the following benefits:

  1. Improved Code Readability: A single, consistent method for parsing identifiers will make the code easier to read and understand.
  2. Reduced Maintenance Effort: With a unified approach, future changes to identifier parsing will only need to be made in one place.

I recommend refactoring all instances where identifiers are parsed to use a single, consistent method. This change will streamline the code and improve overall code quality.

I would appreciate your feedback on this proposal and any additional suggestions you might have.

You must be logged in to vote

Replies: 1 comment

Comment options

I totally agree with you though this will be a lot of work.

In my opinion, we should aim for one single production ObjectIdentifier(int flag) where the flag indicates certain constraints, e.g.

  • ObjectIdentifier is a Label (because the previous token was an identifier or an AS token)
  • if VALUES is allowed or not (when its an INSERT)

So the flag should be a combination of things and then be used in a Semantic Lookahead.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #2214 on April 04, 2025 12:33.

AltStyle によって変換されたページ (->オリジナル) /