Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: James Gray
RE: lookahead [ reply ]  
2008-02-04 19:10
Ghost Wheel supports look-ahead rules, but I haven't yet added them into the grammar syntax. If you are using the Ruby DSL though, you can create them as shown in these tests:

assert_equal( LookAhead.new(Literal.new("one")),
@builder.look(@builder.lit("one")) )

assert_equal( LookAhead.new(Literal.new("one"), true),
@builder.nlook(@builder.lit("one")) )
assert_equal( LookAhead.new(Literal.new("one"), true),
@builder.look(true, @builder.lit("one")) )
assert_equal( LookAhead.new(Literal.new("one"), true),
@builder.look(@builder.lit("one"), true) )

Basically, you want the nlook() method.

By: Daniel Brumbaugh-Keeney
lookahead [ reply ]  
2008-02-03 01:39
How do I do a zero-width negative lookahead?
In Treetop this would be
!rule