SemErr() public method

public SemErr ( int line, int col, string s ) : void
line int
col int
s string
return void
Ejemplo n.º 1
0
 public void SemErr(string msg)
 {
     if (errDist >= minErrDist)
     {
         errors.SemErr(t.line, t.col, msg);
     }
     errDist = 0;
 }
Ejemplo n.º 2
0
 public void SemErr(string msg)
 {
     if (_errDist >= Constants.MINIMUM_ERROR_DISTANCE)
     {
         Errors.SemErr(t.line, t.col, msg);
     }
     _errDist = 0;
 }
Ejemplo n.º 3
0
 public void GetTargetStates(Action a, out BitArray targets, out Symbol endOf, out bool ctx)
 {
     // compute the set of target states
     targets = new BitArray(maxStates); endOf = null;
     ctx     = false;
     for (Target t = a.target; t != null; t = t.next)
     {
         int stateNr = t.state.nr;
         if (stateNr <= lastSimState)
         {
             targets[stateNr] = true;
         }
         else
         {
             targets.Or(MeltedSet(stateNr));
         }
         if (t.state.endOf != null)
         {
             if (endOf == null || endOf == t.state.endOf)
             {
                 endOf = t.state.endOf;
             }
             else
             {
                 errors.SemErr("Tokens " + endOf.name + " and " + t.state.endOf.name + " cannot be distinguished");
             }
         }
         if (t.state.ctx)
         {
             ctx = true;
             // The following check seems to be unnecessary. It reported an error
             // if a symbol + context was the prefix of another symbol, e.g.
             //   s1 = "a" "b" "c".
             //   s2 = "a" CONTEXT("b").
             // But this is ok.
             // if (t.state.endOf != null) {
             //   Console.WriteLine("Ambiguous context clause");
             //	 errors.count++;
             // }
         }
     }
 }