On Saturday, 11 January 2014 at 09:17:34 UTC, Philippe Sigaud wrote:
        case "Gramm.Expr":
            return foo(t);
        case "Gramm.FunctionCall":
            return foo(t);
        case "Gramm.Declaration":
            return foo(t);
        default:
            throw new Exception("...");

I can't do this since there will be multiple rules with the same name that require different treatment. The reason I want to use semantic actions is that I don't want to push an already heavy grammar into double or triple size just to name specific rules in a certain way. Semantic actions take up very little space and fit nicely into the syntax.


or do it with a template, holding function names as aliases:

alias actor = dispatcher!(foo, bar, baz);

I have no idea what you mean. :D

Reply via email to