-1

I'm doing some exercise in Rascal. When I try to determine the Cyclomatic complexity of a Java method getting methods from an AST. I would like to evaluate the ? operator. As it is not determined by '/if(_, _, )', I tried to determine it using postfix(, _); (infix works fine finding || or &&) Still no success. Anybody who can unhide this secret to me?

Thanks in Advance

Ben
  • 1
  • 1

1 Answers1

0

Use the force; the source for the AST definition is here https://github.com/cwi-swat/rascal/blob/master/src/org/rascalmpl/library/lang/java/m3/AST.rsc, also mentioning the conditional constructor Mark pointed out in his comment.

If you use iprintln on the AST for a small example, like iprintln(ast) or import util::ValueUI; and then text(ast) for an editor with the formatted AST it's easy to find out what ASTs look like.

Jurgen Vinju
  • 6,393
  • 1
  • 15
  • 26