NFX.CodeAnalysis NamespaceNFX Class Library

[This is preliminary documentation and is subject to change.]

Provides code analysis-related base contracts/models for writing compilers and various textual processors. JSON, C#, Laconic parsers are implemented using this concept
Classes

  ClassDescription
Public classCodeAnalysisException
Base exception thrown by the framework
Public classCodeProcessorException
Thrown by code processors such as lexers, parsers , symantic analyzers, compilers etc...
Public classCommonCodeProcessor
Provides base implementation for common code processors
Public classLanguage
Represents and abstraction of the language
Public classLazyFSMState TToken 
Represents a state object for Lazy Finate State Machine that enumerates tokes from IEnumerable(Token) and does not support a notion of index addressing
Public classLexer TToken 
Performs lexical analysis of the source code in particular language Allows to enumerate over source as typed Token stream - depending on implementation enumeration may do lexical analysis token-by-token or in chunks with every enumerator advance
Public classMessage
Represents a message emitted from code-analyzing entities such as lexers, parsers, semantic analyzers and compilers. Messages have severity type like warning, info or error etc.
Public classMessageList
Provides a list of messages, this class is not thread-safe
Public classObjectResultAnalysisContext TObject 
A context that can hold analysis result as TObject. This class is useful for cases like dynamic language parsers (i.e. JSON)
Public classParser TLexer 
Performs parsing of token streams provided by lexers
Public classPatternSearch
Provides Token-pattern matching utilities
Public classSourceRefCommonCodeProcessor
Provides base implementation for common code processors
Public classStringEscapeErrorException
Public classToken
Represents a lexical token of the language. This is an abstract class that particular language implementations must extend to define language-specific token types
Public classTokenized TToken 
Provides read-only view over TokenList
Public classTokenList TToken 
A list of tokens
Public classUnspecifiedLanguage
Represents Unspecified unknown language
Interfaces

  InterfaceDescription
Public interfaceIAnalysisContext
Describes 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.
Public interfaceICodeProcessor
Describes an entity that may process source code in some language
Public interfaceILanguageProcessorNotifications
Describes an entity capable of receiving messages as they are emitted by entities such as parsers and compilers
Public interfaceILexer
Describes general lexer interface. Lexers turn string source input which is obtained via ISourceText implementation (i.e. FileSource,WebSource...) into tokenized stream. Some lexer implementations may support lazy analysis, that is - source text analysis which is done in chunks when lexer is iterated over, others may lex the whole source text at once
Public interfaceIParser
Describes general parser interface
Public interfaceIProjectItem
Represents an item that is a part of some project, i.e. a CS source file in CSharp project
Delegates

  DelegateDescription
Public delegateLazyFSMPredicate TToken 
Lazy Finate State Machine (FSM) predicate, tries to match condition and returns appropriate next action
Enumerations

  EnumerationDescription
Public enumerationFSMI
Describes transition instructions for Finate State Machine (FSM)
Public enumerationLanguageFamily
Defines various languages
Public enumerationMessageType
Message type like: Info, Warning, Error
Public enumerationTokenKind
Provides language-agnostic token classification