Module: BELParser::Parsers::AST::Sexp

Overview

Sexp defines a module that creates AST nodes using S-expression syntax.

See Also:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(&block) ⇒ Object

Raises:

  • (ArgumentError)


976
977
978
979
980
981
# File 'lib/bel_parser/parsers/ast/node.rb', line 976

def self.build(&block)
  raise ArgumentError, 'expecting block' unless block_given?

  builder = _builder_class.new
  builder.instance_eval(&block)
end

Instance Method Details

#annotation_definition(*children, **props) ⇒ Object



1090
1091
1092
# File 'lib/bel_parser/parsers/ast/node.rb', line 1090

def annotation_definition(*children, **props)
  AnnotationDefinition.new(children, props)
end

#argument(*children, **props) ⇒ Object



1026
1027
1028
# File 'lib/bel_parser/parsers/ast/node.rb', line 1026

def argument(*children, **props)
  Argument.new(children, props)
end

#blank_lineObject



1074
1075
1076
# File 'lib/bel_parser/parsers/ast/node.rb', line 1074

def blank_line
  BlankLine.new([], complete: true)
end

#comment(*children, **props) ⇒ Object



1066
1067
1068
# File 'lib/bel_parser/parsers/ast/node.rb', line 1066

def comment(*children, **props)
  Comment.new(children, props)
end

#comment_line(*children, **props) ⇒ Object



1070
1071
1072
# File 'lib/bel_parser/parsers/ast/node.rb', line 1070

def comment_line(*children, **props)
  CommentLine.new(children, props)
end

#document_property(*children, **props) ⇒ Object



1086
1087
1088
# File 'lib/bel_parser/parsers/ast/node.rb', line 1086

def document_property(*children, **props)
  DocumentProperty.new(children, props)
end

#domain(*children, **props) ⇒ Object



1102
1103
1104
# File 'lib/bel_parser/parsers/ast/node.rb', line 1102

def domain(*children, **props)
  Domain.new(children, props)
end

#function(*children, **props) ⇒ Object



1022
1023
1024
# File 'lib/bel_parser/parsers/ast/node.rb', line 1022

def function(*children, **props)
  Function.new(children, props)
end

#identifier(*children, **props) ⇒ Object



1046
1047
1048
# File 'lib/bel_parser/parsers/ast/node.rb', line 1046

def identifier(*children, **props)
  Identifier.new(children, props)
end

#keyword(*children, **props) ⇒ Object



1098
1099
1100
# File 'lib/bel_parser/parsers/ast/node.rb', line 1098

def keyword(*children, **props)
  Keyword.new(children, props)
end

#list(*children, **props) ⇒ Object



1058
1059
1060
# File 'lib/bel_parser/parsers/ast/node.rb', line 1058

def list(*children, **props)
  List.new(children, props)
end

#list_item(*children, **props) ⇒ Object



1062
1063
1064
# File 'lib/bel_parser/parsers/ast/node.rb', line 1062

def list_item(*children, **props)
  ListItem.new(children, props)
end

#multi_identifier(*children, **props) ⇒ Object



1050
1051
1052
# File 'lib/bel_parser/parsers/ast/node.rb', line 1050

def multi_identifier(*children, **props)
  MultiIdentifier.new(children, props)
end

#name(*children, **props) ⇒ Object



1038
1039
1040
# File 'lib/bel_parser/parsers/ast/node.rb', line 1038

def name(*children, **props)
  Name.new(children, props)
end

#namespace_definition(*children, **props) ⇒ Object



1094
1095
1096
# File 'lib/bel_parser/parsers/ast/node.rb', line 1094

def namespace_definition(*children, **props)
  NamespaceDefinition.new(children, props)
end

#nested_statement(*children, **props) ⇒ Object



990
991
992
# File 'lib/bel_parser/parsers/ast/node.rb', line 990

def nested_statement(*children, **props)
  NestedStatement.new(children, props)
end

#object(*children, **props) ⇒ Object



1010
1011
1012
# File 'lib/bel_parser/parsers/ast/node.rb', line 1010

def object(*children, **props)
  Object.new(children, props)
end

#observed_term(*children, **props) ⇒ Object



998
999
1000
# File 'lib/bel_parser/parsers/ast/node.rb', line 998

def observed_term(*children, **props)
  ObservedTerm.new(children, props)
end

#parameter(*children, **props) ⇒ Object



1030
1031
1032
# File 'lib/bel_parser/parsers/ast/node.rb', line 1030

def parameter(*children, **props)
  Parameter.new(children, props)
end

#pattern(*children, **props) ⇒ Object



1114
1115
1116
# File 'lib/bel_parser/parsers/ast/node.rb', line 1114

def pattern(*children, **props)
  Pattern.new(children, props)
end

#prefix(*children, **props) ⇒ Object



1034
1035
1036
# File 'lib/bel_parser/parsers/ast/node.rb', line 1034

def prefix(*children, **props)
  Prefix.new(children, props)
end

#relationship(*children, **props) ⇒ Object



1014
1015
1016
# File 'lib/bel_parser/parsers/ast/node.rb', line 1014

def relationship(*children, **props)
  Relationship.new(children, props)
end

#set(*children, **props) ⇒ Object



1078
1079
1080
# File 'lib/bel_parser/parsers/ast/node.rb', line 1078

def set(*children, **props)
  Set.new(children, props)
end

#simple_statement(*children, **props) ⇒ Object



994
995
996
# File 'lib/bel_parser/parsers/ast/node.rb', line 994

def simple_statement(*children, **props)
  SimpleStatement.new(children, props)
end

#statement(*children, **props) ⇒ Object



1002
1003
1004
# File 'lib/bel_parser/parsers/ast/node.rb', line 1002

def statement(*children, **props)
  Statement.new(children, props)
end

#string(*children, **props) ⇒ Object



1054
1055
1056
# File 'lib/bel_parser/parsers/ast/node.rb', line 1054

def string(*children, **props)
  String.new(children, props)
end

#subject(*children, **props) ⇒ Object



1006
1007
1008
# File 'lib/bel_parser/parsers/ast/node.rb', line 1006

def subject(*children, **props)
  Subject.new(children, props)
end

#term(*children, **props) ⇒ Object



1018
1019
1020
# File 'lib/bel_parser/parsers/ast/node.rb', line 1018

def term(*children, **props)
  Term.new(children, props)
end

#unset(*children, **props) ⇒ Object



1082
1083
1084
# File 'lib/bel_parser/parsers/ast/node.rb', line 1082

def unset(*children)
  Unset.new(children)
end

#uri(*children, **props) ⇒ Object



1110
1111
1112
# File 'lib/bel_parser/parsers/ast/node.rb', line 1110

def uri(*children, **props)
  Uri.new(children, props)
end

#url(*children, **props) ⇒ Object



1106
1107
1108
# File 'lib/bel_parser/parsers/ast/node.rb', line 1106

def url(*children, **props)
  Url.new(children, props)
end

#value(*children, **props) ⇒ Object



1042
1043
1044
# File 'lib/bel_parser/parsers/ast/node.rb', line 1042

def value(*children, **props)
  Value.new(children, props)
end