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

Grammar not acceptig valueDomainvalues starting with "_" #405

Open
antonio-olleros opened this issue Apr 15, 2024 · 2 comments
Open

Grammar not acceptig valueDomainvalues starting with "_" #405

antonio-olleros opened this issue Apr 15, 2024 · 2 comments
Labels

Comments

@antonio-olleros
Copy link

Currently, the grammar defines:

valueDomainValue:
IDENTIFIER
| INTEGER_CONSTANT
| NUMBER_CONSTANT;

IDENTIFIER
:
LETTER ([A-Za-z0-9_.])*
| DIGITS0_9 ([A-Za-z0-9_.])+
| ''' (.)*? '''
;

Therefre, it is not posible to write hierarchy rules like: _Z = _T + A + B; but in SDMX it is very common to have codes starting with undercode (e.g., _Z for not applicable).

Grammar should be correced to allow the use of those codes.

@linardian
Copy link
Collaborator

Hi Antonio,
yes you are perfectly right. I am adding this issue to the #395 and #401 related with G4 and we are going to discuss it this afternoon.
Thank you for pointing it out

@NicoLaval NicoLaval mentioned this issue Oct 7, 2024
7 tasks
@vpinna80
Copy link
Collaborator

vpinna80 commented Oct 8, 2024

I agree with this change, and I also propose to refine the IDENTIFIER rule to allow:

  • single quotes inside single quotes
  • SDMX identifiers without quotes (agency:dataflow(version)/query).

The query part may be dropped if you think the sdmx-to-vtl mapping spec is going to be used (today it is not).
This is my proposal (including antonio's):

IDENTIFIER
  : [A-Za-z0-9_] ([A-Za-z0-9_.])*
  | ([A-Za-z0-9_.]+:)? [A-Za-z0-9_.]+ ( \([0-9._+*~]+\) )? (/[A-Za-z0-9_.]+)?
  | '\'' ( '\\\'' | [^'] )* '\''
  ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants