Пример #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 );   
        }
Пример #2
0
 public override ILexer MakeLexer(IAnalysisContext context, SourceCodeRef srcRef, ISourceText source, MessageList messages = null, bool throwErrors = false)
 {
     return new LaconfigLexer(context, srcRef, source, messages, throwErrors);
 }
Пример #3
0
 protected SourceRefCommonCodeProcessor(IAnalysisContext context, SourceCodeRef srcRef, MessageList messages = null, bool throwErrors = false) :
     base(context, messages, throwErrors)
 {
     m_SourceCodeReference = srcRef;
 }
Пример #4
0
 public override ILexer MakeLexer(IAnalysisContext context, SourceCodeRef srcRef, ISourceText source, MessageList messages = null, bool throwErrors = false)
 {
     throw new NotImplementedException(GetType().Name+".MakeLexer()");
 }
Пример #5
0
 public override ILexer MakeLexer(IAnalysisContext context, SourceCodeRef srcRef, ISourceText source, MessageList messages = null, bool throwErrors = false)
 {
     throw new NotSupportedException("UnspecifiedLanguage.MakeLexer()");
 }
Пример #6
0
 /// <summary>
 /// Makes lexer capable of this language analysis
 /// </summary>
 public abstract ILexer MakeLexer(IAnalysisContext context, SourceCodeRef srcRef, ISourceText source, MessageList messages = null, bool throwErrors = false);