Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Properties | List of all members
Loyc.ILocation Interface Reference

This interface allows an object to declare its "location". More...


Source file:
Inheritance diagram for Loyc.ILocation:
Loyc.IHasLocation Loyc.LLParserGenerator.Pred Loyc.LogMessage Loyc.Syntax.ILNode Loyc.Syntax.LNode Loyc.LLParserGenerator.Alts Loyc.LLParserGenerator.DefaultErrorBranch Loyc.LLParserGenerator.EndOfRule m), which is a mechanism to separate prediction from matching in the contex..." alt="Loyc.LLParserGenerator.Gate" shape="rect" coords="556,280,824,304"/> Loyc.LLParserGenerator.RuleRef Loyc.LLParserGenerator.Seq Loyc.LLParserGenerator.TerminalPred Loyc.LLParserGenerator.ZeroWidthPred Loyc.Syntax.LNode Loyc.Syntax.CallNode Loyc.Syntax.IdNode Loyc.Syntax.LiteralNode

Remarks

This interface allows an object to declare its "location".

Objects designed to be used as a context parameter in IMessageSink{T} can implement this interface so that the string form of the message shows the location of a piece of data instead of the data itself. For example, Loyc.Syntax.LNode implements this interface so that when a compiler error refers to a source code construct, the context of the LogMessage can refer to the code itself while the printed form of the the error message shows the location of the code instead.

Given a context object that may or may not implement this interface, it's handy to use MessageSink.ContextToString to convert the "context" of a message into a string, or MessageSink.LocationOf(object) to unwrap objects that implement ILocation.

Properties

object Location [get]