rascal - In a visit expression, can the default be labeled like the cases? -


example:

visit(sometree) {     case a:somenodea(_,_): handlenodea(a);     default:               handle(???); } 

so want handle other cases using default, how can this?

visit not support default because needs specific bind while visiting. instead can write pattern matches everything. example:

visit(sometree) {    case node x : handlealltreelikethings(x);    case str y(value x, value y) : handleallbinarytrees(y, x, y);    case value x : handleallvalueswhatsoever(x); } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -