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

[CSharp] tokenStartCharIndex inaccessible in CSharp target. #4716

Open
kaby76 opened this issue Oct 19, 2024 · 0 comments
Open

[CSharp] tokenStartCharIndex inaccessible in CSharp target. #4716

kaby76 opened this issue Oct 19, 2024 · 0 comments

Comments

@kaby76
Copy link
Contributor

kaby76 commented Oct 19, 2024

A copy of the official Oracle MySQL is in grammars-v4. This port is written by @mike-lischke using Antlr4ng, and uses the tokenStartCharIndex field. It writes the value of the field to the location following a '.' in qualified identifiers (e.g., ST.ID). The intent is so that the next token that is recognized after the '.' is ID, not .ID. That is because the token is created using _tokenStartCharIndex in Emit() for Java, and all the other targets.

Unfortunately, the accessibility of the field varies across targets. (I don't know about the other fields/properties).

CSharp

For the CSharp runtime, _tokenStartCharIndex is a private field in Lexer.cs, and it has only a read-only property. I can probably work around this by overriding Emit() and defining the field over in the lexer base class for the MySQL grammar.

Cpp

The field tokenStartCharIndex is public.

Dart

The field tokenStartCharIndex is public. The name does not begin with an underscore.

Go

TokenStartCharIndex is public. The name of the field begins with a capital letter.

Java

Field _tokenStartCharIndex is public.

JavaScript

_tokenStartCharIndex is public.

TypeScript

_tokenStartCharIndex is public.

Python3

_tokenStartCharIndex is public.

Swift

_tokenStartCharIndex is public.

PHP

$tokenStartCharIndex is public.

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

No branches or pull requests

2 participants
@kaby76 and others