Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

+ Benchmarking has moved into parslet-benchmarks

  • Loading branch information...
commit cbb8da9eafbf7b168963c766b573ac5af8c7e1bd 1 parent 5529d75
@kschiess authored
View
158 experiments/ansi_smalltalk.citrus
@@ -1,158 +0,0 @@
-grammar AnsiSmalltalk
- rule root
- (statements)
- end
- rule statements
- ((expressions) (separator_p) ("^" (expression) "."0*1)0*1)
- end
- rule expressions
- (((expression) ".")0* (expression)0*1)
- end
- rule separator_p
- (separator)0*1
- end
- rule expression
- ((assignment_expression) | (normal_expression))
- end
- rule separator
- ((comment) | (space))1*
- end
- rule assignment_expression
- ((separator_p) (assignment) (normal_expression))
- end
- rule normal_expression
- ((separator_p) ((cascaded_message_expression) | (message_expression) | (primary)) (separator_p))
- end
- rule comment
- ("\"" ("\"\"" | (!"\"" .))0* "\"")
- end
- rule space
- [\s]1*
- end
- rule assignment
- ((variable_name) (separator_p) (":=" | "_"))
- end
- rule cascaded_message_expression
- ((message_expression) (";" (separator_p) (message_send))1*)
- end
- rule message_expression
- ((keyword_expression) | (binary_expression) | (unary_expression))
- end
- rule primary
- ((literal) | (block) | (brace_expression) | ("(" (expression) ")") | (variable_name))
- end
- rule variable_name
- (bindable_identifier)
- end
- rule message_send
- ((keyword_send) | (binary_send) | (unary_send))
- end
- rule keyword_expression
- ((binary_object) (keyword_send))
- end
- rule binary_expression
- ((unary_object) ((separator_p) (binary_send))1*)
- end
- rule unary_expression
- ((primary) ((separator_p) (unary_send))1*)
- end
- rule literal
- ((character_constant) | (number) | (symbol_constant) | (string) | (array_constant) | (reserved_identifier))
- end
- rule block
- ("[" (separator_p) ((block_arguments)0*1 (separator_p) (code_body)) "]")
- end
- rule brace_expression
- ("{" (separator_p) ((expressions) (separator_p) (expression)0*1) (separator_p) "."0*1 (separator_p) "}")
- end
- rule bindable_identifier
- (!(reserved_identifier) (identifier))
- end
- rule keyword_send
- ((separator_p) (keyword) (separator_p) (binary_object))1*
- end
- rule binary_send
- ((binary_selector) (separator_p) (unary_object))
- end
- rule unary_send
- ((identifier) !(":" | (letter) | (digit)))
- end
- rule binary_object
- ((binary_expression) | (unary_object))
- end
- rule unary_object
- ((unary_expression) | (primary))
- end
- rule character_constant
- ("$" .)
- end
- rule number
- ((scaled_decimal) | (float) | (integer))
- end
- rule symbol_constant
- ("#" (symbol))
- end
- rule string
- ("'" ("''" | (!"'" .))0* "'")
- end
- rule array_constant
- ("#" (array))
- end
- rule reserved_identifier
- ("true" | "false" | "nil" | "self" | "super")
- end
- rule block_arguments
- (((separator_p) ":" (variable_name) (separator_p))1* "|")
- end
- rule code_body
- ((locals)0*1 (statements))
- end
- rule identifier
- ((letter) ((letter) | (digit) | "_")0*)
- end
- rule keyword
- ((identifier) ":")
- end
- rule binary_selector
- (("-"1* | (special)) (special)0*)
- end
- rule letter
- [A-Za-z]
- end
- rule digit
- [\d]
- end
- rule scaled_decimal
- (((decimal) ("." (digit)1*)0*1) "s" (decimal))
- end
- rule float
- ((scientific_float) | (normal_float))
- end
- rule integer
- ((radix) | (decimal))
- end
- rule symbol
- ((keyword)1* | (identifier) | (binary_selector) | (string))
- end
- rule array
- ("(" (((number) | (symbol_constant) | (symbol) | (string) | (character_constant) | (array_constant) | (array)) | (separator))0* ")")
- end
- rule locals
- ("|" (separator_p) ((variable_name) (separator_p))0* "|")
- end
- rule special
- ("+" | "*" | "/" | "\\" | "~" | "<" | ">" | "=" | "@" | "%" | "&" | "?" | "!" | "`" | "," | "|")
- end
- rule decimal
- ("-"0*1 (digit)1*)
- end
- rule scientific_float
- (((normal_float) | (integer)) [edq] (integer))
- end
- rule normal_float
- ((decimal) "." (digit)1*)
- end
- rule radix
- ((decimal) "r" ((digit) | (letter))1*)
- end
-end
View
3,084 experiments/ansi_smalltalk.rb
@@ -1,3084 +0,0 @@
-# Autogenerated from a Treetop grammar. Edits may be lost.
-
-
-module AnsiSmalltalk
- include Treetop::Runtime
-
- def root
- @root ||= :root
- end
-
- def _nt_root
- start_index = index
- if node_cache[:root].has_key?(index)
- cached = node_cache[:root][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- r0 = _nt_statements
-
- node_cache[:root][start_index] = r0
-
- r0
- end
-
- module Statements0
- end
-
- module Statements1
- end
-
- def _nt_statements
- start_index = index
- if node_cache[:statements].has_key?(index)
- cached = node_cache[:statements][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_expressions
- s0 << r1
- if r1
- r2 = _nt_separator_p
- s0 << r2
- if r2
- s3, i3 = [], index
- loop do
- i4, s4 = index, []
- if has_terminal?("^", false, index)
- r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("^")
- r5 = nil
- end
- s4 << r5
- if r5
- r6 = _nt_expression
- s4 << r6
- if r6
- s7, i7 = [], index
- loop do
- if has_terminal?(".", false, index)
- r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(".")
- r8 = nil
- end
- if r8
- s7 << r8
- else
- break
- end
- if s7.size == 1
- break
- end
- end
- r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
- s4 << r7
- end
- end
- if s4.last
- r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
- r4.extend(Statements0)
- else
- @index = i4
- r4 = nil
- end
- if r4
- s3 << r4
- else
- break
- end
- if s3.size == 1
- break
- end
- end
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- s0 << r3
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Statements1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:statements][start_index] = r0
-
- r0
- end
-
- module Expressions0
- end
-
- module Expressions1
- end
-
- def _nt_expressions
- start_index = index
- if node_cache[:expressions].has_key?(index)
- cached = node_cache[:expressions][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- s1, i1 = [], index
- loop do
- i2, s2 = index, []
- r3 = _nt_expression
- s2 << r3
- if r3
- if has_terminal?(".", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(".")
- r4 = nil
- end
- s2 << r4
- end
- if s2.last
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- r2.extend(Expressions0)
- else
- @index = i2
- r2 = nil
- end
- if r2
- s1 << r2
- else
- break
- end
- end
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
- s0 << r1
- if r1
- s5, i5 = [], index
- loop do
- r6 = _nt_expression
- if r6
- s5 << r6
- else
- break
- end
- if s5.size == 1
- break
- end
- end
- r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
- s0 << r5
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Expressions1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:expressions][start_index] = r0
-
- r0
- end
-
- def _nt_separator_p
- start_index = index
- if node_cache[:separator_p].has_key?(index)
- cached = node_cache[:separator_p][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- s0, i0 = [], index
- loop do
- r1 = _nt_separator
- if r1
- s0 << r1
- else
- break
- end
- if s0.size == 1
- break
- end
- end
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
-
- node_cache[:separator_p][start_index] = r0
-
- r0
- end
-
- def _nt_expression
- start_index = index
- if node_cache[:expression].has_key?(index)
- cached = node_cache[:expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_assignment_expression
- if r1
- r0 = r1
- else
- r2 = _nt_normal_expression
- if r2
- r0 = r2
- else
- @index = i0
- r0 = nil
- end
- end
-
- node_cache[:expression][start_index] = r0
-
- r0
- end
-
- def _nt_separator
- start_index = index
- if node_cache[:separator].has_key?(index)
- cached = node_cache[:separator][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- s0, i0 = [], index
- loop do
- i1 = index
- r2 = _nt_comment
- if r2
- r1 = r2
- else
- r3 = _nt_space
- if r3
- r1 = r3
- else
- @index = i1
- r1 = nil
- end
- end
- if r1
- s0 << r1
- else
- break
- end
- end
- if s0.size < 1
- @index = i0
- r0 = nil
- else
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- end
-
- node_cache[:separator][start_index] = r0
-
- r0
- end
-
- module AssignmentExpression0
- end
-
- def _nt_assignment_expression
- start_index = index
- if node_cache[:assignment_expression].has_key?(index)
- cached = node_cache[:assignment_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_separator_p
- s0 << r1
- if r1
- r2 = _nt_assignment
- s0 << r2
- if r2
- r3 = _nt_normal_expression
- s0 << r3
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(AssignmentExpression0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:assignment_expression][start_index] = r0
-
- r0
- end
-
- module NormalExpression0
- end
-
- def _nt_normal_expression
- start_index = index
- if node_cache[:normal_expression].has_key?(index)
- cached = node_cache[:normal_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_separator_p
- s0 << r1
- if r1
- i2 = index
- r3 = _nt_cascaded_message_expression
- if r3
- r2 = r3
- else
- r4 = _nt_message_expression
- if r4
- r2 = r4
- else
- r5 = _nt_primary
- if r5
- r2 = r5
- else
- @index = i2
- r2 = nil
- end
- end
- end
- s0 << r2
- if r2
- r6 = _nt_separator_p
- s0 << r6
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(NormalExpression0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:normal_expression][start_index] = r0
-
- r0
- end
-
- module Comment0
- end
-
- module Comment1
- end
-
- def _nt_comment
- start_index = index
- if node_cache[:comment].has_key?(index)
- cached = node_cache[:comment][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("\"", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("\"")
- r1 = nil
- end
- s0 << r1
- if r1
- s2, i2 = [], index
- loop do
- i3 = index
- if has_terminal?("\"\"", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
- @index += 2
- else
- terminal_parse_failure("\"\"")
- r4 = nil
- end
- if r4
- r3 = r4
- else
- i5, s5 = index, []
- i6 = index
- if has_terminal?("\"", false, index)
- r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("\"")
- r7 = nil
- end
- if r7
- r6 = nil
- else
- @index = i6
- r6 = instantiate_node(SyntaxNode,input, index...index)
- end
- s5 << r6
- if r6
- if index < input_length
- r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("any character")
- r8 = nil
- end
- s5 << r8
- end
- if s5.last
- r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
- r5.extend(Comment0)
- else
- @index = i5
- r5 = nil
- end
- if r5
- r3 = r5
- else
- @index = i3
- r3 = nil
- end
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- s0 << r2
- if r2
- if has_terminal?("\"", false, index)
- r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("\"")
- r9 = nil
- end
- s0 << r9
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Comment1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:comment][start_index] = r0
-
- r0
- end
-
- def _nt_space
- start_index = index
- if node_cache[:space].has_key?(index)
- cached = node_cache[:space][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- s0, i0 = [], index
- loop do
- if has_terminal?('\G[\\s]', true, index)
- r1 = true
- @index += 1
- else
- r1 = nil
- end
- if r1
- s0 << r1
- else
- break
- end
- end
- if s0.size < 1
- @index = i0
- r0 = nil
- else
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- end
-
- node_cache[:space][start_index] = r0
-
- r0
- end
-
- module Assignment0
- end
-
- def _nt_assignment
- start_index = index
- if node_cache[:assignment].has_key?(index)
- cached = node_cache[:assignment][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_variable_name
- s0 << r1
- if r1
- r2 = _nt_separator_p
- s0 << r2
- if r2
- i3 = index
- if has_terminal?(":=", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
- @index += 2
- else
- terminal_parse_failure(":=")
- r4 = nil
- end
- if r4
- r3 = r4
- else
- if has_terminal?("_", false, index)
- r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("_")
- r5 = nil
- end
- if r5
- r3 = r5
- else
- @index = i3
- r3 = nil
- end
- end
- s0 << r3
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Assignment0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:assignment][start_index] = r0
-
- r0
- end
-
- module CascadedMessageExpression0
- end
-
- module CascadedMessageExpression1
- end
-
- def _nt_cascaded_message_expression
- start_index = index
- if node_cache[:cascaded_message_expression].has_key?(index)
- cached = node_cache[:cascaded_message_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_message_expression
- s0 << r1
- if r1
- s2, i2 = [], index
- loop do
- i3, s3 = index, []
- if has_terminal?(";", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(";")
- r4 = nil
- end
- s3 << r4
- if r4
- r5 = _nt_separator_p
- s3 << r5
- if r5
- r6 = _nt_message_send
- s3 << r6
- end
- end
- if s3.last
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- r3.extend(CascadedMessageExpression0)
- else
- @index = i3
- r3 = nil
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- if s2.size < 1
- @index = i2
- r2 = nil
- else
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- end
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(CascadedMessageExpression1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:cascaded_message_expression][start_index] = r0
-
- r0
- end
-
- def _nt_message_expression
- start_index = index
- if node_cache[:message_expression].has_key?(index)
- cached = node_cache[:message_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_keyword_expression
- if r1
- r0 = r1
- else
- r2 = _nt_binary_expression
- if r2
- r0 = r2
- else
- r3 = _nt_unary_expression
- if r3
- r0 = r3
- else
- @index = i0
- r0 = nil
- end
- end
- end
-
- node_cache[:message_expression][start_index] = r0
-
- r0
- end
-
- module Primary0
- end
-
- def _nt_primary
- start_index = index
- if node_cache[:primary].has_key?(index)
- cached = node_cache[:primary][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_literal
- if r1
- r0 = r1
- else
- r2 = _nt_block
- if r2
- r0 = r2
- else
- r3 = _nt_brace_expression
- if r3
- r0 = r3
- else
- i4, s4 = index, []
- if has_terminal?("(", false, index)
- r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("(")
- r5 = nil
- end
- s4 << r5
- if r5
- r6 = _nt_expression
- s4 << r6
- if r6
- if has_terminal?(")", false, index)
- r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(")")
- r7 = nil
- end
- s4 << r7
- end
- end
- if s4.last
- r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
- r4.extend(Primary0)
- else
- @index = i4
- r4 = nil
- end
- if r4
- r0 = r4
- else
- r8 = _nt_variable_name
- if r8
- r0 = r8
- else
- @index = i0
- r0 = nil
- end
- end
- end
- end
- end
-
- node_cache[:primary][start_index] = r0
-
- r0
- end
-
- def _nt_variable_name
- start_index = index
- if node_cache[:variable_name].has_key?(index)
- cached = node_cache[:variable_name][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- r0 = _nt_bindable_identifier
-
- node_cache[:variable_name][start_index] = r0
-
- r0
- end
-
- def _nt_message_send
- start_index = index
- if node_cache[:message_send].has_key?(index)
- cached = node_cache[:message_send][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_keyword_send
- if r1
- r0 = r1
- else
- r2 = _nt_binary_send
- if r2
- r0 = r2
- else
- r3 = _nt_unary_send
- if r3
- r0 = r3
- else
- @index = i0
- r0 = nil
- end
- end
- end
-
- node_cache[:message_send][start_index] = r0
-
- r0
- end
-
- module KeywordExpression0
- end
-
- def _nt_keyword_expression
- start_index = index
- if node_cache[:keyword_expression].has_key?(index)
- cached = node_cache[:keyword_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_binary_object
- s0 << r1
- if r1
- r2 = _nt_keyword_send
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(KeywordExpression0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:keyword_expression][start_index] = r0
-
- r0
- end
-
- module BinaryExpression0
- end
-
- module BinaryExpression1
- end
-
- def _nt_binary_expression
- start_index = index
- if node_cache[:binary_expression].has_key?(index)
- cached = node_cache[:binary_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_unary_object
- s0 << r1
- if r1
- s2, i2 = [], index
- loop do
- i3, s3 = index, []
- r4 = _nt_separator_p
- s3 << r4
- if r4
- r5 = _nt_binary_send
- s3 << r5
- end
- if s3.last
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- r3.extend(BinaryExpression0)
- else
- @index = i3
- r3 = nil
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- if s2.size < 1
- @index = i2
- r2 = nil
- else
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- end
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(BinaryExpression1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:binary_expression][start_index] = r0
-
- r0
- end
-
- module UnaryExpression0
- end
-
- module UnaryExpression1
- end
-
- def _nt_unary_expression
- start_index = index
- if node_cache[:unary_expression].has_key?(index)
- cached = node_cache[:unary_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_primary
- s0 << r1
- if r1
- s2, i2 = [], index
- loop do
- i3, s3 = index, []
- r4 = _nt_separator_p
- s3 << r4
- if r4
- r5 = _nt_unary_send
- s3 << r5
- end
- if s3.last
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- r3.extend(UnaryExpression0)
- else
- @index = i3
- r3 = nil
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- if s2.size < 1
- @index = i2
- r2 = nil
- else
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- end
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(UnaryExpression1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:unary_expression][start_index] = r0
-
- r0
- end
-
- def _nt_literal
- start_index = index
- if node_cache[:literal].has_key?(index)
- cached = node_cache[:literal][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_character_constant
- if r1
- r0 = r1
- else
- r2 = _nt_number
- if r2
- r0 = r2
- else
- r3 = _nt_symbol_constant
- if r3
- r0 = r3
- else
- r4 = _nt_string
- if r4
- r0 = r4
- else
- r5 = _nt_array_constant
- if r5
- r0 = r5
- else
- r6 = _nt_reserved_identifier
- if r6
- r0 = r6
- else
- @index = i0
- r0 = nil
- end
- end
- end
- end
- end
- end
-
- node_cache[:literal][start_index] = r0
-
- r0
- end
-
- module Block0
- end
-
- module Block1
- end
-
- def _nt_block
- start_index = index
- if node_cache[:block].has_key?(index)
- cached = node_cache[:block][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("[", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("[")
- r1 = nil
- end
- s0 << r1
- if r1
- r2 = _nt_separator_p
- s0 << r2
- if r2
- i3, s3 = index, []
- s4, i4 = [], index
- loop do
- r5 = _nt_block_arguments
- if r5
- s4 << r5
- else
- break
- end
- if s4.size == 1
- break
- end
- end
- r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
- s3 << r4
- if r4
- r6 = _nt_separator_p
- s3 << r6
- if r6
- r7 = _nt_code_body
- s3 << r7
- end
- end
- if s3.last
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- r3.extend(Block0)
- else
- @index = i3
- r3 = nil
- end
- s0 << r3
- if r3
- if has_terminal?("]", false, index)
- r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("]")
- r8 = nil
- end
- s0 << r8
- end
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Block1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:block][start_index] = r0
-
- r0
- end
-
- module BraceExpression0
- end
-
- module BraceExpression1
- end
-
- def _nt_brace_expression
- start_index = index
- if node_cache[:brace_expression].has_key?(index)
- cached = node_cache[:brace_expression][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("{", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("{")
- r1 = nil
- end
- s0 << r1
- if r1
- r2 = _nt_separator_p
- s0 << r2
- if r2
- i3, s3 = index, []
- r4 = _nt_expressions
- s3 << r4
- if r4
- r5 = _nt_separator_p
- s3 << r5
- if r5
- s6, i6 = [], index
- loop do
- r7 = _nt_expression
- if r7
- s6 << r7
- else
- break
- end
- if s6.size == 1
- break
- end
- end
- r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
- s3 << r6
- end
- end
- if s3.last
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- r3.extend(BraceExpression0)
- else
- @index = i3
- r3 = nil
- end
- s0 << r3
- if r3
- r8 = _nt_separator_p
- s0 << r8
- if r8
- s9, i9 = [], index
- loop do
- if has_terminal?(".", false, index)
- r10 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(".")
- r10 = nil
- end
- if r10
- s9 << r10
- else
- break
- end
- if s9.size == 1
- break
- end
- end
- r9 = instantiate_node(SyntaxNode,input, i9...index, s9)
- s0 << r9
- if r9
- r11 = _nt_separator_p
- s0 << r11
- if r11
- if has_terminal?("}", false, index)
- r12 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("}")
- r12 = nil
- end
- s0 << r12
- end
- end
- end
- end
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(BraceExpression1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:brace_expression][start_index] = r0
-
- r0
- end
-
- module BindableIdentifier0
- end
-
- def _nt_bindable_identifier
- start_index = index
- if node_cache[:bindable_identifier].has_key?(index)
- cached = node_cache[:bindable_identifier][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- i1 = index
- r2 = _nt_reserved_identifier
- if r2
- r1 = nil
- else
- @index = i1
- r1 = instantiate_node(SyntaxNode,input, index...index)
- end
- s0 << r1
- if r1
- r3 = _nt_identifier
- s0 << r3
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(BindableIdentifier0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:bindable_identifier][start_index] = r0
-
- r0
- end
-
- module KeywordSend0
- end
-
- def _nt_keyword_send
- start_index = index
- if node_cache[:keyword_send].has_key?(index)
- cached = node_cache[:keyword_send][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- s0, i0 = [], index
- loop do
- i1, s1 = index, []
- r2 = _nt_separator_p
- s1 << r2
- if r2
- r3 = _nt_keyword
- s1 << r3
- if r3
- r4 = _nt_separator_p
- s1 << r4
- if r4
- r5 = _nt_binary_object
- s1 << r5
- end
- end
- end
- if s1.last
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
- r1.extend(KeywordSend0)
- else
- @index = i1
- r1 = nil
- end
- if r1
- s0 << r1
- else
- break
- end
- end
- if s0.size < 1
- @index = i0
- r0 = nil
- else
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- end
-
- node_cache[:keyword_send][start_index] = r0
-
- r0
- end
-
- module BinarySend0
- end
-
- def _nt_binary_send
- start_index = index
- if node_cache[:binary_send].has_key?(index)
- cached = node_cache[:binary_send][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_binary_selector
- s0 << r1
- if r1
- r2 = _nt_separator_p
- s0 << r2
- if r2
- r3 = _nt_unary_object
- s0 << r3
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(BinarySend0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:binary_send][start_index] = r0
-
- r0
- end
-
- module UnarySend0
- end
-
- def _nt_unary_send
- start_index = index
- if node_cache[:unary_send].has_key?(index)
- cached = node_cache[:unary_send][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_identifier
- s0 << r1
- if r1
- i2 = index
- i3 = index
- if has_terminal?(":", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(":")
- r4 = nil
- end
- if r4
- r3 = r4
- else
- r5 = _nt_letter
- if r5
- r3 = r5
- else
- r6 = _nt_digit
- if r6
- r3 = r6
- else
- @index = i3
- r3 = nil
- end
- end
- end
- if r3
- r2 = nil
- else
- @index = i2
- r2 = instantiate_node(SyntaxNode,input, index...index)
- end
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(UnarySend0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:unary_send][start_index] = r0
-
- r0
- end
-
- def _nt_binary_object
- start_index = index
- if node_cache[:binary_object].has_key?(index)
- cached = node_cache[:binary_object][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_binary_expression
- if r1
- r0 = r1
- else
- r2 = _nt_unary_object
- if r2
- r0 = r2
- else
- @index = i0
- r0 = nil
- end
- end
-
- node_cache[:binary_object][start_index] = r0
-
- r0
- end
-
- def _nt_unary_object
- start_index = index
- if node_cache[:unary_object].has_key?(index)
- cached = node_cache[:unary_object][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_unary_expression
- if r1
- r0 = r1
- else
- r2 = _nt_primary
- if r2
- r0 = r2
- else
- @index = i0
- r0 = nil
- end
- end
-
- node_cache[:unary_object][start_index] = r0
-
- r0
- end
-
- module CharacterConstant0
- end
-
- def _nt_character_constant
- start_index = index
- if node_cache[:character_constant].has_key?(index)
- cached = node_cache[:character_constant][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("$", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("$")
- r1 = nil
- end
- s0 << r1
- if r1
- if index < input_length
- r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("any character")
- r2 = nil
- end
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(CharacterConstant0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:character_constant][start_index] = r0
-
- r0
- end
-
- def _nt_number
- start_index = index
- if node_cache[:number].has_key?(index)
- cached = node_cache[:number][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_scaled_decimal
- if r1
- r0 = r1
- else
- r2 = _nt_float
- if r2
- r0 = r2
- else
- r3 = _nt_integer
- if r3
- r0 = r3
- else
- @index = i0
- r0 = nil
- end
- end
- end
-
- node_cache[:number][start_index] = r0
-
- r0
- end
-
- module SymbolConstant0
- end
-
- def _nt_symbol_constant
- start_index = index
- if node_cache[:symbol_constant].has_key?(index)
- cached = node_cache[:symbol_constant][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("#", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("#")
- r1 = nil
- end
- s0 << r1
- if r1
- r2 = _nt_symbol
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(SymbolConstant0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:symbol_constant][start_index] = r0
-
- r0
- end
-
- module String0
- end
-
- module String1
- end
-
- def _nt_string
- start_index = index
- if node_cache[:string].has_key?(index)
- cached = node_cache[:string][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("'", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("'")
- r1 = nil
- end
- s0 << r1
- if r1
- s2, i2 = [], index
- loop do
- i3 = index
- if has_terminal?("''", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 2))
- @index += 2
- else
- terminal_parse_failure("''")
- r4 = nil
- end
- if r4
- r3 = r4
- else
- i5, s5 = index, []
- i6 = index
- if has_terminal?("'", false, index)
- r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("'")
- r7 = nil
- end
- if r7
- r6 = nil
- else
- @index = i6
- r6 = instantiate_node(SyntaxNode,input, index...index)
- end
- s5 << r6
- if r6
- if index < input_length
- r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("any character")
- r8 = nil
- end
- s5 << r8
- end
- if s5.last
- r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
- r5.extend(String0)
- else
- @index = i5
- r5 = nil
- end
- if r5
- r3 = r5
- else
- @index = i3
- r3 = nil
- end
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- s0 << r2
- if r2
- if has_terminal?("'", false, index)
- r9 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("'")
- r9 = nil
- end
- s0 << r9
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(String1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:string][start_index] = r0
-
- r0
- end
-
- module ArrayConstant0
- end
-
- def _nt_array_constant
- start_index = index
- if node_cache[:array_constant].has_key?(index)
- cached = node_cache[:array_constant][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- if has_terminal?("#", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("#")
- r1 = nil
- end
- s0 << r1
- if r1
- r2 = _nt_array
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(ArrayConstant0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:array_constant][start_index] = r0
-
- r0
- end
-
- def _nt_reserved_identifier
- start_index = index
- if node_cache[:reserved_identifier].has_key?(index)
- cached = node_cache[:reserved_identifier][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- if has_terminal?("true", false, index)
- r1 = instantiate_node(SyntaxNode,input, index...(index + 4))
- @index += 4
- else
- terminal_parse_failure("true")
- r1 = nil
- end
- if r1
- r0 = r1
- else
- if has_terminal?("false", false, index)
- r2 = instantiate_node(SyntaxNode,input, index...(index + 5))
- @index += 5
- else
- terminal_parse_failure("false")
- r2 = nil
- end
- if r2
- r0 = r2
- else
- if has_terminal?("nil", false, index)
- r3 = instantiate_node(SyntaxNode,input, index...(index + 3))
- @index += 3
- else
- terminal_parse_failure("nil")
- r3 = nil
- end
- if r3
- r0 = r3
- else
- if has_terminal?("self", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 4))
- @index += 4
- else
- terminal_parse_failure("self")
- r4 = nil
- end
- if r4
- r0 = r4
- else
- if has_terminal?("super", false, index)
- r5 = instantiate_node(SyntaxNode,input, index...(index + 5))
- @index += 5
- else
- terminal_parse_failure("super")
- r5 = nil
- end
- if r5
- r0 = r5
- else
- @index = i0
- r0 = nil
- end
- end
- end
- end
- end
-
- node_cache[:reserved_identifier][start_index] = r0
-
- r0
- end
-
- module BlockArguments0
- end
-
- module BlockArguments1
- end
-
- def _nt_block_arguments
- start_index = index
- if node_cache[:block_arguments].has_key?(index)
- cached = node_cache[:block_arguments][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- s1, i1 = [], index
- loop do
- i2, s2 = index, []
- r3 = _nt_separator_p
- s2 << r3
- if r3
- if has_terminal?(":", false, index)
- r4 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(":")
- r4 = nil
- end
- s2 << r4
- if r4
- r5 = _nt_variable_name
- s2 << r5
- if r5
- r6 = _nt_separator_p
- s2 << r6
- end
- end
- end
- if s2.last
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- r2.extend(BlockArguments0)
- else
- @index = i2
- r2 = nil
- end
- if r2
- s1 << r2
- else
- break
- end
- end
- if s1.size < 1
- @index = i1
- r1 = nil
- else
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
- end
- s0 << r1
- if r1
- if has_terminal?("|", false, index)
- r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("|")
- r7 = nil
- end
- s0 << r7
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(BlockArguments1)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:block_arguments][start_index] = r0
-
- r0
- end
-
- module CodeBody0
- end
-
- def _nt_code_body
- start_index = index
- if node_cache[:code_body].has_key?(index)
- cached = node_cache[:code_body][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- s1, i1 = [], index
- loop do
- r2 = _nt_locals
- if r2
- s1 << r2
- else
- break
- end
- if s1.size == 1
- break
- end
- end
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
- s0 << r1
- if r1
- r3 = _nt_statements
- s0 << r3
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(CodeBody0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:code_body][start_index] = r0
-
- r0
- end
-
- module Identifier0
- end
-
- def _nt_identifier
- start_index = index
- if node_cache[:identifier].has_key?(index)
- cached = node_cache[:identifier][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_letter
- s0 << r1
- if r1
- s2, i2 = [], index
- loop do
- i3 = index
- r4 = _nt_letter
- if r4
- r3 = r4
- else
- r5 = _nt_digit
- if r5
- r3 = r5
- else
- if has_terminal?("_", false, index)
- r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("_")
- r6 = nil
- end
- if r6
- r3 = r6
- else
- @index = i3
- r3 = nil
- end
- end
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Identifier0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:identifier][start_index] = r0
-
- r0
- end
-
- module Keyword0
- end
-
- def _nt_keyword
- start_index = index
- if node_cache[:keyword].has_key?(index)
- cached = node_cache[:keyword][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- r1 = _nt_identifier
- s0 << r1
- if r1
- if has_terminal?(":", false, index)
- r2 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(":")
- r2 = nil
- end
- s0 << r2
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(Keyword0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:keyword][start_index] = r0
-
- r0
- end
-
- module BinarySelector0
- end
-
- def _nt_binary_selector
- start_index = index
- if node_cache[:binary_selector].has_key?(index)
- cached = node_cache[:binary_selector][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- i1 = index
- s2, i2 = [], index
- loop do
- if has_terminal?("-", false, index)
- r3 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("-")
- r3 = nil
- end
- if r3
- s2 << r3
- else
- break
- end
- end
- if s2.size < 1
- @index = i2
- r2 = nil
- else
- r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
- end
- if r2
- r1 = r2
- else
- r4 = _nt_special
- if r4
- r1 = r4
- else
- @index = i1
- r1 = nil
- end
- end
- s0 << r1
- if r1
- s5, i5 = [], index
- loop do
- r6 = _nt_special
- if r6
- s5 << r6
- else
- break
- end
- end
- r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
- s0 << r5
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(BinarySelector0)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:binary_selector][start_index] = r0
-
- r0
- end
-
- def _nt_letter
- start_index = index
- if node_cache[:letter].has_key?(index)
- cached = node_cache[:letter][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- if has_terminal?('\G[A-Za-z]', true, index)
- r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- r0 = nil
- end
-
- node_cache[:letter][start_index] = r0
-
- r0
- end
-
- def _nt_digit
- start_index = index
- if node_cache[:digit].has_key?(index)
- cached = node_cache[:digit][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- if has_terminal?('\G[\\d]', true, index)
- r0 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- r0 = nil
- end
-
- node_cache[:digit][start_index] = r0
-
- r0
- end
-
- module ScaledDecimal0
- end
-
- module ScaledDecimal1
- end
-
- module ScaledDecimal2
- end
-
- def _nt_scaled_decimal
- start_index = index
- if node_cache[:scaled_decimal].has_key?(index)
- cached = node_cache[:scaled_decimal][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0, s0 = index, []
- i1, s1 = index, []
- r2 = _nt_decimal
- s1 << r2
- if r2
- s3, i3 = [], index
- loop do
- i4, s4 = index, []
- if has_terminal?(".", false, index)
- r5 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure(".")
- r5 = nil
- end
- s4 << r5
- if r5
- s6, i6 = [], index
- loop do
- r7 = _nt_digit
- if r7
- s6 << r7
- else
- break
- end
- end
- if s6.size < 1
- @index = i6
- r6 = nil
- else
- r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
- end
- s4 << r6
- end
- if s4.last
- r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
- r4.extend(ScaledDecimal0)
- else
- @index = i4
- r4 = nil
- end
- if r4
- s3 << r4
- else
- break
- end
- if s3.size == 1
- break
- end
- end
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
- s1 << r3
- end
- if s1.last
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
- r1.extend(ScaledDecimal1)
- else
- @index = i1
- r1 = nil
- end
- s0 << r1
- if r1
- if has_terminal?("s", false, index)
- r8 = instantiate_node(SyntaxNode,input, index...(index + 1))
- @index += 1
- else
- terminal_parse_failure("s")
- r8 = nil
- end
- s0 << r8
- if r8
- r9 = _nt_decimal
- s0 << r9
- end
- end
- if s0.last
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
- r0.extend(ScaledDecimal2)
- else
- @index = i0
- r0 = nil
- end
-
- node_cache[:scaled_decimal][start_index] = r0
-
- r0
- end
-
- def _nt_float
- start_index = index
- if node_cache[:float].has_key?(index)
- cached = node_cache[:float][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_scientific_float
- if r1
- r0 = r1
- else
- r2 = _nt_normal_float
- if r2
- r0 = r2
- else
- @index = i0
- r0 = nil
- end
- end
-
- node_cache[:float][start_index] = r0
-
- r0
- end
-
- def _nt_integer
- start_index = index
- if node_cache[:integer].has_key?(index)
- cached = node_cache[:integer][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- r1 = _nt_radix
- if r1
- r0 = r1
- else
- r2 = _nt_decimal
- if r2
- r0 = r2
- else
- @index = i0
- r0 = nil
- end
- end
-
- node_cache[:integer][start_index] = r0
-
- r0
- end
-
- def _nt_symbol
- start_index = index
- if node_cache[:symbol].has_key?(index)
- cached = node_cache[:symbol][index]
- if cached
- cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
- @index = cached.interval.end
- end
- return cached
- end
-
- i0 = index
- s1, i1 = [], index
- loop do
- r2 = _nt_keyword
- if r2
- s1 << r2
- else
- break
- end
- end
- if s1.size < 1
- @index = i1
- r1 = nil
- else
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
- end
- if r1
- r0 = r1
- else
- r3 = _nt_identifier
- if r3
- r0 = r3
- else
- r4 = _nt_binary_selector
- if r4
- r0 = r4
- else
- r5 = _nt_string
- if r5
- r0 = r5
- else
- @index = i0
- r0 = nil
- end
- end
- end
- end
-
- node_cache[:symbol][start_index] = r0
-
- r0
- end
-
- module Array0
- end
-
- def _nt_array
- start_index = index
- if node_cache[:array].has_key?(index)