Hi Tom,
The problem is due to a conflict between the "type" and "expression6" productions:
type = {basic} address_of* type_name | {function} address_of* l_par type r_par par_parameter_list; expression6 = {prioritized} expression7 | {unary} unary_op expression6 | {dereference} dereference expression6 | {address_of} address_of variable_name;
I suggest to replace, in both alternatives of the "type" production, "*" by "?" if your objective was simply to make the "address_of" token optional as type prefix.
I am puzzled by the syntax of the "function" alternative of the "type" production. Its use of parentheses around the type will surely cause other conflicts.
Have fun!
Etienne
Etienne Gagnon, Ph.D. https://sablecc.org
--
You received this message because you are subscribed to the Google Groups "SableCC" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sablecc+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sablecc/d9f3fba4-5850-4177-85ea-25da0353ff31n%40googlegroups.com.
Hi Tom,
Effectively, after replacing "*" with "?" in both alternatives, new conflicts caused by the function alternative are detected. See the attached modified grammar.
Hi Tom,
File encoding is handled by Java's FileReader class. Since Java version 11, this class has a specific constructor to specify the desired encoding:
public FileReader(String fileName, Charset charset)
To view this discussion on the web visit https://groups.google.com/d/msgid/sablecc/1761f5ac-36a6-4020-97bf-4f028aac54e0n%40googlegroups.com.