Beispiel #1
0
        protected void EmitMessage(MessageType type, int code, SourceCodeRef srcRef, SourcePosition? position = null, Token token = null, string text = null, Exception exception = null)
        {
            if (Messages==null && type!=MessageType.Error && type!=MessageType.InternalError) return;

            var msg = new Message(srcRef, type, code, this, position ?? SourcePosition.UNASSIGNED, token, text, exception);
            
            if (type==MessageType.Error || type==MessageType.InternalError)
             if (ThrowErrors || Messages==null)
             {
               throw new CodeProcessorException(this, StringConsts.CA_PROCESSOR_EXCEPTION_ERROR.Args(Language, GetType().Name, msg.ToString()));
             }


            Messages.Add( msg );   
        }
Beispiel #2
0
 public LaconfigToken(LaconfigLexer lexer, LaconfigTokenType type, SourcePosition startPos, SourcePosition endPos, string text, object value = null) :
                    base(lexer, startPos, endPos, text, value)
 {
   Type = type;
 }
Beispiel #3
0
 public JSONToken(JSONLexer lexer, JSONTokenType type, SourcePosition startPos, SourcePosition endPos, string text, object value = null)
     : base(lexer, startPos, endPos, text, value)
 {
     Type = type;
 }