| grammar org.eclipse.papyrus.interoperability.rpy.parser.RpySyntax with org.eclipse.xtext.common.Terminals hidden( WS) |
| import "http://www.eclipse.org/emf/2002/Ecore" as ecore |
| generate rpySyntax "http://www.eclipse.org/papyrus/rpy/RpySyntax" |
| |
| RpyFile: |
| 'I-Logix-RPY-Archive' version=RPY_VERSION (contents +=RpyContent)*; |
| |
| |
| RpyContent : |
| RpyNode | RpyFeature |
| ; |
| |
| RpyNode: |
| '{' name=ID (contents+=RpyContent)+ '}' |
| ; |
| |
| RpyFeature: |
| '-' name=ID '=' value=RpyFeatureValue |
| ; |
| |
| RpyFeatureValue: |
| SimpleValueList | RpyNodeList | RpyStringMap |
| ; |
| |
| RpyNodeList: |
| values +=RpyNode+ |
| ; |
| |
| SimpleValueList:{SimpleValueList} |
| (isOldID?='OLDID')? (isGUID?='GUID')? valueElements+=(RpySimpleValueElement )+ |
| ; |
| |
| RpySimpleValueElement:{RpySimpleValueElement} |
| values+=(VALUE_TERMINAL)* ';' |
| ; |
| |
| VALUE_TERMINAL: |
| (STRING | ID | RPY_GUID| INT| RPY_TIME| RPY_REAL ) |
| ; |
| |
| RpyStringMap : |
| entries+=(RpyStringMapEntry)+; |
| |
| RpyStringMapEntry: |
| key=STRING value=STRING |
| ; |
| |
| |
| terminal RPY_GUID: |
| ('a'..'z'|'A'..'Z'|'0'..'9')+('-'('a'..'z'|'A'..'Z'|'0'..'9')+)+; |
| |
| terminal RPY_TIME: |
| ('0'..'9')+'.'('0'..'9')+'.'('0'..'9')+'::'('0'..'9')+':'('0'..'9')+':'('0'..'9') |
| ; |
| terminal RPY_REAL: |
| '-'?('0'..'9')+'.'('0'..'9')+ |
| ; |
| terminal INT returns ecore::EInt: '-'?('0'..'9')+; |
| |
| |
| terminal RPY_VERSION: |
| 'version' !('\n' | '\r')* ('\n' | '\r'); |
| |
| |