public override void SetAltAssoc(AltAST t, int alt)
{
ASSOC assoc = ASSOC.left;
if (t.GetOptions() != null)
{
string a = t.GetOptionString("assoc");
if (a != null)
{
if (a.Equals(ASSOC.right.ToString()))
{
assoc = ASSOC.right;
}
else if (a.Equals(ASSOC.left.ToString()))
{
assoc = ASSOC.left;
}
else
{
tool.errMgr.GrammarError(ErrorType.ILLEGAL_OPTION_VALUE, t.g.fileName, t.GetOptionAST("assoc").Token, "assoc", assoc);
}
}
}
if (altAssociativity.ContainsKey(alt) && altAssociativity[alt] != assoc)
{
tool.errMgr.ToolError(ErrorType.INTERNAL_ERROR, "all operators of alt " + alt + " of left-recursive rule must have same associativity");
}
altAssociativity[alt] = assoc;
// System.out.println("setAltAssoc: op " + alt + ": " + t.getText()+", assoc="+assoc);
}