hi, as far as I could tell there's no support for goto statements in PCT (that is, special nodes or something). I don't know whether there are any plans to add special support for it, but here's an idea I was thinking about. It would be rather helpful, instead of having this handle by each language implementer, by manually generating (:inline) statements that result in a label and the relating "goto"/"jump" statements; it's a pretty common feature.
Statements like "break", "next", "last", "continue" typically take a label as an argument (or it's implicit like for "continue"). For a HLL, these "labels" are typically not visible for the programmer (although I think Perl does support this, with nested loops and labels). My idea is this: what if there's a :pasttype('goto') (or 'jump', or whatever) that takes a PAST node as an argument (or 'child' as it is called in the domain of ast). PAST nodes are typically "blocks" or at least "basic operation constructs". Blocks often have labels (begin_if, begin_while, end_while, etc.). So, when translating this "goto" past node, the label that is generated for this block is then inserted as the target of the "goto" statement. while ($x < 10) { $x++; next if $x < 5; print $x; } This would only print numbers 5 to 10. The "next" statement is represented by a PAST::Op, type "goto" (or whatever), and takes the PAST representing the while loop itself as an argument. This while loop already has a label (which is jumped to at the end of the body) which is then used for the "next" statement. "Break" (or "last") would take the end-label of the while loop, or from the statement after the while block. (mmm this may get ugly after all...). This could be solved by adding methods like startlabel() and endlabel() for instance. Another PAST node could be to represent labels. When a label PAST node is added as a child to some 'goto' (or the like) statement, it is translated as "goto <label>". Anyway, just some thoughts. kjs