Created
July 7, 2009 21:12
-
-
Save trystant/142374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'treetop' | |
require 'polyglot' | |
Treetop.load File.dirname(__FILE__) + '/../grammars/test' | |
class Driver | |
attr_accessor :test_parser, :test_parser_errors | |
def initialize | |
@test_parser = TestParser.new | |
@test_parser_errors = [] | |
end | |
def validate_test_string(test_string) | |
parse_result = @test_parser.parse(test_string) | |
if parse_result.nil? | |
@test_parser_errors << @test_parser.terminal_failures[0] | |
return false | |
end | |
return true | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment