Enhanced C#
Language of your choice: library documentation
Properties | List of all members
Loyc.IHasLocation Interface Reference

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


Source file:
Inheritance diagram for Loyc.IHasLocation:
Loyc.LLParserGenerator.Pred Loyc.LogMessage Loyc.Syntax.ILNode Loyc.Syntax.LNode Loyc.LLParserGenerator.Alts Loyc.LLParserGenerator.DefaultErrorBranch Loyc.LLParserGenerator.EndOfRule Loyc.LLParserGenerator.Gate 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 IHasLocation.

Properties

object Location [get]