Class: Expressir::Express::Builders::SyntaxBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/expressir/express/builders/syntax_builder.rb

Overview

Builds syntax (top-level) nodes into ExpFile objects. Each parsed EXPRESS file is represented as an ExpFile containing schemas.

Instance Method Summary collapse

Instance Method Details

#call(ast_data) ⇒ Model::ExpFile

Build ExpFile from AST data

Parameters:

  • ast_data (Hash)

    The parsed AST with syntax node

Returns:



12
13
14
15
16
17
# File 'lib/expressir/express/builders/syntax_builder.rb', line 12

def call(ast_data)
  schema_decl_data = extract_schema_decls(ast_data)

  schemas = Builder.build_children(schema_decl_data)
  Expressir::Model::ExpFile.new(schemas: schemas.compact)
end