Ejemplo n.º 1
0
        internal static bool BumpsMax(string str)
        {
            string num = CharacterUtilities.CanonicalizeCharacterLiteral(str, 1);
            int    ord = CharacterUtilities.OrdinalOfCharacterLiteral(str, 1);

            return(ord > Terminal.max);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// If name is an escaped char-lit, it must already be
 /// canonicalized according to some convention. In this
 /// application CharUtils.Canonicalize().
 /// </summary>
 /// <param name="symbolic">Means "is an ident, not a literal character"</param>
 /// <param name="name">string representation of symbol</param>
 internal Terminal(bool symbolic, string name)
     : base(name)
 {
     this.symbolic = symbolic;
     if (symbolic)
     {
         this.n = ++count;
     }
     else
     {
         this.n = CharacterUtilities.OrdinalOfCharacterLiteral(name, 1);
         if (n > max)
         {
             max = n;
         }
     }
 }