You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
507 B

#!/usr/bin/ruby
# encoding: utf-8
require 'antlr3/test/functional'
class TestSyntacticPredicate < ANTLR3::Test::Functional
inline_grammar( <<-'END' )
lexer grammar SyntacticPredicateGate;
options {
language = Ruby;
}
FOO
: ('ab')=> A
| ('ac')=> B
;
fragment
A: 'a';
fragment
B: 'a';
END
example 'gating syntactic predicate rule' do
lexer = SyntacticPredicateGate::Lexer.new( 'ac' )
token = lexer.next_token
end
end