Parsing exception in xtext grammar [message #1741156] |
Tue, 23 August 2016 11:46 |
kozhaev Vladimir Messages: 108 Registered: July 2009 |
Senior Member |
|
|
I have create xtext grammar(see it bellow) but when I run eclipse I have following exception.
required (...)+ loop did not match anything at input 'IPADDR_eth0'
My parsed string is :IPADDR_eth0="10.170.53.101"
I know that problem is probably in the grammar, but don't know where.
So, where I'm wrong?
Regards,
Vladimir
grammar com.iamsoft.net.Validate with org.eclipse.xtext.common.Terminals
generate validate "http://www.iamsoft.com/net/Validate"
Model:
netDescription+=DescriptionPair+;
DescriptionPair:
ipaddr | netmask | speed | mtu | tso | gateway | router | subnet | no_vlans | vlan;
vlan:
'VLAN_' name=ID '='
value=IntList;
IntList:
valueList+=INT+ | '"' valueList+=INT+ '"';
IPAddrList:
ipNum1=INT '.' ipNum2=INT '.' ipNum3=INT '.' ipNum4=INT;
//List of numbers with 3 digit
no_vlans:
'NO_VLANS_' name=ID '=' list+=IntList;
subnet:
'SUBNET_' name=ID '=' list+=IPWithQuotes;
router:
'ROUTER_' name=ID '=' list+=IPWithQuotes;
gateway:
'GATEWAY_' name=ID '=' list+=IPWithQuotes;
mtu:
'MTU_' name=ID '=' val=IntWithQuotes;
tso:
'TSO_' name=ID '=' '"' value=ON_OFF '"';
terminal ON_OFF:
'on' | 'off';
netmask:
'NETMASK_' name=ID '=' list+=IPWithQuotes;
speed:
'SPEED_' name=ID '=' value=IntWithQuotes;
ipaddr:
'IPADDR_' name=ID '=' list+=IPWithQuotes;
IPWithQuotes:
IPAddrList | '"' IPAddrList '"';
IntWithQuotes:
value=INT | '"' value=INT '"';
[Updated on: Tue, 23 August 2016 11:54] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03317 seconds