• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

georgia-tech-db / eva / #758

04 Sep 2023 08:37PM UTC coverage: 0.0% (-78.3%) from 78.333%
#758

push

circle-ci

hershd23
Increased underline length in at line 75 in text_summarization.rst
	modified:   docs/source/benchmarks/text_summarization.rst

0 of 11303 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/evadb/parser/lark_visitor/__init__.py
1
# coding=utf-8
2
# Copyright 2018-2023 EvaDB
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
from typing import List, TypeVar
×
16

17
from lark import Tree, visitors
×
18

19
from evadb.parser.lark_visitor._common_clauses_ids import CommonClauses
×
20
from evadb.parser.lark_visitor._create_statements import CreateDatabase, CreateTable
×
21
from evadb.parser.lark_visitor._delete_statement import Delete
×
22
from evadb.parser.lark_visitor._drop_statement import DropObject
×
23
from evadb.parser.lark_visitor._explain_statement import Explain
×
24
from evadb.parser.lark_visitor._expressions import Expressions
×
25
from evadb.parser.lark_visitor._functions import Functions
×
26
from evadb.parser.lark_visitor._insert_statements import Insert
×
27
from evadb.parser.lark_visitor._load_statement import Load
×
28
from evadb.parser.lark_visitor._rename_statement import RenameTable
×
29
from evadb.parser.lark_visitor._select_statement import Select
×
30
from evadb.parser.lark_visitor._show_statements import Show
×
31
from evadb.parser.lark_visitor._table_sources import TableSources
×
32
from evadb.parser.lark_visitor._use_statement import Use
×
33

34
# To add new functionality to the parser, create a new file under
35
# the lark_visitor directory, and implement a new class which
36
# overloads the required visitors' functions.
37
# Then make the new class as a parent class for ParserVisitor.
38

39
_Leaf_T = TypeVar("_Leaf_T")
×
40

41

42
class LarkBaseInterpreter(visitors.Interpreter):
×
43
    # Override default behavior of Interpreter
44
    def visit_children(self, tree: Tree[_Leaf_T]) -> List:
×
45
        output = [
×
46
            self._visit_tree(child) if isinstance(child, Tree) else child
47
            for child in tree.children
48
        ]
49

50
        # special case to flatten list
51
        if len(output) == 1:
×
52
            output = output[0]
×
53

54
        return output
×
55

56

57
# Modified, add RenameTable
58
class LarkInterpreter(
×
59
    LarkBaseInterpreter,
60
    CommonClauses,
61
    CreateTable,
62
    CreateDatabase,
63
    Expressions,
64
    Functions,
65
    Insert,
66
    Select,
67
    TableSources,
68
    Load,
69
    RenameTable,
70
    DropObject,
71
    Show,
72
    Explain,
73
    Delete,
74
    Use,
75
):
76
    def __init__(self, query):
×
77
        super().__init__()
×
78
        self.query = query
×
79

80
    def start(self, tree):
×
81
        return self.visit_children(tree)
×
82

83
    def sql_statement(self, tree):
×
84
        return self.visit(tree.children[0])
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc