Class CommonCodeProcessor
Provides base implementation for common code processors
Inheritance
System.Object
    CommonCodeProcessor
      
      
      
  Implements
Inherited Members
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.ToString()
    
  Namespace: NFX.CodeAnalysis
Assembly: NFX.dll
Syntax
public abstract class CommonCodeProcessor : ICodeProcessor
  Constructors
CommonCodeProcessor(IAnalysisContext, MessageList, Boolean)
Declaration
protected CommonCodeProcessor(IAnalysisContext context, MessageList messages = null, bool throwErrors = false)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IAnalysisContext | context | |
| MessageList | messages | |
| System.Boolean | throwErrors | 
Properties
Context
Returns context that this processor operates under - an entity that retains state during analysis, such as: module compiler, project compiler, code unit translator etc. This entity may also contain compiler/parser/lexer options etc.
Declaration
public IAnalysisContext Context { get; }
  Property Value
| Type | Description | 
|---|---|
| IAnalysisContext | 
Language
Returns language that this processor is capable of processing
Declaration
public abstract Language Language { get; }
  Property Value
| Type | Description | 
|---|---|
| Language | 
Messages
References message list that lexer emitts messages into. May be null
Declaration
public MessageList Messages { get; }
  Property Value
| Type | Description | 
|---|---|
| MessageList | 
ThrowErrors
When true, throws an exception on the first error even when MessageList is set. When MessageList is not set any lexing error is always thrown regardless of this parameter
Declaration
public bool ThrowErrors { get; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
Methods
EmitMessage(MessageType, Int32, SourceCodeRef, Nullable<SourcePosition>, Token, String, Exception)
Declaration
protected void EmitMessage(MessageType type, int code, SourceCodeRef srcRef, SourcePosition? position = default (SourcePosition? ), Token token = null, string text = null, Exception exception = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MessageType | type | |
| System.Int32 | code | |
| SourceCodeRef | srcRef | |
| System.Nullable<SourcePosition> | position | |
| Token | token | |
| System.String | text | |
| System.Exception | exception | 
MessageCodeToString(Int32)
Returns string representation of message code which is output by this processor
Declaration
public abstract string MessageCodeToString(int code)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | code | 
Returns
| Type | Description | 
|---|---|
| System.String |