| /** |
| * |
| * Copyright (c) 2011, 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 |
| * |
| */ |
| grammar org.eclipse.osbp.xtext.messagedsl.MessageDsl with org.eclipse.xtext.xbase.annotations.XbaseWithAnnotations |
| |
| import "http://osbp.eclipse.org/xtext/messagedsl/MessageDSL" |
| import "http://www.eclipse.org/emf/2002/Ecore" as ecore |
| import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase |
| |
| MessageModel: |
| pckg=MessagePackage; |
| |
| MessagePackage: |
| {MessagePackage} |
| 'package' name=QualifiedName '{' |
| (categories+=MessageCategory)* |
| '}'; |
| |
| MessageCategory: |
| 'category' name=ID '{' |
| (groups+=MessageGroup)* |
| '}'; |
| |
| MessageGroup: |
| 'group' name=ID '{' |
| (items+=MessageItem)* |
| '}'; |
| |
| MessageItem: |
| 'message' name=ID '{' |
| 'parameter' '{' |
| (parameters+=MessageParameter)* |
| '}' |
| 'automatic' '{' |
| (automaticOutputs+=AutomaticOutputEnum)* |
| '}' |
| 'format' '{' ( |
| ('all' allFormat=MessageDefaultFormat) | |
| ( |
| 'log' logFormat=MessageDefaultFormat |
| 'show' showFormat=MessageDefaultFormat |
| ) |
| ) '}' |
| '}'; |
| |
| MessageParameter: |
| oftype=ParameterTypeEnum name=ID; |
| |
| enum ParameterTypeEnum: |
| BOOLEAN='boolean' | |
| INTEGER='int' | |
| DOUBLE='double' | |
| STRING='String' | |
| CLASS='Class' | |
| OBJECT='Object' | |
| EXCEPTION='Exception'; |
| |
| enum AutomaticOutputEnum: |
| LOG_TRACE='log-trace' | |
| LOG_DEBUG='log-debug' | |
| LOG_INFO='log-info' | |
| LOG_WARN='log-warn' | |
| LOG_ERROR='log-error' | |
| SHOW_INFO='show-info' | |
| SHOW_WARN='show-warn' | |
| SHOW_ERROR='show-error'; |
| |
| MessageDefaultFormat: |
| format=TRANSLATABLESTRING; |
| |
| TRANSLATABLESTRING: |
| STRING; |