2 grammar com.huawei.nemo.Editor with org.eclipse.xtext.common.Terminals
4 generate editor "http://www.huawei.com/nemo/Editor"
10 SenEngines | User| Node | NodeOperating | Connection|ConnectionUpdate|Flow|FlowUpdate|Operation;
16 'Engines:' Ipv4 (',' Ipv4)* ';';
19 IPV4_SUB '.' IPV4_SUB '.' IPV4_SUB '.' 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')*;
27 User:'CREATE' (STRING) (STRING) (STRING) ';' ;
30 Node:NewObj 'Node' name=NemoId ('Type' NemoId) ('Contain' nodes+=[Node|NemoId] (',' nodes+=[Node|NemoId])*)? (Property)? ';' ;
33 NodeModel: 'NodeModel' name=NemoId (ModelProperty)?;
36 NodeOperating:('UPDATE'|'DELETE') 'Node' nodename+=[Node|NemoId] ('Type' NemoId)? ('Contain' nodes+=[Node|NemoId] (',' nodes+=[Node|NemoId])*)? (Property)? ';';
39 Connection:'CREATE' 'Connection' name=NemoId 'Type' NemoId ('Endnodes' endnode+=[Node|NemoId] (',' endnode+=[Node|NemoId])*) (Property)? ';';
41 //Connection operating
42 ConnectionUpdate:('UPDATE'|'DELETE') 'Connection' connectionname+=[Connection|NemoId] ('Type' NemoId)? ('Endnodes' endnode+=[Node|NemoId] (',' endnode+=[Node|NemoId])*)? (Property)? ';';
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 ;
54 Operation:'CREATE' 'Operation' name=NemoId ( 'Priority' value+=INT)? 'Target' targetId=[Flow|NemoId] (Condition)? 'Action' (NemoId|(NemoId ':' targetNode=[Node|NemoId])) ';';
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;
65 NewObj:'CREATE'|'IMPORT';
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;
74 //Query:'Query' BLANK Condition BLANK 'From' BLANK (tar=[Node])|(tar=[Operation])|(tar=[Flow])|(tar=[Connection]);