views:

234

answers:

2

i been thinking of a new programming language. Before trying to implement it i would like to check the syntax of code to see if there is much ambiguity. (i find it funny that its possibly to do var++++ to a class)

+6  A: 

Write down the syntax in the correct format and use Antlr or any other parser generater to generate a parser. Those usually warn you about ambiguities.

Joachim Sauer
+1  A: 

Remember, grammars that are ambiguous for one style of parser many not be ambiguous for a different one.

If you want the language to work for you, test with the parser generator you plan to use. If you want it to be easier for others to implement, test with a few different parser generators and study their errors/warnings until you understand exactly what ambiguity they are seeing.

Darron