validation - How to add values with backquotes -
i have create grammar
grammar com.iamsoft.net.validate org.eclipse.xtext.common.terminals generate validate "http://www.iamsoft.com/net/validate" model: netdescription+=descriptionpair+; descriptionpair:tso; tso: name=tso_name '=' '"' value=boolean '"'; terminal boolean: 'on' | 'off'; terminal tso_name: 'tso_' id;
and during validation of string
tso_eth1="off"
have following error message
mismatched input '"off"' expecting '"'
but if remove double quotes rule tso, grammar correctly validate string
tso_eth1=off
so how add double quotes grammar?
regards, vladimir
the problem inheritance of terminals grammar contains string rule
depending on if need string terminal rule anywhere else have following options
(1) dont inherit terminals grammar , copy&paste terminal rules , hidden clause terminals grammar grammar
(2) override string rule simething unused e.g. terminal string: '@@@@@@willnenverbecalled@@@@@'
(3) use datatype rule + valueconverter instead of stuff boolean: string
, tso: name=tso_name '=' value=boolean;
Comments
Post a Comment