Module: Synthra::Parser::AST

Defined in:
lib/synthra/parser/ast.rb

Overview

Abstract Syntax Tree nodes for representing parsed DSL structure

The AST module contains node classes that represent the hierarchical structure of a parsed DSL file. Each node type corresponds to a different DSL construct.

Examples:

Parse DSL to AST

parser = Synthra::Parser::Parser.new
ast_nodes = parser.parse(dsl_source)
# => [SchemaNode, SchemaNode, ...]

Convert AST to Schema

schema = ast_nodes.first.to_schema
# => Synthra::Schema

Defined Under Namespace

Classes: ApiDefinitionNode, ArrayTypeNode, BehaviorNode, ConditionNode, CustomNode, DirectiveNode, EnumValueNode, FieldNode, HeaderDirective, LatencyDirective, MethodDirective, ModifierNode, Node, ProbabilityDirective, ProgramNode, ReferenceNode, ResponseFieldNode, ScenarioNode, SchemaDefinitionNode, SchemaNode, SchemaReferenceNode, StatusDirective, TypeNode