This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I use languages engine for getting AST tree. I have declaration : EchoStatement = ("echo" | "print") EchoArguments ";"; EchoArguments = [ Expression ( "," Expression )* ] | ( "(" [ Expression ( "," Expression )* ] ")" ) ; Expression node has usual "expression" structure ( its definition too long , I think there is no need in this ). The problem is in possibility for valid expression value , f.e.: expression could be "( 1 + 2 )". So it seems for string 'echo ( 1+2 );' engine cannot determine in this case expression "1+2" as most appropriate result because EchoArguments could also have "(" , ")". ( So engine has two choices : incorrect EchoArguments "(" , expression="1" , "+", expression="2", ")" and correct EchoArguments = expression = "( 1+2 )" ). As result I get on stderr ( or stdout , I'm not sure exactly ) : Too many choices! EchoArguments : <php_operator,'('> <php_whitespace,' '>:<php_operator,'('> <php_whitespace,' '> <php_n umber,'1'> <php_operator,'+'> <php_number,'2'> <php_whitespace,' '> <php_operator,')'> <php_separator,';'> <php_whitespa ce,'\n '> . Engine should prefer and choose CORRECT constructions against many cases with incorrect result constructions.
As far as I understand it, your grammar is LR or LALR, but current version of Schliemann engine supports LL grammars only. Its sometimes hard to revrite LR grammar to LL one, and I have no idea how to do it in your case.