[antlr-interest] how to let parser control lexer state.
dave at badgers-in-foil.co.uk
Sat Apr 28 05:14:45 PDT 2007
On Fri, Apr 27, 2007 at 11:31:45PM -0700, Loring Craymer wrote:
> You are correct; I hadn't been aware of heredoc. It
> is still not a problem that needs tieing parser and
> lexer together.
> Nasty problem. It is amazing how often really bad
> ideas are adopted.
And yet, there is more!
# syntax on the same line is not part of the here-doc yet,
# multiple here-docs,
And-yet-and-yet, going back to the OP, Ruby also treats these two
examples as different syntax,
# a here-doc, because 'puts' is a method (predefined in Ruby runtime)
puts = 1
# now, a left-shift operator, because we've created a 'puts' local var
# (gives error as 'HERE' is not defined, but that's not the point)
Naturally, the syntax is also sensitive to whitespace on either side of
the '<<' :-)
More information about the antlr-interest