blob: 58033785945e914544c5a662f7098ba6db9502b5 [file] [log] [blame]
/**
*
* Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
* Jörg Riegel - ongoing development
*
*/
grammar org.eclipse.osbp.xtext.datamartdsl.DatamartDSL with org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations
import "http://osbp.eclipse.org/xtext/datamartdsl/DatamartDSL" as datamart
import "http://osbp.eclipse.org/xtext/cubedsl/CubeDSL" as cube
import "http://osbp.eclipse.org/xtext/authorizationdsl/AuthorizationDSL" as authorization
import "http://osbp.eclipse.org/dsl/common/types/v1" as types
import "http://osbp.eclipse.org/dsl/entity/v1" as entity
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
DatamartModel returns datamart::DatamartModel:
packages+=DatamartPackage*;
DatamartPackage returns datamart::DatamartPackage:
{datamart::DatamartPackage} 'package' name=QualifiedName
('{' (imports+=DatamartImport)* (definitions+=DatamartDefinition)* '}' )?;
DatamartDefinition returns datamart::DatamartDefinition:
'datamart' name=ID (description?='described by' descriptionValue=TRANSLATABLESTRING)?
('for' '{' (roles+=DatamartRole)* '}')?
'using' source=DatamartSource;
DatamartRole returns datamart::DatamartRole:
'role' assignedRole=[authorization::Role];
DatamartSource returns datamart::DatamartSource:
DatamartCube | DatamartEntity | DatamartTask;
DatamartTask returns datamart::DatamartTask:
'task' taskQuery=TaskQueryTopicEnum
('columns' '{' columns+=DatamartColumn* '}')?
('conditions' '{' conditions+=DatamartCondition* '}')? ;
DatamartColumn returns datamart::DatamartColumn:
'column' columnRef=TaskQueryColumnEnum;
DatamartTaskFilter returns datamart::DatamartTaskFilter:
'filter' filterRef=TaskFilterEnum;
DatamartCube returns datamart::DatamartCube:
'cube' cubeRef=[cube::CubeType] (nonEmpty?='nonempty values')?
'{' axisslicer+=DatamartCubeElement* '}';
DatamartReference returns datamart::DatamartReference:
'join' ref=[entity::LEntityReference];
//DotExpression returns datamart::Ref:
// EntityRef ({datamart::DotExpression.ref=current} "."
// tail=[entity::LEntityReference]
// )*;
//
//EntityRef returns datamart::Ref:
// {datamart::EntityRef} entity=[entity::LEntity];
DatamartEntity returns datamart::DatamartEntity:
'entity' entityRef=[entity::LEntity] (tracking?='tracking')? '{'
('navigation' '{' navigations+=DatamartNavigation* '}')?
('properties' '{' properties+=DatamartProperty* '}')?
('conditions' '{' conditions+=DatamartCondition* '}')?
('ordering' '{' ordering+=DatamartOrder* '}')?
('filler rows' fillerMinCountRows=INT 'to' fillerMaxCountRows=INT '{' fillerDatas+=PropertyFillerData* '}')?
'}';
DatamartNavigation returns datamart::DatamartNavigation:
DatamartOwner | DatamartMember;
DatamartOwner returns datamart::DatamartOwner:
'many to one' joinRef=DatamartReference 'to' datamartEntity=DatamartEntity;
DatamartMember returns datamart::DatamartMember:
'one to many' joinRef=DatamartReference 'to' datamartEntity=DatamartEntity;
DatamartProperty returns datamart::DatamartProperty:
'property' propertyRef=[entity::LEntityAttribute] ((aggregated?='aggregate' aggregate=SqlAggregationEnum)? & (placed?='on axis' axis=AxisEnum)? & (scaled?='scale' scale=ValueScaleEnum)?);
DatamartCondition returns datamart::DatamartCondition:
'condition' condition=DatamartDisjunction;
DatamartOrder returns datamart::DatamartOrder:
'order' orderBy=[entity::LEntityAttribute] orderHow=OrderEnum;
DatamartDisjunction returns datamart::Expression:
DatamartConjunction (({datamart::Disjunction.left=current} 'or') right=DatamartConjunction)*;
DatamartConjunction returns datamart::Expression:
DatamartConditionalExpression (({datamart::Conjunction.left=current} 'and') right=DatamartConditionalExpression)*;
DatamartConditionalExpression returns datamart::Expression:
DatamartOperand (({datamart::ConditionalExpression.left=current} operator=OperatorEnum) right=DatamartOperand)*;
DatamartOperand returns datamart::Expression:
DatamartValue | '(' DatamartDisjunction ')';
DatamartValue returns datamart::Expression:
numberValue=Number|stringValue=STRING|((filtered?='filtered' (optional?='optional')?)| selected?='selected')|DatamartProperty|DatamartTaskFilter|DatamartColumn;
DatamartCubeElement returns datamart::DatamartCubeElement:
DatamartAxis|DatamartSlicer|DatamartDefineDerivedMeasure;
DatamartDefineDerivedMeasure returns datamart::DatamartDefineDerivedMeasure:
'derive' name=TRANSLATABLEID 'from' derivedElement+=DatamartAddition*;
DatamartAddition returns datamart::Expression:
DatamartMultiplication (({datamart::Addition.left=current} '+'| {datamart::Subtraction.left=current} '-') right=DatamartMultiplication)*;
DatamartMultiplication returns datamart::Expression:
DatamartPrimary (({datamart::Multiplication.left=current} '*' | {datamart::Division.left=current} '/') right=DatamartPrimary)*;
DatamartPrimary returns datamart::Expression:
DatamartNumberOrElement | '(' DatamartAddition ')';
DatamartNumberOrElement returns datamart::Expression:
value=Number | DatamartMeasure | DatamartDerivedMeasure | DatamartMemberTuple | DatamartAggregation;
DatamartMemberTuple returns datamart::Expression:
((function=DatamartFunction | function = DatamartParameterFunction) 'of')? hierarchy=DatamartHierarchy ({datamart::DatamartMemberTuple.left = current} 'over' right=DatamartMeasure);
DatamartFunction returns datamart::DatamartFunction:
function=FunctionEnum;
DatamartParameterFunction returns datamart::DatamartParameterFunction:
function=ParameterFunctionEnum '(' parameter=DatamartFunctionIntParameter ')';
DatamartFunctionIntParameter returns datamart::DatamartFunctionIntParameter:
value=INT;
DatamartSetFunction returns datamart::DatamartSetFunction:
setFunction=SetFunctionEnum;
DatamartSetParameterFunction returns datamart::DatamartSetParameterFunction:
setFunction=SetParameterFunctionEnum '(' parameter=DatamartFunctionIntParameter ')';
DatamartSetAggregationFunction returns datamart::DatamartSetAggregationFunction:
aggregation=SetAggregationEnum '(' parameter=DatamartFunctionIntParameter ')';
DatamartSetTuple returns datamart::Expression:
(setFunction = DatamartSetFunction | setFunction = DatamartSetParameterFunction) ({datamart::DatamartSetTuple.left = current} 'of' right=DatamartHierarchy);
DatamartAggregationFunction returns datamart::DatamartAggregationFunction:
aggregation=AggregationEnum;
DatamartAggregation returns datamart::Expression:
aggregation=DatamartAggregationFunction 'of' (set=DatamartSetTuple | set=DatamartHierarchy) ({datamart::DatamartAggregation.left = current} 'over' right=DatamartMeasure);
DatamartSetAggregation returns datamart::Expression:
aggregation=DatamartSetAggregationFunction 'of' (set=DatamartSetTuple | set=DatamartHierarchy) ({datamart::DatamartSetAggregation.left = current} 'over' right=DatamartMeasure);
DatamartSlicer returns datamart::DatamartSlicer:
'slicer' element=DatamartElement;
DatamartAxis returns datamart::DatamartAxis:
'axis' name=AxisEnum '{' elements+=DatamartElement* '}';
DatamartElement returns datamart::DatamartElement:
DatamartHierarchy|DatamartMeasure|DatamartDerivedMeasure|DatamartSetAggregation;
DatamartDerivedMeasure returns datamart::DatamartDerivedMeasure:
'derived' derivedRef=[datamart::DatamartDefineDerivedMeasure] (scaled?='scale' scale=ValueScaleEnum)?;
DatamartMeasure returns datamart::DatamartMeasure:
'measure' measureRef=[cube::CubeMeasure] (scaled?='scale' scale=ValueScaleEnum)?;
DatamartHierarchy returns datamart::DatamartHierarchy:
'hierarchy' hierarchyRef=[cube::CubeHierarchy] (defaultMember?='default')? (allMember?='condensed')? (allLevels?='exploded')? ('level' levelRef=[cube::CubeLevel] (filtered?='filtered'| selected?='selected')?)? (all?='detailed' (except?='except' exceptRef=[cube::CubeLevel])? (ordered?='ordered by' orderRef=(DatamartMeasure|DatamartDerivedMeasure) (descending?='descending')?)?)?;
DatamartImport returns types::LImport:
'import' importedNamespace=DatamartQualifiedNameWithWildCard;
DatamartQualifiedNameWithWildCard:
QualifiedName ('.' '*')?;
QualifiedName:
ValidID (=>'.' ValidID)*;
ValidID:
ID;
TRANSLATABLESTRING:
STRING;
TRANSLATABLEID:
ID;
enum AxisEnum returns datamart::AxisEnum:
DEFAULT='default' | COLUMNS='columns' | ROWS='rows' | PAGES='pages' | SECTIONS='sections' | CHAPTERS='chapters' /* | AXIS(<index>)*/;
enum FunctionEnum returns datamart::FunctionEnum:
PREVMEMBER='previous' | NEXTMEMBER='next' | FIRSTCHILD='first' | LASTCHILD='last';
enum ParameterFunctionEnum returns datamart::ParameterFunctionEnum:
LAG='lag' | LEAD='lead';
enum SetFunctionEnum returns datamart::SetFunctionEnum:
YTD='year-to-date' | PERIODSTODATE='periods' /*| ALLMEMBERS='all' | ASCENDANTS='ascendants'*/;
enum SetParameterFunctionEnum returns datamart::SetParameterFunctionEnum:
TAIL='tail' | HEAD='head';
enum SetAggregationEnum returns datamart::SetAggregationEnum:
TOPCOUNT='topcount' | TOPSUM='topsummation' | TOPPERCENT='toppercentage' | BOTTOMCOUNT='bottomcount' | BOTTOMSUM='bottomsummation' | BOTTOMPERCENT='bottompercentage';
enum AggregationEnum returns datamart::AggregationEnum:
AVG='average' | SUM='summation' | AGGREGATE='aggregate' | STDDEV='deviation';
enum OperatorEnum returns datamart::OperatorEnum:
EQUALS='=' | LESS='<' | GREATER=">" | LESSEQUAL='<=' | GREATEREQUAL='>=' | LIKE='like';
enum SqlAggregationEnum returns datamart::SqlAggregationEnum:
AVG='average' | SUM='summation' | COUNT='count';
enum ValueScaleEnum returns datamart::ValueScaleEnum:
AXIS='group1' | AXIS2='group2' | AXIS3='group3' | AXIS4='group4' | AXIS5='group5' | AXIS6='group6' | AXIS7='group7' | AXIS8='group8' | AXIS9='group9';
enum TaskQueryTopicEnum returns datamart::TaskQueryTopicEnum:
Q1='BusinessAdministrator' | Q2='PotentialOwner' | Q3='Recipient' | Q4='TaskInitiator' | Q5='TaskStakeholder' | Q6='ExcludedOwner';
enum TaskQueryColumnEnum returns datamart::TaskQueryColumnEnum:
P1='Name' | P2='Priority' | P3='Status' | P4='Subject' | P5='Description' | P6='ExpirationTime' | P7='CreatedOn' | P8='CreatedBy' | P9='ActivationTime' |
P10='ActualOwner' | P11='TaskId' | P12 = 'ProcessId' | P13='ProcessInstanceId' | P14='ProcessSessionId';
enum TaskFilterEnum returns datamart::TaskFilterEnum:
F1='Groups' | F2='Users';
enum OrderEnum returns datamart::OrderEnum:
ASC='ascending' | DESC='descending';
PropertyFillerData returns datamart::PropertyFillerData:
'fill' propertyRef=[entity::LEntityAttribute] 'with' fillerType=PropertyFillerType;
PropertyFillerType returns datamart::PropertyFillerType:
PropertyFillerDateFuture | PropertyFillerDatePast
| PropertyFillerDateRange
| PropertyFillerSignedDoubleRange | PropertyFillerSignedDoubleRandom
| PropertyFillerSignedIntegerRange | PropertyFillerSignedIntegerRandom
| PropertyFillerTextRandom
| PropertyFillerTextParagraphs | PropertyFillerTextSentences | PropertyFillerTextWords
| PropertyFillerUnsignedDoubleRange | PropertyFillerUnsignedDoubleRandom
| PropertyFillerUnsignedIntegerRange | PropertyFillerUnsignedIntegerRandom
;
PropertyFillerDateFuture returns datamart::PropertyFillerDateFuture:
'filler-date future' dateFutureYears=INT 'years';
PropertyFillerDatePast returns datamart::PropertyFillerDatePast:
'filler-date past' datePastYears=INT 'years';
PropertyFillerDateRange returns datamart::PropertyFillerDateRange:
'filler-date range' dateBeginYears=SINT 'up to and including' dateEndYears=SINT 'years';
PropertyFillerSignedDoubleRange returns datamart::PropertyFillerSignedDoubleRange:
'filler-signed-double range'
((beginRange=SignedNumber | beginRangeRef=[entity::LEntityAttribute])? 'up to and including' (endRange=SignedNumber|endRangeRef=[entity::LEntityAttribute]))?
'with' decimals=INT 'decimals'
('round to' rounded=UnsignedNumber)?;
PropertyFillerSignedDoubleRandom returns datamart::PropertyFillerSignedDoubleRandom:
'filler-signed-double random' '(' (items+=SignedNumber)+ ')';
PropertyFillerSignedIntegerRange returns datamart::PropertyFillerSignedIntegerRange:
{datamart::PropertyFillerSignedIntegerRange} 'filler-signed-integer range'
((beginRange=SINT | beginRangeRef=[entity::LEntityAttribute])? 'up to and including' (endRange=SINT|endRangeRef=[entity::LEntityAttribute]))?
('round to' rounded=INT)?;
PropertyFillerSignedIntegerRandom returns datamart::PropertyFillerSignedIntegerRandom:
'filler-signed-integer random' '(' (items+=SINT)+ ')';
PropertyFillerTextRandom returns datamart::PropertyFillerTextRandom:
'filler-text random' '(' (items+=STRING)+ ')';
PropertyFillerTextParagraphs returns datamart::PropertyFillerTextParagraphs:
{datamart::PropertyFillerTextParagraphs} 'filler-text paragraps' (count=INT)?;
PropertyFillerTextSentences returns datamart::PropertyFillerTextSentences:
{datamart::PropertyFillerTextSentences} 'filler-text sentences' (count=INT)?;
PropertyFillerTextWords returns datamart::PropertyFillerTextWords:
{datamart::PropertyFillerTextWords} 'filler-text words' (count=INT)?;
PropertyFillerUnsignedDoubleRange returns datamart::PropertyFillerUnsignedDoubleRange:
'filler-unsigned-double range'
((beginRange=UnsignedNumber | beginRangeRef=[entity::LEntityAttribute])? 'up to and including' (endRange=UnsignedNumber|endRangeRef=[entity::LEntityAttribute]))?
'with' decimals=INT 'decimals'
('round to' rounded=UnsignedNumber)?;
PropertyFillerUnsignedDoubleRandom returns datamart::PropertyFillerUnsignedDoubleRandom:
'filler-unsigned-double random' '(' (items+=UnsignedNumber)+ ')';
PropertyFillerUnsignedIntegerRange returns datamart::PropertyFillerUnsignedIntegerRange:
{datamart::PropertyFillerUnsignedIntegerRange} 'filler-unsigned-integer range'
((beginRange=INT | beginRangeRef=[entity::LEntityAttribute])? 'up to and including' (endRange=INT|endRangeRef=[entity::LEntityAttribute]))?
('round to' rounded=INT)?;
PropertyFillerUnsignedIntegerRandom returns datamart::PropertyFillerUnsignedIntegerRandom:
'filler-unsigned-integer random' '(' (items+=INT)+ ')';
SignedNumber returns ecore::EDouble:
('-')? UnsignedNumber;
UnsignedNumber returns ecore::EDouble:
INT ('.' (INT))?;
SINT returns ecore::EInt:
('-')? INT;