We're updating the issue view to help you get more done.Learn more

Problem with syntax like: duration_attr28 matches {Pw/|P38W..P39W4D|}

It is also a problem when a s comment, like this:
-- duration_attr28 matches {Pw/|P38W..P39W4D|}

I found the solution, it is in the REG Lexer rule, which does something with the forward-slash /
Because Lexer rules are executed before parser rules, it disturbs the good functioning of this rule:
cDuration:
     ( DURATION_CONSTRAINT_PATTERN ( '/' ( durationIntervalValue | durationValue ) )? | durationValue | durationListValue | durationIntervalValue | durationIntervalListValue ) assumedDurationValue? ;
assumedDurationValue: ';' durationValue ;

The solution is to make REG a parser rule instead of a lexer rule, by writing it in lower-case.
But then the rule needs some change, because it must allow .*

So the String-reg-expr becomes like this
regexConstraint: reg ;
reg: '/' ( '\\/' | ~'/' | '.*' )+ '/' | '^' ( '\\^' | ~'^' | '.*' )+ '^';

So this case can be closed after changing the grammar.

Thanks

Status

Assignee

Thomas Beale

Reporter

Bert Verhees

Components

Affects versions

AM version 2.0.6

Priority

Major