blended-modeling / eatxt

Eclipse Public License 2.0
1 stars 1 forks source link

Use the correct terminal for UUIDs #26

Closed steghoja closed 2 years ago

steghoja commented 2 years ago

We are currently not compliant with the UUID format used by East-ADL. That's because we map UUIDs to the Xtext standard terminal ID which does not contain hyphens and considers IDs that start with a number incorrect. We would rather need a rule such as:

terminal UUID:
    '^'? ('a'..'f'|'A'..'F'|'$'|'_'|'0'..'9') ('a'..'f'|'A'..'F'|'$'|'_'|'0'..'9'|'-')*;

This blocks #7.

Wilson008 commented 2 years ago

If we just copy this rule and paste it into our current Xtext file, then we will see the error: error(208): ../org.bumble.eastadl.simplified/src-gen/org/bumble/eastadl/simplified/parser/antlr/lexer/InternalEastAdlSimplifiedLexer.g:454:1: The following token definitions can never be matched because prior tokens match the same input: RULE_INT error(208): ../org.bumble.eastadl.simplified.ide/src-gen/org/bumble/eastadl/simplified/ide/contentassist/antlr/lexer/InternalEastAdlSimplifiedLexer.g:454:1: The following token definitions can never be matched because prior tokens match the same input: RULE_INT That's because the rule INT from Xbase is hidden, however, Xbase is the necessary referenced lib for implementing whitespace-sensitive style.

steghoja commented 2 years ago

According to Henrik, we can use a simple String here. We just need to make sure that Xtext does not try to parse an ID at this point.