Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | Static Public Member Functions | List of all members
LeMP.MacroInfo Class Reference

Data returned from IMacroContext.AllKnownMacros More...


Source file:
Inheritance diagram for LeMP.MacroInfo:
LeMP.LexicalMacroAttribute

Remarks

Data returned from IMacroContext.AllKnownMacros

Properties

Symbol Namespace [get]
 
LexicalMacro Macro [get]
 
- Properties inherited from LeMP.LexicalMacroAttribute
string Syntax [get, protected set]
 
string Description [get, protected set]
 
string[] Names [get]
 
MacroMode Mode [get, set]
 
MacroMode Priority [get]
 

Public Member Functions

 MacroInfo (Symbol @namespace, string name, LexicalMacro macro)
 
 MacroInfo (Symbol @namespace, LexicalMacroAttribute a, LexicalMacro macro)
 
- Public Member Functions inherited from LeMP.LexicalMacroAttribute
 LexicalMacroAttribute (string syntax, string description, params string[] names)
 LexicalMacroAttribute constuctor. More...
 

Static Public Member Functions

static IEnumerable< MacroInfoGetMacros (Type type, IMessageSink errorSink=null, Symbol @namespace=null, object instance=null)
 Uses reflection to find a list of macros within the specified type by searching for (static) methods that (1) are marked with LexicalMacroAttribute and (2) take no parameters and return a list (IEnumerable) of MacroInfo. Such methods are called to get macros. More...
 

Member Function Documentation

◆ GetMacros()

static IEnumerable<MacroInfo> LeMP.MacroInfo.GetMacros ( Type  type,
IMessageSink  errorSink = null,
Symbol namespace = null,
object  instance = null 
)
inlinestatic

Uses reflection to find a list of macros within the specified type by searching for (static) methods that (1) are marked with LexicalMacroAttribute and (2) take no parameters and return a list (IEnumerable) of MacroInfo. Such methods are called to get macros.

Parameters
typeThe type to search for macros.
namespaceOptionally overrides the namespace associated with macros marked with LexicalMacroAttribute. Does not affect macros returned in a list of MacroInfo.
errorSinkAn object in which to send error messages (Severity.Warning is used because unavailability of a macro should not appear as an error when compiling something with LeMP.)
instanceAn optional object of the same type as type, which will be used to bind instance methods. If this is null, only static methods are discovered.
Returns

References LeMP.LexicalMacro().