Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
umple/cruise.umple/src/umple_core.grammar
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
66 lines (50 sloc)
4.45 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The master source of this first part of the Umple grammar is available at | |
// [*https://github.com/umple/umple/blob/master/cruise.umple/src/umple_core.grammar *] | |
// The html rendering is generated from the master and appears in the Umple User manual | |
// at page [*http://grammar.umple.org*] | |
// Copyright: All contributors to the Umple Project | |
// This file is made available subject to the open source license found at: | |
// [*http://umple.org/license*] | |
// The core of umple is a "program". This is the grammar's 'start symbol' | |
// Comments and lone semicolons are ignored | |
program- : [[useProgram]] | [[umpleProgram]] | |
umpleProgram- : ( [[comment]] | [[directive]] | ; )* | |
// Directives are the top-level items in an umple file. See manual page [*TypesofDirectives*] | |
// A directive is either used to configure the system or else is | |
// an actual entity of the system to be modelled or generated | |
directive- : [[glossary]] | [[generate]] | [[distribute]] | [[generate_path]] | [[filter]] | [[useStatement]] | [[namespace]] | [[requirement]] | [[reqImplementation]] | [[tracerDirective]] | [[entity]] | [[debug]] | [[strictness]] | [[toplevelExtracode]] | [[toplevelException]] | |
// A glossary item is used to fine tune pluralization during code generation | |
glossary : glossary { [[word]]* } | |
word : [singular] : [plural] ; | |
distribute : distributable [=distributeTech:RMI|WS]? [=distributePattern:0|1|2|3]? [=distributeVal:on|off|forced] ; | |
// A high level of strictness will cause warnings to be issued when base language code | |
// is found, where it might not have been intended. Strictness can also be used | |
// To either suppress certain messages, or to declare that they should be present. | |
// NOTE: This is currently under development | |
strictness- : strictness ( [=strictness:modelOnly|noExtraCode|none] | [[strictnessMessage]] | [[strictnessDisableAuto]] ) ; | |
strictnessMessage : [=message:allow|ignore|expect|disallow] [messageNumber] | |
strictnessDisableAuto : disable [**expression] | |
// The generate clause can be used to generate multiple outputs | |
// The --override is used to say that subsequent generate statements will be ignored | |
generate : generate [=language:Java|Nothing|Php|RTCpp|SimpleCpp|Ruby|Python|Cpp|Json|StructureDiagram|Yuml|Violet|Umlet|Simulate|TextUml|Scxml|GvStateDiagram|GvClassDiagram|GvFeatureDiagram|GvClassTraitDiagram|GvEntityRelationshipDiagram|Alloy|NuSMV|NuSMVOptimizer|Papyrus|Ecore|Xmi|Xtext|Sql|Umple|UmpleSelf|USE|Test|SimpleMetrics|PlainRequirementsDoc|Uigu2] ( [=suboptionIndicator:-s|--suboption] " [**suboption] " )* ; | |
generate_path : generate [=language:Java|Nothing|Php|RTCpp|SimpleCpp|Ruby|Python|Cpp|Json|StructureDiagram|Yuml|Violet|Umlet|Simulate|TextUml|Scxml|GvStateDiagram|GvClassDiagram|GvFeatureDiagram|GvClassTraitDiagram|GvEntityRelationshipDiagram|Alloy|NuSMV|NuSMVOptimizer|Papyrus|Ecore|Xmi|Xtext|Sql|Umple|UmpleSelf|USE|Test|SimpleMetrics|PlainRequirementsDoc|Uigu2] " [**output] " [=override:--override|--override-all]? ( [=suboptionIndicator:-s|--suboption] " [**suboption] " )* ; | |
// Use statements allow incorporation of other Umple files. See [*UseStatements*] | |
useStatement : use [use] ( , [extraUse] )* | |
toplevelExtracode : top [top] [[moreCode]] | |
// Namespaces divide the code into logical groups. See [*NamespaceDirectives*] | |
namespace- : namespace [namespace] [[namespaceoption]]? ; | |
namespaceoption : [=option:--redefine] | |
// The main top level elements to be found in an Umple file | |
entity- : [[mixsetIsFeature]] | [[requireStatement]] | [[mixsetDefinition]] | [[classDefinition]] | [[traitDefinition]] | [[fixml]] | [[interfaceDefinition]] | [[externalDefinition]] | [[associationDefinition]] | [[associationClassDefinition]] | [[stateMachineDefinition]] | [[templateDefinition]] | [[enumerationDefinition]] | [[toplevelCodeInjection]] | |
// Comments follow the same conventions as C-family languages. [*UmpleComments*] | |
comment- : [[inlineComment]] | [[multilineComment]] | [[annotationComment]] | |
inlineComment- : // [*inlineComment] | |
multilineComment- : /* [**multilineComment] */ | |
requirement : req [reqIdentifier] [reqLanguage]? { [**reqContent] } | |
reqImplementation : implementsReq [reqIdentifier] (, [reqIdentifier])* ; | |
//Matches all forms of Java annotations including those with parentheses and values in quotes | |
annotationComment- : [!annotationComment:@[a-zA-Z_][a-zA-Z0-9_-]*(\((("(\w|\s|-)*")|\w|\s|=|,|\.)*\))?] | |
// The Debug statement turns on debugging in code generation. For developer use only | |
debug- : [=debug] ; | |
// Instructs a class or method to be abstract | |
abstract- : [=abstract] ; |