Georg Leber
Georg Leber

Reputation: 3580

Xtext parsing rule uncomplete

I am using following excerpt in the grammar for my DSL:

SelectDml:
    'select' columnList+=FieldColumn (',' columns+=FieldColumn)* from=FromClause;

FromClause:
    'from' value=ID (alias=ID)?;

FieldColumn hidden():
    fieldName=ID ('.' ID)?;

If I parse following line of my DSL, then there is one FieldColumn in the column-List which is absolutely fine. But the FieldColumn has the fieldName a and not the expected value: a.col.

select a.col from a

Is there a problem with my grammar? Something missing?

Upvotes: 0

Views: 29

Answers (1)

Gunther
Gunther

Reputation: 5256

Per this rule

FieldColumn hidden():
      fieldName=ID ('.' ID)?;

the first ID value is assigned to fieldName. Any further ID values are just skipped.

Upvotes: 1

Related Questions