Module: SyntaxTree::DSL

Included in:
YARV::Decompiler, YARV::Decompiler::BlockLabel
Defined in:
lib/syntax_tree/dsl.rb

Overview

This module provides shortcuts for creating AST nodes.

Instance Method Summary collapse

Instance Method Details

#AliasNode(left, right) ⇒ Object

Create a new AliasNode node.



35
36
37
# File 'lib/syntax_tree/dsl.rb', line 35

def AliasNode(left, right)
  AliasNode.new(left: left, right: right, location: Location.default)
end

#ARef(collection, index) ⇒ Object

Create a new ARef node.



40
41
42
# File 'lib/syntax_tree/dsl.rb', line 40

def ARef(collection, index)
  ARef.new(collection: collection, index: index, location: Location.default)
end

#ARefField(collection, index) ⇒ Object

Create a new ARefField node.



45
46
47
48
49
50
51
# File 'lib/syntax_tree/dsl.rb', line 45

def ARefField(collection, index)
  ARefField.new(
    collection: collection,
    index: index,
    location: Location.default
  )
end

#ArgBlock(value) ⇒ Object

Create a new ArgBlock node.



64
65
66
# File 'lib/syntax_tree/dsl.rb', line 64

def ArgBlock(value)
  ArgBlock.new(value: value, location: Location.default)
end

#ArgParen(arguments) ⇒ Object

Create a new ArgParen node.



54
55
56
# File 'lib/syntax_tree/dsl.rb', line 54

def ArgParen(arguments)
  ArgParen.new(arguments: arguments, location: Location.default)
end

#Args(parts) ⇒ Object

Create a new Args node.



59
60
61
# File 'lib/syntax_tree/dsl.rb', line 59

def Args(parts)
  Args.new(parts: parts, location: Location.default)
end

#ArgsForwardObject

Create a new ArgsForward node.



74
75
76
# File 'lib/syntax_tree/dsl.rb', line 74

def ArgsForward
  ArgsForward.new(location: Location.default)
end

#ArgStar(value) ⇒ Object

Create a new ArgStar node.



69
70
71
# File 'lib/syntax_tree/dsl.rb', line 69

def ArgStar(value)
  ArgStar.new(value: value, location: Location.default)
end

#ArrayLiteral(lbracket, contents) ⇒ Object

Create a new ArrayLiteral node.



79
80
81
82
83
84
85
# File 'lib/syntax_tree/dsl.rb', line 79

def ArrayLiteral(lbracket, contents)
  ArrayLiteral.new(
    lbracket: lbracket,
    contents: contents,
    location: Location.default
  )
end

#AryPtn(constant, requireds, rest, posts) ⇒ Object

Create a new AryPtn node.



88
89
90
91
92
93
94
95
96
# File 'lib/syntax_tree/dsl.rb', line 88

def AryPtn(constant, requireds, rest, posts)
  AryPtn.new(
    constant: constant,
    requireds: requireds,
    rest: rest,
    posts: posts,
    location: Location.default
  )
end

#Assign(target, value) ⇒ Object

Create a new Assign node.



99
100
101
# File 'lib/syntax_tree/dsl.rb', line 99

def Assign(target, value)
  Assign.new(target: target, value: value, location: Location.default)
end

#Assoc(key, value) ⇒ Object

Create a new Assoc node.



104
105
106
# File 'lib/syntax_tree/dsl.rb', line 104

def Assoc(key, value)
  Assoc.new(key: key, value: value, location: Location.default)
end

#AssocSplat(value) ⇒ Object

Create a new AssocSplat node.



109
110
111
# File 'lib/syntax_tree/dsl.rb', line 109

def AssocSplat(value)
  AssocSplat.new(value: value, location: Location.default)
end

#Backref(value) ⇒ Object

Create a new Backref node.



114
115
116
# File 'lib/syntax_tree/dsl.rb', line 114

def Backref(value)
  Backref.new(value: value, location: Location.default)
end

#Backtick(value) ⇒ Object

Create a new Backtick node.



119
120
121
# File 'lib/syntax_tree/dsl.rb', line 119

def Backtick(value)
  Backtick.new(value: value, location: Location.default)
end

#BareAssocHash(assocs) ⇒ Object

Create a new BareAssocHash node.



124
125
126
# File 'lib/syntax_tree/dsl.rb', line 124

def BareAssocHash(assocs)
  BareAssocHash.new(assocs: assocs, location: Location.default)
end

#Begin(bodystmt) ⇒ Object

Create a new Begin node.



129
130
131
# File 'lib/syntax_tree/dsl.rb', line 129

def Begin(bodystmt)
  Begin.new(bodystmt: bodystmt, location: Location.default)
end

#BEGINBlock(lbrace, statements) ⇒ Object

Create a new BEGINBlock node.



7
8
9
10
11
12
13
# File 'lib/syntax_tree/dsl.rb', line 7

def BEGINBlock(lbrace, statements)
  BEGINBlock.new(
    lbrace: lbrace,
    statements: statements,
    location: Location.default
  )
end

#Binary(left, operator, right) ⇒ Object

Create a new Binary node.



139
140
141
142
143
144
145
146
# File 'lib/syntax_tree/dsl.rb', line 139

def Binary(left, operator, right)
  Binary.new(
    left: left,
    operator: operator,
    right: right,
    location: Location.default
  )
end

#BlockArg(name) ⇒ Object

Create a new BlockArg node.



154
155
156
# File 'lib/syntax_tree/dsl.rb', line 154

def BlockArg(name)
  BlockArg.new(name: name, location: Location.default)
end

#BlockNode(opening, block_var, bodystmt) ⇒ Object

Create a new BlockNode node.



317
318
319
320
321
322
323
324
# File 'lib/syntax_tree/dsl.rb', line 317

def BlockNode(opening, block_var, bodystmt)
  BlockNode.new(
    opening: opening,
    block_var: block_var,
    bodystmt: bodystmt,
    location: Location.default
  )
end

#BlockVar(params, locals) ⇒ Object

Create a new BlockVar node.



149
150
151
# File 'lib/syntax_tree/dsl.rb', line 149

def BlockVar(params, locals)
  BlockVar.new(params: params, locals: locals, location: Location.default)
end

#BodyStmt(statements, rescue_clause, else_keyword, else_clause, ensure_clause) ⇒ Object

Create a new BodyStmt node.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/syntax_tree/dsl.rb', line 159

def BodyStmt(
  statements,
  rescue_clause,
  else_keyword,
  else_clause,
  ensure_clause
)
  BodyStmt.new(
    statements: statements,
    rescue_clause: rescue_clause,
    else_keyword: else_keyword,
    else_clause: else_clause,
    ensure_clause: ensure_clause,
    location: Location.default
  )
end

#Break(arguments) ⇒ Object

Create a new Break node.



177
178
179
# File 'lib/syntax_tree/dsl.rb', line 177

def Break(arguments)
  Break.new(arguments: arguments, location: Location.default)
end

#CallNode(receiver, operator, message, arguments) ⇒ Object

Create a new CallNode node.



182
183
184
185
186
187
188
189
190
# File 'lib/syntax_tree/dsl.rb', line 182

def CallNode(receiver, operator, message, arguments)
  CallNode.new(
    receiver: receiver,
    operator: operator,
    message: message,
    arguments: arguments,
    location: Location.default
  )
end

#Case(keyword, value, consequent) ⇒ Object

Create a new Case node.



193
194
195
196
197
198
199
200
# File 'lib/syntax_tree/dsl.rb', line 193

def Case(keyword, value, consequent)
  Case.new(
    keyword: keyword,
    value: value,
    consequent: consequent,
    location: Location.default
  )
end

#CHAR(value) ⇒ Object

Create a new CHAR node.



16
17
18
# File 'lib/syntax_tree/dsl.rb', line 16

def CHAR(value)
  CHAR.new(value: value, location: Location.default)
end

#ClassDeclaration(constant, superclass, bodystmt, location = Location.default) ⇒ Object

Create a new ClassDeclaration node.



213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/syntax_tree/dsl.rb', line 213

def ClassDeclaration(
  constant,
  superclass,
  bodystmt,
  location = Location.default
)
  ClassDeclaration.new(
    constant: constant,
    superclass: superclass,
    bodystmt: bodystmt,
    location: location
  )
end

#Comma(value) ⇒ Object

Create a new Comma node.



228
229
230
# File 'lib/syntax_tree/dsl.rb', line 228

def Comma(value)
  Comma.new(value: value, location: Location.default)
end

#Command(message, arguments, block, location = Location.default) ⇒ Object

Create a new Command node.



233
234
235
236
237
238
239
240
# File 'lib/syntax_tree/dsl.rb', line 233

def Command(message, arguments, block, location = Location.default)
  Command.new(
    message: message,
    arguments: arguments,
    block: block,
    location: location
  )
end

#CommandCall(receiver, operator, message, arguments, block) ⇒ Object

Create a new CommandCall node.



243
244
245
246
247
248
249
250
251
252
# File 'lib/syntax_tree/dsl.rb', line 243

def CommandCall(receiver, operator, message, arguments, block)
  CommandCall.new(
    receiver: receiver,
    operator: operator,
    message: message,
    arguments: arguments,
    block: block,
    location: Location.default
  )
end

#Comment(value, inline, location = Location.default) ⇒ Object

Create a new Comment node.



255
256
257
# File 'lib/syntax_tree/dsl.rb', line 255

def Comment(value, inline, location = Location.default)
  Comment.new(value: value, inline: inline, location: location)
end

#Const(value) ⇒ Object

Create a new Const node.



260
261
262
# File 'lib/syntax_tree/dsl.rb', line 260

def Const(value)
  Const.new(value: value, location: Location.default)
end

#ConstPathField(parent, constant) ⇒ Object

Create a new ConstPathField node.



265
266
267
268
269
270
271
# File 'lib/syntax_tree/dsl.rb', line 265

def ConstPathField(parent, constant)
  ConstPathField.new(
    parent: parent,
    constant: constant,
    location: Location.default
  )
end

#ConstPathRef(parent, constant) ⇒ Object

Create a new ConstPathRef node.



274
275
276
277
278
279
280
# File 'lib/syntax_tree/dsl.rb', line 274

def ConstPathRef(parent, constant)
  ConstPathRef.new(
    parent: parent,
    constant: constant,
    location: Location.default
  )
end

#ConstRef(constant) ⇒ Object

Create a new ConstRef node.



283
284
285
# File 'lib/syntax_tree/dsl.rb', line 283

def ConstRef(constant)
  ConstRef.new(constant: constant, location: Location.default)
end

#CVar(value) ⇒ Object

Create a new CVar node.



288
289
290
# File 'lib/syntax_tree/dsl.rb', line 288

def CVar(value)
  CVar.new(value: value, location: Location.default)
end

#Defined(value) ⇒ Object

Create a new Defined node.



312
313
314
# File 'lib/syntax_tree/dsl.rb', line 312

def Defined(value)
  Defined.new(value: value, location: Location.default)
end

#DefNode(target, operator, name, params, bodystmt, location = Location.default) ⇒ Object

Create a new DefNode node.



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/syntax_tree/dsl.rb', line 293

def DefNode(
  target,
  operator,
  name,
  params,
  bodystmt,
  location = Location.default
)
  DefNode.new(
    target: target,
    operator: operator,
    name: name,
    params: params,
    bodystmt: bodystmt,
    location: location
  )
end

#DynaSymbol(parts, quote) ⇒ Object

Create a new DynaSymbol node.



337
338
339
# File 'lib/syntax_tree/dsl.rb', line 337

def DynaSymbol(parts, quote)
  DynaSymbol.new(parts: parts, quote: quote, location: Location.default)
end

#Else(keyword, statements) ⇒ Object

Create a new Else node.



342
343
344
345
346
347
348
# File 'lib/syntax_tree/dsl.rb', line 342

def Else(keyword, statements)
  Else.new(
    keyword: keyword,
    statements: statements,
    location: Location.default
  )
end

#Elsif(predicate, statements, consequent) ⇒ Object

Create a new Elsif node.



351
352
353
354
355
356
357
358
# File 'lib/syntax_tree/dsl.rb', line 351

def Elsif(predicate, statements, consequent)
  Elsif.new(
    predicate: predicate,
    statements: statements,
    consequent: consequent,
    location: Location.default
  )
end

#EmbDoc(value) ⇒ Object

Create a new EmbDoc node.



361
362
363
# File 'lib/syntax_tree/dsl.rb', line 361

def EmbDoc(value)
  EmbDoc.new(value: value, location: Location.default)
end

#EmbExprBeg(value) ⇒ Object

Create a new EmbExprBeg node.



366
367
368
# File 'lib/syntax_tree/dsl.rb', line 366

def EmbExprBeg(value)
  EmbExprBeg.new(value: value, location: Location.default)
end

#EmbExprEnd(value) ⇒ Object

Create a new EmbExprEnd node.



371
372
373
# File 'lib/syntax_tree/dsl.rb', line 371

def EmbExprEnd(value)
  EmbExprEnd.new(value: value, location: Location.default)
end

#EmbVar(value) ⇒ Object

Create a new EmbVar node.



376
377
378
# File 'lib/syntax_tree/dsl.rb', line 376

def EmbVar(value)
  EmbVar.new(value: value, location: Location.default)
end

#ENDBlock(lbrace, statements) ⇒ Object

Create a new ENDBlock node.



21
22
23
24
25
26
27
# File 'lib/syntax_tree/dsl.rb', line 21

def ENDBlock(lbrace, statements)
  ENDBlock.new(
    lbrace: lbrace,
    statements: statements,
    location: Location.default
  )
end

#EndContent(value) ⇒ Object

Create a new EndContent node.



30
31
32
# File 'lib/syntax_tree/dsl.rb', line 30

def EndContent(value)
  EndContent.new(value: value, location: Location.default)
end

#Ensure(keyword, statements) ⇒ Object

Create a new Ensure node.



381
382
383
384
385
386
387
# File 'lib/syntax_tree/dsl.rb', line 381

def Ensure(keyword, statements)
  Ensure.new(
    keyword: keyword,
    statements: statements,
    location: Location.default
  )
end

#ExcessedComma(value) ⇒ Object

Create a new ExcessedComma node.



390
391
392
# File 'lib/syntax_tree/dsl.rb', line 390

def ExcessedComma(value)
  ExcessedComma.new(value: value, location: Location.default)
end

#Field(parent, operator, name) ⇒ Object

Create a new Field node.



395
396
397
398
399
400
401
402
# File 'lib/syntax_tree/dsl.rb', line 395

def Field(parent, operator, name)
  Field.new(
    parent: parent,
    operator: operator,
    name: name,
    location: Location.default
  )
end

#FloatLiteral(value) ⇒ Object

Create a new FloatLiteral node.



405
406
407
# File 'lib/syntax_tree/dsl.rb', line 405

def FloatLiteral(value)
  FloatLiteral.new(value: value, location: Location.default)
end

#FndPtn(constant, left, values, right) ⇒ Object

Create a new FndPtn node.



410
411
412
413
414
415
416
417
418
# File 'lib/syntax_tree/dsl.rb', line 410

def FndPtn(constant, left, values, right)
  FndPtn.new(
    constant: constant,
    left: left,
    values: values,
    right: right,
    location: Location.default
  )
end

#For(index, collection, statements) ⇒ Object

Create a new For node.



421
422
423
424
425
426
427
428
# File 'lib/syntax_tree/dsl.rb', line 421

def For(index, collection, statements)
  For.new(
    index: index,
    collection: collection,
    statements: statements,
    location: Location.default
  )
end

#GVar(value) ⇒ Object

Create a new GVar node.



431
432
433
# File 'lib/syntax_tree/dsl.rb', line 431

def GVar(value)
  GVar.new(value: value, location: Location.default)
end

#HashLiteral(lbrace, assocs) ⇒ Object

Create a new HashLiteral node.



436
437
438
439
440
441
442
# File 'lib/syntax_tree/dsl.rb', line 436

def HashLiteral(lbrace, assocs)
  HashLiteral.new(
    lbrace: lbrace,
    assocs: assocs,
    location: Location.default
  )
end

#Heredoc(beginning, ending, dedent, parts) ⇒ Object

Create a new Heredoc node.



445
446
447
448
449
450
451
452
453
# File 'lib/syntax_tree/dsl.rb', line 445

def Heredoc(beginning, ending, dedent, parts)
  Heredoc.new(
    beginning: beginning,
    ending: ending,
    dedent: dedent,
    parts: parts,
    location: Location.default
  )
end

#HeredocBeg(value) ⇒ Object

Create a new HeredocBeg node.



456
457
458
# File 'lib/syntax_tree/dsl.rb', line 456

def HeredocBeg(value)
  HeredocBeg.new(value: value, location: Location.default)
end

#HeredocEnd(value) ⇒ Object

Create a new HeredocEnd node.



461
462
463
# File 'lib/syntax_tree/dsl.rb', line 461

def HeredocEnd(value)
  HeredocEnd.new(value: value, location: Location.default)
end

#HshPtn(constant, keywords, keyword_rest) ⇒ Object

Create a new HshPtn node.



466
467
468
469
470
471
472
473
# File 'lib/syntax_tree/dsl.rb', line 466

def HshPtn(constant, keywords, keyword_rest)
  HshPtn.new(
    constant: constant,
    keywords: keywords,
    keyword_rest: keyword_rest,
    location: Location.default
  )
end

#Ident(value) ⇒ Object

Create a new Ident node.



476
477
478
# File 'lib/syntax_tree/dsl.rb', line 476

def Ident(value)
  Ident.new(value: value, location: Location.default)
end

#IfNode(predicate, statements, consequent) ⇒ Object

Create a new IfNode node.



481
482
483
484
485
486
487
488
# File 'lib/syntax_tree/dsl.rb', line 481

def IfNode(predicate, statements, consequent)
  IfNode.new(
    predicate: predicate,
    statements: statements,
    consequent: consequent,
    location: Location.default
  )
end

#IfOp(predicate, truthy, falsy) ⇒ Object

Create a new IfOp node.



491
492
493
494
495
496
497
498
# File 'lib/syntax_tree/dsl.rb', line 491

def IfOp(predicate, truthy, falsy)
  IfOp.new(
    predicate: predicate,
    truthy: truthy,
    falsy: falsy,
    location: Location.default
  )
end

#Imaginary(value) ⇒ Object

Create a new Imaginary node.



501
502
503
# File 'lib/syntax_tree/dsl.rb', line 501

def Imaginary(value)
  Imaginary.new(value: value, location: Location.default)
end

#In(pattern, statements, consequent) ⇒ Object

Create a new In node.



506
507
508
509
510
511
512
513
# File 'lib/syntax_tree/dsl.rb', line 506

def In(pattern, statements, consequent)
  In.new(
    pattern: pattern,
    statements: statements,
    consequent: consequent,
    location: Location.default
  )
end

#Int(value) ⇒ Object

Create a new Int node.



516
517
518
# File 'lib/syntax_tree/dsl.rb', line 516

def Int(value)
  Int.new(value: value, location: Location.default)
end

#IVar(value) ⇒ Object

Create a new IVar node.



521
522
523
# File 'lib/syntax_tree/dsl.rb', line 521

def IVar(value)
  IVar.new(value: value, location: Location.default)
end

#Kw(value) ⇒ Object

Create a new Kw node.



526
527
528
# File 'lib/syntax_tree/dsl.rb', line 526

def Kw(value)
  Kw.new(value: value, location: Location.default)
end

#KwRestParam(name) ⇒ Object

Create a new KwRestParam node.



531
532
533
# File 'lib/syntax_tree/dsl.rb', line 531

def KwRestParam(name)
  KwRestParam.new(name: name, location: Location.default)
end

#Label(value) ⇒ Object

Create a new Label node.



536
537
538
# File 'lib/syntax_tree/dsl.rb', line 536

def Label(value)
  Label.new(value: value, location: Location.default)
end

#LabelEnd(value) ⇒ Object

Create a new LabelEnd node.



541
542
543
# File 'lib/syntax_tree/dsl.rb', line 541

def LabelEnd(value)
  LabelEnd.new(value: value, location: Location.default)
end

#Lambda(params, statements) ⇒ Object

Create a new Lambda node.



546
547
548
549
550
551
552
# File 'lib/syntax_tree/dsl.rb', line 546

def Lambda(params, statements)
  Lambda.new(
    params: params,
    statements: statements,
    location: Location.default
  )
end

#LambdaVar(params, locals) ⇒ Object

Create a new LambdaVar node.



555
556
557
# File 'lib/syntax_tree/dsl.rb', line 555

def LambdaVar(params, locals)
  LambdaVar.new(params: params, locals: locals, location: Location.default)
end

#LBrace(value) ⇒ Object

Create a new LBrace node.



560
561
562
# File 'lib/syntax_tree/dsl.rb', line 560

def LBrace(value)
  LBrace.new(value: value, location: Location.default)
end

#LBracket(value) ⇒ Object

Create a new LBracket node.



565
566
567
# File 'lib/syntax_tree/dsl.rb', line 565

def LBracket(value)
  LBracket.new(value: value, location: Location.default)
end

#LParen(value) ⇒ Object

Create a new LParen node.



570
571
572
# File 'lib/syntax_tree/dsl.rb', line 570

def LParen(value)
  LParen.new(value: value, location: Location.default)
end

#MAssign(target, value) ⇒ Object

Create a new MAssign node.



575
576
577
# File 'lib/syntax_tree/dsl.rb', line 575

def MAssign(target, value)
  MAssign.new(target: target, value: value, location: Location.default)
end

#MethodAddBlock(call, block, location = Location.default) ⇒ Object

Create a new MethodAddBlock node.



580
581
582
# File 'lib/syntax_tree/dsl.rb', line 580

def MethodAddBlock(call, block, location = Location.default)
  MethodAddBlock.new(call: call, block: block, location: location)
end

#MLHS(parts, comma) ⇒ Object

Create a new MLHS node.



585
586
587
# File 'lib/syntax_tree/dsl.rb', line 585

def MLHS(parts, comma)
  MLHS.new(parts: parts, comma: comma, location: Location.default)
end

#MLHSParen(contents, comma) ⇒ Object

Create a new MLHSParen node.



590
591
592
593
594
595
596
# File 'lib/syntax_tree/dsl.rb', line 590

def MLHSParen(contents, comma)
  MLHSParen.new(
    contents: contents,
    comma: comma,
    location: Location.default
  )
end

#ModuleDeclaration(constant, bodystmt) ⇒ Object

Create a new ModuleDeclaration node.



599
600
601
602
603
604
605
# File 'lib/syntax_tree/dsl.rb', line 599

def ModuleDeclaration(constant, bodystmt)
  ModuleDeclaration.new(
    constant: constant,
    bodystmt: bodystmt,
    location: Location.default
  )
end

#MRHS(parts) ⇒ Object

Create a new MRHS node.



608
609
610
# File 'lib/syntax_tree/dsl.rb', line 608

def MRHS(parts)
  MRHS.new(parts: parts, location: Location.default)
end

#Next(arguments) ⇒ Object

Create a new Next node.



613
614
615
# File 'lib/syntax_tree/dsl.rb', line 613

def Next(arguments)
  Next.new(arguments: arguments, location: Location.default)
end

#Not(statement, parentheses) ⇒ Object

Create a new Not node.



892
893
894
895
896
897
898
# File 'lib/syntax_tree/dsl.rb', line 892

def Not(statement, parentheses)
  Not.new(
    statement: statement,
    parentheses: parentheses,
    location: Location.default
  )
end

#Op(value) ⇒ Object

Create a new Op node.



618
619
620
# File 'lib/syntax_tree/dsl.rb', line 618

def Op(value)
  Op.new(value: value, location: Location.default)
end

#OpAssign(target, operator, value) ⇒ Object

Create a new OpAssign node.



623
624
625
626
627
628
629
630
# File 'lib/syntax_tree/dsl.rb', line 623

def OpAssign(target, operator, value)
  OpAssign.new(
    target: target,
    operator: operator,
    value: value,
    location: Location.default
  )
end

#Params(requireds, optionals, rest, posts, keywords, keyword_rest, block) ⇒ Object

Create a new Params node.



633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/syntax_tree/dsl.rb', line 633

def Params(requireds, optionals, rest, posts, keywords, keyword_rest, block)
  Params.new(
    requireds: requireds,
    optionals: optionals,
    rest: rest,
    posts: posts,
    keywords: keywords,
    keyword_rest: keyword_rest,
    block: block,
    location: Location.default
  )
end

#Paren(lparen, contents) ⇒ Object

Create a new Paren node.



647
648
649
# File 'lib/syntax_tree/dsl.rb', line 647

def Paren(lparen, contents)
  Paren.new(lparen: lparen, contents: contents, location: Location.default)
end

#Period(value) ⇒ Object

Create a new Period node.



652
653
654
# File 'lib/syntax_tree/dsl.rb', line 652

def Period(value)
  Period.new(value: value, location: Location.default)
end

#PinnedBegin(statement) ⇒ Object

Create a new PinnedBegin node.



134
135
136
# File 'lib/syntax_tree/dsl.rb', line 134

def PinnedBegin(statement)
  PinnedBegin.new(statement: statement, location: Location.default)
end

#PinnedVarRef(value) ⇒ Object

Create a new PinnedVarRef node.



944
945
946
# File 'lib/syntax_tree/dsl.rb', line 944

def PinnedVarRef(value)
  PinnedVarRef.new(value: value, location: Location.default)
end

#Program(statements) ⇒ Object

Create a new Program node.



657
658
659
# File 'lib/syntax_tree/dsl.rb', line 657

def Program(statements)
  Program.new(statements: statements, location: Location.default)
end

#QSymbols(beginning, elements) ⇒ Object

Create a new QSymbols node.



662
663
664
665
666
667
668
# File 'lib/syntax_tree/dsl.rb', line 662

def QSymbols(beginning, elements)
  QSymbols.new(
    beginning: beginning,
    elements: elements,
    location: Location.default
  )
end

#QSymbolsBeg(value) ⇒ Object

Create a new QSymbolsBeg node.



671
672
673
# File 'lib/syntax_tree/dsl.rb', line 671

def QSymbolsBeg(value)
  QSymbolsBeg.new(value: value, location: Location.default)
end

#QWords(beginning, elements) ⇒ Object

Create a new QWords node.



676
677
678
679
680
681
682
# File 'lib/syntax_tree/dsl.rb', line 676

def QWords(beginning, elements)
  QWords.new(
    beginning: beginning,
    elements: elements,
    location: Location.default
  )
end

#QWordsBeg(value) ⇒ Object

Create a new QWordsBeg node.



685
686
687
# File 'lib/syntax_tree/dsl.rb', line 685

def QWordsBeg(value)
  QWordsBeg.new(value: value, location: Location.default)
end

#RangeNode(left, operator, right) ⇒ Object

Create a new RangeNode node.



327
328
329
330
331
332
333
334
# File 'lib/syntax_tree/dsl.rb', line 327

def RangeNode(left, operator, right)
  RangeNode.new(
    left: left,
    operator: operator,
    right: right,
    location: Location.default
  )
end

#RAssign(value, operator, pattern) ⇒ Object

Create a new RAssign node.



203
204
205
206
207
208
209
210
# File 'lib/syntax_tree/dsl.rb', line 203

def RAssign(value, operator, pattern)
  RAssign.new(
    value: value,
    operator: operator,
    pattern: pattern,
    location: Location.default
  )
end

#RationalLiteral(value) ⇒ Object

Create a new RationalLiteral node.



690
691
692
# File 'lib/syntax_tree/dsl.rb', line 690

def RationalLiteral(value)
  RationalLiteral.new(value: value, location: Location.default)
end

#RBrace(value) ⇒ Object

Create a new RBrace node.



695
696
697
# File 'lib/syntax_tree/dsl.rb', line 695

def RBrace(value)
  RBrace.new(value: value, location: Location.default)
end

#RBracket(value) ⇒ Object

Create a new RBracket node.



700
701
702
# File 'lib/syntax_tree/dsl.rb', line 700

def RBracket(value)
  RBracket.new(value: value, location: Location.default)
end

#RedoObject

Create a new Redo node.



705
706
707
# File 'lib/syntax_tree/dsl.rb', line 705

def Redo
  Redo.new(location: Location.default)
end

#RegexpBeg(value) ⇒ Object

Create a new RegexpBeg node.



719
720
721
# File 'lib/syntax_tree/dsl.rb', line 719

def RegexpBeg(value)
  RegexpBeg.new(value: value, location: Location.default)
end

#RegexpContent(beginning, parts) ⇒ Object

Create a new RegexpContent node.



710
711
712
713
714
715
716
# File 'lib/syntax_tree/dsl.rb', line 710

def RegexpContent(beginning, parts)
  RegexpContent.new(
    beginning: beginning,
    parts: parts,
    location: Location.default
  )
end

#RegexpEnd(value) ⇒ Object

Create a new RegexpEnd node.



724
725
726
# File 'lib/syntax_tree/dsl.rb', line 724

def RegexpEnd(value)
  RegexpEnd.new(value: value, location: Location.default)
end

#RegexpLiteral(beginning, ending, parts) ⇒ Object

Create a new RegexpLiteral node.



729
730
731
732
733
734
735
736
# File 'lib/syntax_tree/dsl.rb', line 729

def RegexpLiteral(beginning, ending, parts)
  RegexpLiteral.new(
    beginning: beginning,
    ending: ending,
    parts: parts,
    location: Location.default
  )
end

#Rescue(keyword, exception, statements, consequent) ⇒ Object

Create a new Rescue node.



748
749
750
751
752
753
754
755
756
# File 'lib/syntax_tree/dsl.rb', line 748

def Rescue(keyword, exception, statements, consequent)
  Rescue.new(
    keyword: keyword,
    exception: exception,
    statements: statements,
    consequent: consequent,
    location: Location.default
  )
end

#RescueEx(exceptions, variable) ⇒ Object

Create a new RescueEx node.



739
740
741
742
743
744
745
# File 'lib/syntax_tree/dsl.rb', line 739

def RescueEx(exceptions, variable)
  RescueEx.new(
    exceptions: exceptions,
    variable: variable,
    location: Location.default
  )
end

#RescueMod(statement, value) ⇒ Object

Create a new RescueMod node.



759
760
761
762
763
764
765
# File 'lib/syntax_tree/dsl.rb', line 759

def RescueMod(statement, value)
  RescueMod.new(
    statement: statement,
    value: value,
    location: Location.default
  )
end

#RestParam(name) ⇒ Object

Create a new RestParam node.



768
769
770
# File 'lib/syntax_tree/dsl.rb', line 768

def RestParam(name)
  RestParam.new(name: name, location: Location.default)
end

#RetryObject

Create a new Retry node.



773
774
775
# File 'lib/syntax_tree/dsl.rb', line 773

def Retry
  Retry.new(location: Location.default)
end

#ReturnNode(arguments) ⇒ Object

Create a new ReturnNode node.



778
779
780
# File 'lib/syntax_tree/dsl.rb', line 778

def ReturnNode(arguments)
  ReturnNode.new(arguments: arguments, location: Location.default)
end

#RParen(value) ⇒ Object

Create a new RParen node.



783
784
785
# File 'lib/syntax_tree/dsl.rb', line 783

def RParen(value)
  RParen.new(value: value, location: Location.default)
end

#SClass(target, bodystmt) ⇒ Object

Create a new SClass node.



788
789
790
# File 'lib/syntax_tree/dsl.rb', line 788

def SClass(target, bodystmt)
  SClass.new(target: target, bodystmt: bodystmt, location: Location.default)
end

#Statements(body) ⇒ Object

Create a new Statements node.



793
794
795
# File 'lib/syntax_tree/dsl.rb', line 793

def Statements(body)
  Statements.new(body: body, location: Location.default)
end

#StringConcat(left, right) ⇒ Object

Create a new StringConcat node.



803
804
805
# File 'lib/syntax_tree/dsl.rb', line 803

def StringConcat(left, right)
  StringConcat.new(left: left, right: right, location: Location.default)
end

#StringContent(parts) ⇒ Object

Create a new StringContent node.



798
799
800
# File 'lib/syntax_tree/dsl.rb', line 798

def StringContent(parts)
  StringContent.new(parts: parts, location: Location.default)
end

#StringDVar(variable) ⇒ Object

Create a new StringDVar node.



808
809
810
# File 'lib/syntax_tree/dsl.rb', line 808

def StringDVar(variable)
  StringDVar.new(variable: variable, location: Location.default)
end

#StringEmbExpr(statements) ⇒ Object

Create a new StringEmbExpr node.



813
814
815
# File 'lib/syntax_tree/dsl.rb', line 813

def StringEmbExpr(statements)
  StringEmbExpr.new(statements: statements, location: Location.default)
end

#StringLiteral(parts, quote) ⇒ Object

Create a new StringLiteral node.



818
819
820
# File 'lib/syntax_tree/dsl.rb', line 818

def StringLiteral(parts, quote)
  StringLiteral.new(parts: parts, quote: quote, location: Location.default)
end

#Super(arguments) ⇒ Object

Create a new Super node.



823
824
825
# File 'lib/syntax_tree/dsl.rb', line 823

def Super(arguments)
  Super.new(arguments: arguments, location: Location.default)
end

#SymBeg(value) ⇒ Object

Create a new SymBeg node.



828
829
830
# File 'lib/syntax_tree/dsl.rb', line 828

def SymBeg(value)
  SymBeg.new(value: value, location: Location.default)
end

#SymbolContent(value) ⇒ Object

Create a new SymbolContent node.



833
834
835
# File 'lib/syntax_tree/dsl.rb', line 833

def SymbolContent(value)
  SymbolContent.new(value: value, location: Location.default)
end

#SymbolLiteral(value) ⇒ Object

Create a new SymbolLiteral node.



838
839
840
# File 'lib/syntax_tree/dsl.rb', line 838

def SymbolLiteral(value)
  SymbolLiteral.new(value: value, location: Location.default)
end

#Symbols(beginning, elements) ⇒ Object

Create a new Symbols node.



843
844
845
846
847
848
849
# File 'lib/syntax_tree/dsl.rb', line 843

def Symbols(beginning, elements)
  Symbols.new(
    beginning: beginning,
    elements: elements,
    location: Location.default
  )
end

#SymbolsBeg(value) ⇒ Object

Create a new SymbolsBeg node.



852
853
854
# File 'lib/syntax_tree/dsl.rb', line 852

def SymbolsBeg(value)
  SymbolsBeg.new(value: value, location: Location.default)
end

#TLambda(value) ⇒ Object

Create a new TLambda node.



857
858
859
# File 'lib/syntax_tree/dsl.rb', line 857

def TLambda(value)
  TLambda.new(value: value, location: Location.default)
end

#TLamBeg(value) ⇒ Object

Create a new TLamBeg node.



862
863
864
# File 'lib/syntax_tree/dsl.rb', line 862

def TLamBeg(value)
  TLamBeg.new(value: value, location: Location.default)
end

#TopConstField(constant) ⇒ Object

Create a new TopConstField node.



867
868
869
# File 'lib/syntax_tree/dsl.rb', line 867

def TopConstField(constant)
  TopConstField.new(constant: constant, location: Location.default)
end

#TopConstRef(constant) ⇒ Object

Create a new TopConstRef node.



872
873
874
# File 'lib/syntax_tree/dsl.rb', line 872

def TopConstRef(constant)
  TopConstRef.new(constant: constant, location: Location.default)
end

#TStringBeg(value) ⇒ Object

Create a new TStringBeg node.



877
878
879
# File 'lib/syntax_tree/dsl.rb', line 877

def TStringBeg(value)
  TStringBeg.new(value: value, location: Location.default)
end

#TStringContent(value) ⇒ Object

Create a new TStringContent node.



882
883
884
# File 'lib/syntax_tree/dsl.rb', line 882

def TStringContent(value)
  TStringContent.new(value: value, location: Location.default)
end

#TStringEnd(value) ⇒ Object

Create a new TStringEnd node.



887
888
889
# File 'lib/syntax_tree/dsl.rb', line 887

def TStringEnd(value)
  TStringEnd.new(value: value, location: Location.default)
end

#Unary(operator, statement) ⇒ Object

Create a new Unary node.



901
902
903
904
905
906
907
# File 'lib/syntax_tree/dsl.rb', line 901

def Unary(operator, statement)
  Unary.new(
    operator: operator,
    statement: statement,
    location: Location.default
  )
end

#Undef(symbols) ⇒ Object

Create a new Undef node.



910
911
912
# File 'lib/syntax_tree/dsl.rb', line 910

def Undef(symbols)
  Undef.new(symbols: symbols, location: Location.default)
end

#UnlessNode(predicate, statements, consequent) ⇒ Object

Create a new UnlessNode node.



915
916
917
918
919
920
921
922
# File 'lib/syntax_tree/dsl.rb', line 915

def UnlessNode(predicate, statements, consequent)
  UnlessNode.new(
    predicate: predicate,
    statements: statements,
    consequent: consequent,
    location: Location.default
  )
end

#UntilNode(predicate, statements) ⇒ Object

Create a new UntilNode node.



925
926
927
928
929
930
931
# File 'lib/syntax_tree/dsl.rb', line 925

def UntilNode(predicate, statements)
  UntilNode.new(
    predicate: predicate,
    statements: statements,
    location: Location.default
  )
end

#VarField(value) ⇒ Object

Create a new VarField node.



934
935
936
# File 'lib/syntax_tree/dsl.rb', line 934

def VarField(value)
  VarField.new(value: value, location: Location.default)
end

#VarRef(value) ⇒ Object

Create a new VarRef node.



939
940
941
# File 'lib/syntax_tree/dsl.rb', line 939

def VarRef(value)
  VarRef.new(value: value, location: Location.default)
end

#VCall(value) ⇒ Object

Create a new VCall node.



949
950
951
# File 'lib/syntax_tree/dsl.rb', line 949

def VCall(value)
  VCall.new(value: value, location: Location.default)
end

#VoidStmtObject

Create a new VoidStmt node.



954
955
956
# File 'lib/syntax_tree/dsl.rb', line 954

def VoidStmt
  VoidStmt.new(location: Location.default)
end

#When(arguments, statements, consequent) ⇒ Object

Create a new When node.



959
960
961
962
963
964
965
966
# File 'lib/syntax_tree/dsl.rb', line 959

def When(arguments, statements, consequent)
  When.new(
    arguments: arguments,
    statements: statements,
    consequent: consequent,
    location: Location.default
  )
end

#WhileNode(predicate, statements) ⇒ Object

Create a new WhileNode node.



969
970
971
972
973
974
975
# File 'lib/syntax_tree/dsl.rb', line 969

def WhileNode(predicate, statements)
  WhileNode.new(
    predicate: predicate,
    statements: statements,
    location: Location.default
  )
end

#Word(parts) ⇒ Object

Create a new Word node.



978
979
980
# File 'lib/syntax_tree/dsl.rb', line 978

def Word(parts)
  Word.new(parts: parts, location: Location.default)
end

#Words(beginning, elements) ⇒ Object

Create a new Words node.



983
984
985
986
987
988
989
# File 'lib/syntax_tree/dsl.rb', line 983

def Words(beginning, elements)
  Words.new(
    beginning: beginning,
    elements: elements,
    location: Location.default
  )
end

#WordsBeg(value) ⇒ Object

Create a new WordsBeg node.



992
993
994
# File 'lib/syntax_tree/dsl.rb', line 992

def WordsBeg(value)
  WordsBeg.new(value: value, location: Location.default)
end

#XString(parts) ⇒ Object

Create a new XString node.



997
998
999
# File 'lib/syntax_tree/dsl.rb', line 997

def XString(parts)
  XString.new(parts: parts, location: Location.default)
end

#XStringLiteral(parts) ⇒ Object

Create a new XStringLiteral node.



1002
1003
1004
# File 'lib/syntax_tree/dsl.rb', line 1002

def XStringLiteral(parts)
  XStringLiteral.new(parts: parts, location: Location.default)
end

#YieldNode(arguments) ⇒ Object

Create a new YieldNode node.



1007
1008
1009
# File 'lib/syntax_tree/dsl.rb', line 1007

def YieldNode(arguments)
  YieldNode.new(arguments: arguments, location: Location.default)
end

#ZSuperObject

Create a new ZSuper node.



1012
1013
1014
# File 'lib/syntax_tree/dsl.rb', line 1012

def ZSuper
  ZSuper.new(location: Location.default)
end