Enhanced C#
Language of your choice: library documentation
Public Member Functions | List of all members
Loyc.Syntax.ILiteralParser Interface Reference

This interface for parsing text into objects is implemented by LiteralHandlerTable. More...


Source file:
Inheritance diagram for Loyc.Syntax.ILiteralParser:
Loyc.Syntax.LiteralHandlerTable Loyc.Syntax.StandardLiteralHandlers

Remarks

This interface for parsing text into objects is implemented by LiteralHandlerTable.

Public Member Functions

bool CanParse (Symbol typeMarker)
 Returns true if this object has a parser for the specified type marker. More...
 
Either< object, ILogMessageTryParse (UString textValue, Symbol typeMarker)
 Attempts to parse a string with a given type marker. More...
 

Member Function Documentation

◆ CanParse()

bool Loyc.Syntax.ILiteralParser.CanParse ( Symbol  typeMarker)

Returns true if this object has a parser for the specified type marker.

Implemented in Loyc.Syntax.LiteralHandlerTable.

◆ TryParse()

Either<object, ILogMessage> Loyc.Syntax.ILiteralParser.TryParse ( UString  textValue,
Symbol  typeMarker 
)

Attempts to parse a string with a given type marker.

Parameters
textValueA text value that has already been preprocessed to remove escape sequences.
typeMarkerIndicates the type of the value. There is a standard set of type markers; please see the documention of StandardLiteralHandlers.
Returns
Returns either the parsed value or an error message. Does not throw.

If the problem is that the type marker doesn't have an associated parser, the returned LogMessage should not have a Severity of Error; LiteralHandlerTable uses Severity.Note for this.

Implemented in Loyc.Syntax.LiteralHandlerTable.

Referenced by Loyc.Syntax.LNodeFactory.Literal().