public void WriteCSharpSymbolConstantsTo(TextWriter writer, string modifiers)
        {
            if (null == modifiers)
            {
                modifiers = "";
            }
            var names = new HashSet <string>();

            writer.WriteLine(string.Concat("\t", modifiers, " const int EOS=", GetSymbolId("#EOS").ToString(), ";"));
            names.Add("EOS");
            writer.WriteLine(string.Concat("\t", modifiers, " const int ERROR=", GetSymbolId("#ERROR").ToString(), ";"));
            names.Add("ERROR");
            foreach (var sym in _EnumSymbols())
            {
                IDictionary <string, object> d;
                object o;
                if (AttributeSets.TryGetValue(sym, out d) && d.TryGetValue("hidden", out o) && o is bool && (bool)o)
                {
                    continue;
                }
                if (AttributeSets.TryGetValue(sym, out d) && d.TryGetValue("collapse", out o) && o is bool && (bool)o)
                {
                    continue;
                }
                var sid = Convert.ToString(sym);
                if (_IsValidIdentifier(sid))
                {
                    string s;
                    if (!string.IsNullOrEmpty(modifiers))
                    {
                        s = string.Concat("\t", modifiers, " const int ");
                    }
                    else
                    {
                        s = string.Concat("\t", modifiers, "const int ");
                    }

                    var id = GetSymbolId(sym);
                    s = string.Concat(s, CS.CreateEscapedIdentifier(sid.Replace('-', '_')), " = ");
                    s = _GetUniqueName(names, s);
                    names.Add(s);
                    s = string.Concat(s, id.ToString(), ";");
                    writer.WriteLine(s);
                }
            }
        }