The problem is that when it finds the DOT, it also wants to consume a X token. This isn't correct since this grammar should also accept code like ".yw", but then it throws a parsing error.
I probably defined this wrongly?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Alec,
I have some parsing code that looks like below. It is used for masking x, y, z and w components of a 4D vector:
<DOT> {...}
(
(<X> {...})
(<Y> {...})?
(<Z> {...})?
(<W> {...})?
)
|
(
(<Y> {...})
(<Z> {...})?
(<W> {...})?
)
|
(
(<Z> {...})
(<W> {...})?
)
|
(
(<W> {.})
)
The problem is that when it finds the DOT, it also wants to consume a X token. This isn't correct since this grammar should also accept code like ".yw", but then it throws a parsing error.
I probably defined this wrongly?
My error, sorry!
I forgot about the operator precedence rules, some extra parentheses solved it...
CppCC rocks!