Module: Atomy::Grammar::ASTConstruction

Included in:
Atomy::Grammar
Defined in:
lib/atomy/grammar.rb

Instance Method Summary collapse

Instance Method Details

#application(node, arguments) ⇒ Object



168
169
170
# File 'lib/atomy/grammar.rb', line 168

def application(node, arguments)
  AST::Apply.new(node, arguments)
end

#block(nodes) ⇒ Object



171
172
173
# File 'lib/atomy/grammar.rb', line 171

def block(nodes)
  AST::Block.new(nodes)
end

#compose(left, right) ⇒ Object



174
175
176
# File 'lib/atomy/grammar.rb', line 174

def compose(left, right)
  AST::Compose.new(left, right)
end

#constant(text) ⇒ Object



177
178
179
# File 'lib/atomy/grammar.rb', line 177

def constant(text)
  AST::Constant.new(text)
end

#infix(left, right, operator) ⇒ Object



180
181
182
# File 'lib/atomy/grammar.rb', line 180

def infix(left, right, operator)
  AST::Infix.new(left, right, operator)
end

#list(nodes) ⇒ Object



183
184
185
# File 'lib/atomy/grammar.rb', line 183

def list(nodes)
  AST::List.new(nodes)
end

#literal(value) ⇒ Object



186
187
188
# File 'lib/atomy/grammar.rb', line 186

def literal(value)
  AST::Literal.new(value)
end

#number(value) ⇒ Object



189
190
191
# File 'lib/atomy/grammar.rb', line 189

def number(value)
  AST::Number.new(value)
end

#postfix(node, operator) ⇒ Object



192
193
194
# File 'lib/atomy/grammar.rb', line 192

def postfix(node, operator)
  AST::Postfix.new(node, operator)
end

#prefix(node, operator) ⇒ Object



195
196
197
# File 'lib/atomy/grammar.rb', line 195

def prefix(node, operator)
  AST::Prefix.new(node, operator)
end

#quasiquote(node) ⇒ Object



198
199
200
# File 'lib/atomy/grammar.rb', line 198

def quasiquote(node)
  AST::QuasiQuote.new(node)
end

#quote(node) ⇒ Object



201
202
203
# File 'lib/atomy/grammar.rb', line 201

def quote(node)
  AST::Quote.new(node)
end

#sequence(nodes) ⇒ Object



204
205
206
# File 'lib/atomy/grammar.rb', line 204

def sequence(nodes)
  AST::Sequence.new(nodes)
end

#strliteral(value) ⇒ Object



207
208
209
# File 'lib/atomy/grammar.rb', line 207

def strliteral(value)
  AST::StringLiteral.new(value)
end

#unquote(node) ⇒ Object



210
211
212
# File 'lib/atomy/grammar.rb', line 210

def unquote(node)
  AST::Unquote.new(node)
end

#word(text) ⇒ Object



213
214
215
# File 'lib/atomy/grammar.rb', line 213

def word(text)
  AST::Word.new(text)
end