Modify pom file
[nemo.git] / nemo-tools / eclipse-plugin-project / nemo-rest / org.opendaylight.nemo.tool.eclipse.plugin.rest / Grammer.text
1
2 grammar com.huawei.nemo.Editor with org.eclipse.xtext.common.Terminals
3
4 generate editor "http://www.huawei.com/nemo/Editor"
5
6 Model:
7         sentences+=Sentence*;
8
9 Sentence:
10         SenEngines | User| Node | NodeOperating | Connection|ConnectionUpdate|Flow|FlowUpdate|Operation;
11         
12         
13         
14 //Engines sentence
15 SenEngines:
16         'Engines:' Ipv4 (',' Ipv4)* ';';
17
18 Ipv4:
19         IPV4_SUB '.' IPV4_SUB '.' IPV4_SUB '.' IPV4_SUB ;
20
21 terminal IPV4_SUB:
22         ('0'..'9') | ('1'..'9') ('0'..'9') | '1' ('0'..'9') ('0'..'9') | '2' ('0'..'4') ('0'..'9') | '25' ('0'..'5');
23 terminal NemoId: ('a'..'z'|'A'..'Z'|'$'|'_') ('a'..'z'|'A'..'Z'|'$'|'_'|'-'|'0'..'9')*;
24
25
26 //User
27 User:'CREATE'  (STRING) (STRING) (STRING)   ';' ;       
28         
29 ////Node
30 Node:NewObj  'Node'  name=NemoId   ('Type'  NemoId) ('Contain' nodes+=[Node|NemoId] (',' nodes+=[Node|NemoId])*)? (Property)?  ';' ;
31
32 //NodeModel
33 NodeModel: 'NodeModel' name=NemoId (ModelProperty)?;
34
35
36 NodeOperating:('UPDATE'|'DELETE')  'Node'  nodename+=[Node|NemoId] ('Type'  NemoId)? ('Contain' nodes+=[Node|NemoId] (',' nodes+=[Node|NemoId])*)? (Property)?  ';';
37
38 //Connection
39 Connection:'CREATE' 'Connection' name=NemoId 'Type' NemoId  ('Endnodes' endnode+=[Node|NemoId] (',' endnode+=[Node|NemoId])*) (Property)?  ';';
40
41 //Connection operating
42 ConnectionUpdate:('UPDATE'|'DELETE') 'Connection'  connectionname+=[Connection|NemoId]   ('Type'   NemoId)? ('Endnodes' endnode+=[Node|NemoId] (',' endnode+=[Node|NemoId])*)? (Property)?  ';';
43
44 //flow
45 Flow:'CREATE' 'Flow' name=NemoId (Matches)? ';';
46 FlowUpdate: ('UPDATE'|'DELETE') 'Flow' flowId+=[Flow|NemoId] (Matches)? ';';
47 Matches:   'Match'   Match (',' Match)*;
48 Match: NemoId ':' STRING ;
49
50
51
52
53 //Operation
54 Operation:'CREATE'   'Operation'   name=NemoId (  'Priority' value+=INT)?   'Target'   targetId=[Flow|NemoId] (Condition)?   'Action'   (NemoId|(NemoId ':' targetNode=[Node|NemoId])) ';';
55
56
57
58
59 Condition: 'Condition' STRING(','STRING)*;
60 Property: 'Property ' OneProperty(',' OneProperty)*;
61 OneProperty:NemoId ':' (STRING|INT);
62 ModelProperty: 'Property' OneModelProperty (',' OneModelProperty)*;
63 OneModelProperty: (STRING|INT)':'NemoId;
64
65 NewObj:'CREATE'|'IMPORT';
66
67
68
69 //PropertyType:'location'|'ip-prifix'|'is-enable'|'ac-info-network';
70 //terminal Mac_sub: (('0'..'9')|('a'..'f'))(('0'..'9')|('a'..'f'));
71 //Mac: Mac_sub ':' Mac_sub ':' Mac_sub ':' Mac_sub ':' Mac_sub ':' Mac_sub;
72
73 //Query
74 //Query:'Query' BLANK Condition BLANK 'From' BLANK (tar=[Node])|(tar=[Operation])|(tar=[Flow])|(tar=[Connection]);