[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

order in productions




Hi,

I don't wish to restrict the order that a user may write in.. i.e

model {
   type foo
   variable bar
}

or

model {
   variable bar
   type foo
}


are both okay.

To do this I have written

model = kw_model lbrace model_parts* rbrace

model_parts =
	kw_variable ident |
	kw_type ident

... but this approach makes it difficult to disallow something like: 'only
one type is allowed'. Does anyone know a better way? My guess is that what
I am trying to do is context-sensitive and cannot be done any easilier.

Thanks in advance,

Roger.