Open enjoysmath opened 1 year ago
You define a rule in your grammar for the keywords:
Basic:
LET <- "let"
switch (p.name)
{
case "Basic:LET":
// ...
break;
}
If you don't use grammar composition, I suppose you can do
switch (p.name[6..$])
{
case "LET":
// ...
break;
}
So with the usual swith-case to handle the parse tree (do something with it), I'm having trouble seeing how to branch based on these long names. One solution I had was a pre-switch if-then statement that checked if "SomeText" is a substring of the name. I'm not liking this solution!