Commit d2d20736 authored by mouadh's avatar mouadh

parser SelectStatement class name's change

parent 7bf9cd66
...@@ -77,7 +77,7 @@ class MdxParserGen(Parser): ...@@ -77,7 +77,7 @@ class MdxParserGen(Parser):
def _MDX_statement_(self): def _MDX_statement_(self):
self._select_statement_() self._select_statement_()
@graken('selectStatement') @graken('SelectStatement')
def _select_statement_(self): def _select_statement_(self):
self._token('SELECT') self._token('SELECT')
self.name_last_node('name') self.name_last_node('name')
......
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
class selectStatement(): class SelectStatement:
def __init__(self, select_statement): def __init__(self, select_statement):
self.select_statement = select_statement self.select_statement = select_statement
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
MDX_statement = MDX_statement =
select_statement; select_statement;
select_statement::selectStatement = name:'SELECT' [axis_specification_columns:axis_specification] select_statement::SelectStatement = name:'SELECT' [axis_specification_columns:axis_specification]
[',' axis_specification_rows:axis_specification] [',' axis_specification_rows:axis_specification]
'FROM' cube_specification:cube_specification 'FROM' cube_specification:cube_specification
['WHERE' condition_specification:condition_specification]$ ['WHERE' condition_specification:condition_specification]$
......
...@@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function ...@@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function
from grako.model import ModelBuilderSemantics from grako.model import ModelBuilderSemantics
from .gen_parser.mdxparser import MdxParserGen from .gen_parser.mdxparser import MdxParserGen
from .gen_parser.models import selectStatement from .gen_parser.models import SelectStatement
class MdxParser: class MdxParser:
...@@ -48,7 +48,7 @@ class MdxParser: ...@@ -48,7 +48,7 @@ class MdxParser:
:return: Tuples in the axis, from the MDX query :return: Tuples in the axis, from the MDX query
''' '''
model = MdxParserGen(semantics=ModelBuilderSemantics( model = MdxParserGen(semantics=ModelBuilderSemantics(
types=[selectStatement])) types=[SelectStatement]))
ast = model.parse(query, rule_name=MdxParser.START, ignorecase=True) ast = model.parse(query, rule_name=MdxParser.START, ignorecase=True)
if axis == "column": if axis == "column":
if ast.select_statement.axis_specification_columns is not None: if ast.select_statement.axis_specification_columns is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment