解析xtext语法中的异常

时间:2016-08-23 11:41:08

标签: parsing grammar xtext

我已经创建了xtext语法(见下文)但是当我运行eclipse时我有以下异常。

  

必需(...)+循环与输入中的任何内容都不匹配' IPADDR_eth0'

我知道问题可能在于语法,但不知道在哪里。

那么,我哪里错了?

此致

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 '"';

0 个答案:

没有答案