Another way is by adding the optional spaces into the basic node syntax. This
is used in some grammars as SIP ABNF and so. For example:
rule from_header
[Ff] [Rr] [Oo] [Mm] HCOLON uri parameters
end
rule HCOLON
space ':' space
end
rule EQUAL
space EQUAL space
end
rule LQUOT
space '<'
end
...
rule space
[\s\t]*
end
As you see, in this way you keep the higher syntax nodes "clean" of optional
spaces and that stuff. The trick is adding them to low level nodes.
--
Iñaki Baz Castillo