📄 featurevaluedemo.gram
字号:
#JSGF V1.0;grammar demo.jsapi.tags.FeatureValueDemo;// Pizza toppings and command.//<pizzaTopping> = cheese | pepperoni | mushrooms | mushroom | onions | onion | sausage;<pizza> = <NULL> { this.toppings = new Array(); } ([and] <pizzaTopping> { this.toppings = this.toppings.concat($.$value); })* (pizza | pie) { this.itemType = "pizza"; } [with] ([and] <pizzaTopping> { this.toppings = this.toppings.concat($.$value); })*;// Burger toppings and command.//<burgerTopping> = onions | pickles | tomatoes | lettuce | cheese;<burgerCondiment> = mayo | relish | ketchup | mustard | special sauce;<burger> = <NULL> { this.toppings = new Array(); } ((burger | hamburger) { this.itemType = "burger"; } | cheeseburger { this.itemType = "burger"; this.toppings = this.toppings.concat("cheese"); } ) [with] ([and] (<burgerTopping> | <burgerCondiment>) { this.toppings = this.toppings.concat($.$value); } )*;public <order> = [I (want | would like) a] ( <pizza> { this.command = "buyPizza"; } | <burger> { this.command = "buyBurger"; } ) { this.item = $; };
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -