Module: OracleSqlParser::Grammar::Expression::Placeholder

Includes:
Treetop::Runtime
Included in:
PlaceholderParser
Defined in:
lib/oracle-sql-parser/grammar/expression/placeholder.rb

Defined Under Namespace

Modules: PlaceholderExpression0, PlaceholderExpression1, PlaceholderExpression2, PlaceholderExpression3

Instance Method Summary collapse

Instance Method Details

#_nt_placeholder_expressionObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/oracle-sql-parser/grammar/expression/placeholder.rb', line 56

def _nt_placeholder_expression
  start_index = index
  if node_cache[:placeholder_expression].has_key?(index)
    cached = node_cache[:placeholder_expression][index]
    if cached
      node_cache[:placeholder_expression][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
      @index = cached.interval.end
    end
    return cached
  end

  i0, s0 = index, []
  if (match_len = has_terminal?(':', false, index))
    r1 = true
    @index += match_len
  else
    terminal_parse_failure('\':\'')
    r1 = nil
  end
  s0 << r1
  if r1
    r2 = _nt_ident
    s0 << r2
    if r2
      i4, s4 = index, []
      i6, s6 = index, []
      r7 = _nt_space
      s6 << r7
      if r7
        r8 = _nt_indicator_keyword
        s6 << r8
      end
      if s6.last
        r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
        r6.extend(PlaceholderExpression0)
      else
        @index = i6
        r6 = nil
      end
      if r6
        r5 = r6
      else
        r5 = instantiate_node(SyntaxNode,input, index...index)
      end
      s4 << r5
      if r5
        r9 = _nt_space
        s4 << r9
        if r9
          if (match_len = has_terminal?(':', false, index))
            r10 = true
            @index += match_len
          else
            terminal_parse_failure('\':\'')
            r10 = nil
          end
          s4 << r10
          if r10
            r11 = _nt_ident
            s4 << r11
          end
        end
      end
      if s4.last
        r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
        r4.extend(PlaceholderExpression1)
      else
        @index = i4
        r4 = nil
      end
      if r4
        r3 = r4
      else
        r3 = instantiate_node(SyntaxNode,input, index...index)
      end
      s0 << r3
    end
  end
  if s0.last
    r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
    r0.extend(PlaceholderExpression2)
    r0.extend(PlaceholderExpression3)
  else
    @index = i0
    r0 = nil
  end

  node_cache[:placeholder_expression][start_index] = r0

  r0
end

#rootObject



8
9
10
# File 'lib/oracle-sql-parser/grammar/expression/placeholder.rb', line 8

def root
  @root ||= :placeholder_expression
end