| /** |
| * |
| * 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.osbp.xtext.oxtype.OXtype |
| |
| 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 '{' |
| (items+=MessageItem)* |
| '}'; |
| |
| MessageItem: |
| 'message' name=ID '{' |
| ('parameter' '{'(parameters+=MessageParameter)*'}')? |
| ('severity' '{'(severities+=SeverityEnum)*'}')? |
| 'output' '{' ( |
| ('all' allOutput=MessageText) | |
| ( |
| ('log' logOutput=MessageText)? |
| 'show' showOutput=MessageText |
| ) |
| ) '}' |
| '}'; |
| |
| MessageParameter: |
| oftype=ParameterTypeEnum name=ID; |
| |
| enum ParameterTypeEnum: |
| BOOLEAN='boolean' | |
| INTEGER='int' | |
| DOUBLE='double' | |
| STRING='String' | |
| CLASS='Class' | |
| OBJECT='Object' | |
| EXCEPTION='Exception'; |
| |
| enum SeverityEnum: |
| 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'; |
| |
| MessageText: |
| text=TRANSLATABLESTRING; |
| |
| TRANSLATABLESTRING: |
| STRING; |