blob: 0191b4b5f466fc59b60ae272d94f7fe9cff7e5e2 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf), Loetz GmbH&Co.KG (Heidelberg)
* 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:
* Florian Pirchner - Initial implementation
*/
grammar org.eclipse.osbp.dsl.services.xtext.ServicesGrammar with org.eclipse.osbp.dsl.common.xtext.CommonGrammar
import "http://osbp.eclipse.org/dsl/dto/v1" as dto
import "http://osbp.eclipse.org/dsl/services/v1" as service
import "http://osbp.eclipse.org/dsl/common/types/v1" as common
import "http://osbp.eclipse.org/dsl/entity/v1" as entity
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
import "http://www.eclipse.org/xtext/xbase/Xtype" as xtype
import "http://www.eclipse.org/Xtext/Xbase/XAnnotations" as xannotation
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types
LServiceModel returns service::LServiceModel:
importSection=XImportSection?
packages+=TypedPackage*;
Class returns service::LDTOService:
{service::LDTOService} annotations+=AnnotationDef*
{service::LDTOService.annotationInfo=current}
'dtoservice' name=ValidIDWithKeywords 'provides' dto=[dto::LDto|TYPE_CROSS_REFERENCE]
'{'
((mutablePersistenceId?='mutable')? 'persistenceUnit' persistenceId=QualifiedName )?
('validators' '{'
validators+=ValidatorDef (',' validators+=ValidatorDef)*
'}'
)?
injectedServices=InjectedServices
operations+=Operation*
'}';
ValidatorDef returns service::LValidator:
(=>(validatorType=JvmTypeReference) | validatorId=STRING)
;
InjectedServices returns service::LInjectedServices:
{service::LInjectedServices}
(services+=InjectedService)*;
InjectedService returns service::LInjectedService:
{service::LInjectedService}
'injectService' (cardinality=Cardinality)? service=JvmTypeReference attributeName=ID ;
FilterableAttributes returns service::LFilterableAttributes:
'filterable' '{'
filterableFeatures+=[dto::LDtoFeature|LFQN] (',' filterableFeatures+=[dto::LDtoFeature|LFQN])*
'}';
SortableAttributes returns service::LSortableAttributes:
'sortable' '{'
sortableFeatures+=[dto::LDtoFeature|LFQN] (',' sortableFeatures+=[dto::LDtoFeature|LFQN])*
'}';
Operation returns service::LServiceOperation:
{service::LServiceOperation} annotations+=AnnotationDef*
('def' type=JvmTypeReference name=ID
'(' (params+=FullJvmFormalParameter (',' params+=FullJvmFormalParameter)*)? ')'
body=XExpression)
;
enum Cardinality returns service::LCardinality:
ZERO_TO_ONE="optional" | ONE_TO_ONE="mandatory" | ZERO_TO_MANY="zeroToMany" | ONE_TO_MANY="oneToMany";