예제 #1
0
 public ErrorEvent(SourcePosition position, string description, int code)
 {
     IsError = true;
     this.Position = position;
     this.Description = description;
     this.Code = code;
 }
예제 #2
0
 public SourcePosition GetSourcePosition()
 {
     var pos = new SourcePosition();
     pos.Position = currCharIndex;
     pos.TokenLength = GetForwardToken().Attribute.Length;
     return pos;
 }
        public void DispatchError(SourcePosition position, string description, int code = 1)
        {
            ErrorEventHandler handler = Error;

            if (handler != null)
            {
                handler(this, new ErrorEvent(position, description, code));
            }
        }
        public void DispatchWarning(SourcePosition position, string description)
        {
            ErrorEventHandler handler = Error;

            if (handler != null)
            {
                var e = new ErrorEvent(position, description, 0);
                e.IsError = false;
                handler(this, e);
            }
        }
예제 #5
0
 public void SetTextPosition(SourcePosition pos)
 {
     TextPosition = pos;
 }
예제 #6
0
 private void PushNode(AstNode node)
 {
     node.SetTextPosition(tokenCurrPosition);
     nodes.Push(node);
     tokenCurrPosition = null;
 }
예제 #7
0
 public void SetSoursePosition(SourcePosition position)
 {
     tokenCurrPosition = position;
 }
예제 #8
0
 protected void DispatchError(SourcePosition position, string description, int code = -1)
 {
     result = false;
     ErrorDispatcher.DispatchError(position, description, code);
 }
예제 #9
0
 protected void DispatchError(SourcePosition position, string description, int code)
 {
     ErrorDispatcher.DispatchError(position, description, code);
 }