Class: Ibex::IR::Validator::LexerDocument
- Defined in:
- lib/ibex/ir/validator/lexer.rb
Overview
Structural validation for the independently versioned Lexer IR.
Constant Summary collapse
- ROOT_REQUIRED =
%w[ ibex_ir schema_version initial_state states rules warnings source_provenance ].freeze
- RULE_REQUIRED =
: Array
%w[ id state kind token pattern pattern_kind options action loc ].freeze
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(data, path: "$") ⇒ LexerDocument
constructor
A new instance of LexerDocument.
- #validate ⇒ Object
Constructor Details
#initialize(data, path: "$") ⇒ LexerDocument
Returns a new instance of LexerDocument.
16 17 18 19 20 |
# File 'lib/ibex/ir/validator/lexer.rb', line 16 def initialize(data, path: "$") super() @data = data @path = path end |
Instance Method Details
#validate ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ibex/ir/validator/lexer.rb', line 23 def validate record(@data, @path, ROOT_REQUIRED) literal(@data["ibex_ir"], "#{@path}.ibex_ir", "lexer") literal(@data["schema_version"], "#{@path}.schema_version", LEXER_SCHEMA_VERSION) literal(@data["initial_state"], "#{@path}.initial_state", "INITIAL") validate_states validate_rules validate_warnings validate_source_provenance self end |