Module: OracleSqlParser::Grammar::Expression::Cursor

Includes:
Treetop::Runtime
Included in:
OracleSqlParser::Grammar::Expression, CursorParser
Defined in:
lib/oracle-sql-parser/grammar/expression/cursor.rb

Defined Under Namespace

Modules: CursorExpression0, CursorExpression1

Instance Method Summary collapse

Instance Method Details

#_nt_cursor_expressionObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
# File 'lib/oracle-sql-parser/grammar/expression/cursor.rb', line 32

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

  i0, s0 = index, []
  r1 = _nt_cursor_keyword
  s0 << r1
  if r1
    r3 = _nt_space
    if r3
      r2 = r3
    else
      r2 = instantiate_node(SyntaxNode,input, index...index)
    end
    s0 << r2
    if r2
      if (match_len = has_terminal?('(', false, index))
        r4 = true
        @index += match_len
      else
        terminal_parse_failure('\'(\'')
        r4 = nil
      end
      s0 << r4
      if r4
        r6 = _nt_space
        if r6
          r5 = r6
        else
          r5 = instantiate_node(SyntaxNode,input, index...index)
        end
        s0 << r5
        if r5
          r7 = _nt_subquery
          s0 << r7
          if r7
            r9 = _nt_space
            if r9
              r8 = r9
            else
              r8 = instantiate_node(SyntaxNode,input, index...index)
            end
            s0 << r8
            if r8
              if (match_len = has_terminal?(')', false, index))
                r10 = true
                @index += match_len
              else
                terminal_parse_failure('\')\'')
                r10 = nil
              end
              s0 << r10
            end
          end
        end
      end
    end
  end
  if s0.last
    r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
    r0.extend(CursorExpression0)
    r0.extend(CursorExpression1)
  else
    @index = i0
    r0 = nil
  end

  node_cache[:cursor_expression][start_index] = r0

  r0
end

#rootObject



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

def root
  @root ||= :cursor_expression
end