diff --git a/CSharpTranslator/antlr2/Translator/JavaPrettyPrinter.g b/CSharpTranslator/antlr2/Translator/JavaPrettyPrinter.g index b40e87a..feaa5b3 100644 --- a/CSharpTranslator/antlr2/Translator/JavaPrettyPrinter.g +++ b/CSharpTranslator/antlr2/Translator/JavaPrettyPrinter.g @@ -538,7 +538,7 @@ stat [TextWriter w] typeDefinition[w] | variableDef[w] { Print(w, ";"); } | #(EXPR_STMT expression[w]) { Print(w, ";"); } - | #(LABELED_STAT id:IDENTIFIER { Print(w, #id, ": "); } stat[w]) + | #(LABEL_STMT id:IDENTIFIER { Print(w, #id, ": "); } stat[w]) | #(lif:IF { Print(w, #lif, " ("); } expression[w] { Print(w, ")"); PrintNL(w); } stat[w] @@ -565,8 +565,9 @@ stat [TextWriter w] stat[w] { Print(w, "while ("); } expression[w] { Print(w, ");"); } ) - | #(br:"break" { Print(w, #br); } ( { Print(w, " "); } IDENTIFIER)? { Print(w, ";"); } ) - | #(co:"continue" { Print(w, #co); } ( { Print(w, " "); } IDENTIFIER)? { Print(w, ";"); } ) + | #(gt:"goto" { Print(w, "// TODO: CS2J: goto is not supported by Java."); PrintNL(w); Print(w, "continue "); } gid:IDENTIFIER { Print(w, #gid); Print(w, ";"); } ) + | #(br:"break" { Print(w, #br); } ( { Print(w, " "); } bid:IDENTIFIER { Print(w, #bid); } )? { Print(w, ";"); } ) + | #(co:"continue" { Print(w, #co); } ( { Print(w, " "); } cid:IDENTIFIER { Print(w, #cid); } )? { Print(w, ";"); } ) | #(re:"return" { Print(w, #re); } ( { Print(w, " "); } expression[w])? { Print(w, ";"); } ) | #(sw:"switch" { Print(w, #sw, " ("); } expression[w] { Print(w, ")"); PrintNL(w); Print(w, "{"); indentLevel++; PrintNL(w); } diff --git a/CSharpTranslator/antlr2/Translator/NetTranslator.g b/CSharpTranslator/antlr2/Translator/NetTranslator.g index fcd45e2..b21d6e8 100644 --- a/CSharpTranslator/antlr2/Translator/NetTranslator.g +++ b/CSharpTranslator/antlr2/Translator/NetTranslator.g @@ -762,7 +762,7 @@ stat [object w] : typeDefinition[w] | variableDef[w, true] | #(EXPR_STMT expression[w]) - | #(LABELED_STAT IDENTIFIER stat[w]) + | #(LABEL_STMT IDENTIFIER stat[w]) | #(IF expression[w] stat[w] @@ -829,6 +829,7 @@ stat [object w] stat[w] expression[w] ) + | #("goto" IDENTIFIER ) | #("break" ( IDENTIFIER)? ) | #("continue" ( IDENTIFIER)? ) | #("return" ( expression[w])? )