objective c - What is wrong with this ParseKit BNF? -


i'm using parsekit objective-c takes bnf-like syntax specifying grammers:

@start = command+; command = new; new = 'new' object ';'; object = 'house' | other; 

inclusion of last line causes error. want object can house or else. non-terminal element "other" supposed catch whatever word there wasn't house.

am going "anything-here" idea wrong way?

thanks!

as suggested in comments, should either replace other word or add new rule:

other = word; 

since 'house' word, can directly replace object rule with:

object = word; 

a word in parsekit contiguous sequence of characters ([a-za-z]), numbers ([0-9]), , symbols -, _, , ', starts character. can find more information parsekit tokens in documentation.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -