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? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -